Jelajahi Sumber

调整巡检项缓存

lipenghui 3 bulan lalu
induk
melakukan
32195b8932

+ 1 - 1
src/views/pms/inspect/route/InspectItemList.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog v-model="dialogVisible" title="选择巡检项" style="width: 1300px; min-height: 115%">
+  <Dialog v-model="dialogVisible" title="选择巡检项" style="width: 1300px; min-height: 80%">
     <ContentWrap>
       <el-form
         class="-mb-15px"

+ 9 - 2
src/views/pms/inspect/route/IotInspectRoute.vue

@@ -181,8 +181,15 @@ const formRules = reactive({
 
 const formRef = ref() // 表单 Ref
 const inspectItemChoose = (rows) => {
-  items.value = []
-  items.value = rows
+  rows.forEach(it =>{
+    const ifExist = items.value.find(item => item.id === it.id)
+    if (!ifExist) {
+      items.value.push(it)
+      console.log(JSON.stringify(it))
+    }
+  })
+  console.log(JSON.stringify(items.value))
+  // items.value = rows
 }
 const inspectItemFormRef = ref()
 const openForm = () => {