From ef3408f9a474c7e64016fbe0d0b7f6de0d2c99dd Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 14 五月 2025 14:16:48 +0800
Subject: [PATCH] art: 设备管理-保养标准-导入功能

---
 src/views/eam/equipment/EamEquipmentList.vue |   57 ++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 40 insertions(+), 17 deletions(-)

diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index 8c6b24c..1516153 100644
--- a/src/views/eam/equipment/EamEquipmentList.vue
+++ b/src/views/eam/equipment/EamEquipmentList.vue
@@ -16,8 +16,8 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鍏抽敭璁惧鏍囪瘑">
-              <j-dict-select-tag dict-code="yn" placeholder="璇烽�夋嫨鍏抽敭璁惧鏍囪瘑"
+            <a-form-item label="绠$悊鍒嗙被">
+              <j-dict-select-tag dict-code="equipment_abc_flag" placeholder="璇烽�夋嫨绠$悊鍒嗙被"
                                  v-model="queryParam.equipmentImportance"></j-dict-select-tag>
             </a-form-item>
           </a-col>
@@ -29,21 +29,16 @@
               </a-form-item>
             </a-col>
             <a-col :xl="6" :lg="7" :md="8" :sm="24">
-              <a-form-item label="鎶�鏈姸鎬�">
-                <j-dict-select-tag dict-code="technology_status" placeholder="璇烽�夋嫨鎶�鏈姸鎬�"
-                                   v-model="queryParam.technologyStatus"></j-dict-select-tag>
-              </a-form-item>
-            </a-col>
-            <a-col :xl="6" :lg="7" :md="8" :sm="24">
-              <a-form-item label="鎿嶄綔绯荤粺">
-                <a-input placeholder="璇疯緭鍏ユ搷浣滅郴缁�" v-model="queryParam.operationSystem"></a-input>
+              <a-form-item label="璁惧绫诲埆">
+                <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧绫诲埆"
+                                   v-model="queryParam.equipmentCategory"></j-dict-select-tag>
               </a-form-item>
             </a-col>
             <a-col :xl="6" :lg="7" :md="8" :sm="24">
               <a-form-item label="浣跨敤杞﹂棿">
                 <a-tree-select v-model="queryParam.orgId"
                                style="width: 100%"
-                               :tree-data="treeData"
+                               :tree-data="treeDataAlias"
                                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                                placeholder="璇烽�夋嫨浣跨敤杞﹂棿"
                                allow-clear
@@ -52,12 +47,7 @@
                 </a-tree-select>
               </a-form-item>
             </a-col>
-            <a-col :xl="6" :lg="7" :md="8" :sm="24">
-              <a-form-item label="璁惧鍒嗙被">
-                <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧鍒嗙被"
-                                   v-model="queryParam.equipmentCategory"></j-dict-select-tag>
-              </a-form-item>
-            </a-col>
+
           </template>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -473,6 +463,7 @@
         currentTableRowRecord: {},
         isOpenProcess: false,
         isOpenPrecision: false,
+        treeDataAlias: [],
       }
     },
     computed: {
@@ -490,6 +481,8 @@
         getAction(this.url.loadProductionOptions).then(res => {
           if (res.success) {
             this.treeData = [...res.result]
+            this.treeDataAlias = this.deepCopyAndModify(res.result)
+            console.info('treeDataAlias====', this.treeDataAlias)
           } else {
             that.$message.warning(res.message)
           }
@@ -600,7 +593,37 @@
           }
         })
       },
+      deepCopyAndModify(arr) {
+        // 濡傛灉褰撳墠鍏冪礌涓嶆槸鏁扮粍鎴栧璞★紝鐩存帴杩斿洖
+        if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) {
+          return arr;
+        }
 
+        // 濡傛灉鏄暟缁勶紝鍒涘缓涓�涓柊鏁扮粍骞堕�掑綊澶勭悊姣忎釜鍏冪礌
+        if (Array.isArray(arr)) {
+          const newArray = [];
+          for (let i = 0; i < arr.length; i++) {
+            newArray.push(this.deepCopyAndModify(arr[i]));
+          }
+          return newArray;
+        }
+
+        // 濡傛灉鏄璞★紝鍒涘缓涓�涓柊瀵硅薄骞堕�掑綊澶勭悊姣忎釜灞炴��
+        const newObj = {};
+        for (const key in arr) {
+          if (arr.hasOwnProperty(key)) {
+            if(key === 'selectable') {
+              newObj[key] = true;
+            } else if(key === 'children') {
+              newObj[key] = this.deepCopyAndModify(arr[key]);
+            }else {
+              newObj[key] = arr[key];
+            }
+
+          }
+        }
+        return newObj;
+      },
     }
   }
 </script>

--
Gitblit v1.9.3