From 60384e8241fa855b5780260633ee9b9f8904847a Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期五, 20 六月 2025 14:24:19 +0800
Subject: [PATCH] feat(eims-ui-mobile): 为多个页面添加搜索功能 - 在 equ-list、insp-st、maint-st、req-list 和 res-list 页面中添加设备名称和资产编号的模糊搜索

---
 eims-ui-mobile/src/pages/inspect/insp-st.vue |   69 ++++++++++++++++++++++++++++------
 1 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/eims-ui-mobile/src/pages/inspect/insp-st.vue b/eims-ui-mobile/src/pages/inspect/insp-st.vue
index 0eb3a03..f761004 100644
--- a/eims-ui-mobile/src/pages/inspect/insp-st.vue
+++ b/eims-ui-mobile/src/pages/inspect/insp-st.vue
@@ -11,15 +11,14 @@
 <template>
   <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time>
     <template #top>
-      <wd-drop-menu>
-        <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" />
-        <wd-drop-menu-item
-          v-model="filterDate"
-          :options="filterDateList"
-          @change="handleFilterDate"
-        />
-        <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" />
-      </wd-drop-menu>
+      <!-- 澧炲姞涓�涓悳绱㈡爮 -->
+      <wd-search v-model="searchValue" @search="handleSearch">
+      </wd-search>
+      <wd-tabs v-model="activeTab" @change="handleTabChange">
+        <wd-tab title="寰呯偣妫�"></wd-tab>
+        <wd-tab title="寰呯‘璁�"></wd-tab>
+        <wd-tab title="宸插畬鎴�"></wd-tab>
+      </wd-tabs>
     </template>
     <view class="bg-base">
       <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id">
@@ -40,7 +39,7 @@
             </view>
           </view>
         </template>
-        <view class="flex h-[140rpx]" items-center>
+        <view class="flex h-[200rpx]" items-center>
           <image class="slot-img text-center" src="/static/images/camera.png" />
           <view class="flex-1">
             <view class="text-color-gray text-sm mt-1 flex">
@@ -57,9 +56,13 @@
             </view>
             <view class="text-color-gray text-sm mt-2 flex">
               <text>鐘舵�侊細</text>
-              <template v-if="item.recordCount === item.checkCount">
+              <template v-if="item.status === '1'">
                 <wd-icon class="icon-color-success" name="check-outline" size="34rpx"></wd-icon>
                 <text class="ml-1">宸插畬鎴�</text>
+              </template>
+              <template v-else-if="item.status === '2'">
+                <wd-icon class="icon-color-warning" name="check-outline" size="34rpx"></wd-icon>
+                <text class="ml-1">宸茬‘璁�</text>
               </template>
               <template v-else>
                 <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon>
@@ -76,13 +79,19 @@
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
 import { getInspStList } from '@/service/inspect'
 import dayjs from 'dayjs'
+import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store'
+import { isLeader, isLineOrRepair, isOperator } from "@/utils/RoleUtils";
+// 鏍囩椤电浉鍏�
+const activeTab = ref(0) // 榛樿閫変腑绗竴涓爣绛鹃〉锛堝緟鐐规锛�
 
+// 鍘熸湁鍙橀噺
 const viewMode = ref<string>('Day')
 const equName = ref<string>('鎵�鏈夎澶�')
 const filterDate = ref<string>('1')
+const status = ref<string>('0') // 榛樿涓哄緟鐐规鐘舵��
+const searchValue = ref<string>('')
 
 const viewModeList = ref<Record<string, any>[]>([
   { label: '鏃ヨ鍥�', value: 'Day' },
@@ -94,6 +103,25 @@
 ])
 
 const equList = ref<Record<string, any>[]>([{ label: '鎵�鏈夎澶�', value: '鎵�鏈夎澶�' }])
+const userStore = useUserStore()
+// 鏍囩椤靛垏鎹㈠鐞嗗嚱鏁�
+function handleTabChange({ index }) {
+  // 鏍规嵁鏍囩椤电储寮曡缃搴旂殑鐘舵�佸��
+  if (index === 0) {
+    // 寰呯偣妫�
+    status.value = '0'
+  } else if (index === 1) {
+    // 寰呯‘璁�
+    status.value = '1'
+  } else if (index === 2) {
+    // 宸插畬鎴�
+    status.value = '2'
+  }
+  // 閲嶆柊鍔犺浇鏁版嵁
+  reloadData()
+}
+
+// 鍘熸湁鍑芥暟
 function handleViewMode({ value }) {
   reloadData()
 }
@@ -112,12 +140,24 @@
     pageNum,
     pageSize,
     viewMode: viewMode.value,
+    status: status.value, // 娣诲姞鐘舵�佺瓫閫�
+    params: {
+      searchValue: searchValue.value,
+    },
   }
   if (filterDate.value === '1') {
     params.planTime = dayjs().format('YYYY-MM-DD')
   } else {
     delete params.planTime
   }
+
+  console.log('queryList::', isLineOrRepair(), isOperator(), userStore.userInfo)
+  if (isLineOrRepair() || isOperator()) {
+    params.updateBy = userStore.userInfo.userId
+  } else if (isLeader()) {
+    delete params.updateBy
+  }
+  console.log('params::', params)
   getInspStList(params)
     .then((res: any) => {
       // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡
@@ -139,6 +179,11 @@
   })
 }
 
+function handleSearch() {
+  console.log('handleSearch')
+  paging.value.reload()
+}
+
 function reloadData() {
   paging.value.reload()
 }

--
Gitblit v1.9.3