From c05ad04ba0fd61b9cf6569fd277672ce0b20e799 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 13 五月 2025 16:41:30 +0800
Subject: [PATCH] art: 设备管理-设备台账-使用车间查询条件选择修改

---
 src/views/eam/equipment/EamEquipmentList.vue |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index 43af2a1..1516153 100644
--- a/src/views/eam/equipment/EamEquipmentList.vue
+++ b/src/views/eam/equipment/EamEquipmentList.vue
@@ -38,7 +38,7 @@
               <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
@@ -463,6 +463,7 @@
         currentTableRowRecord: {},
         isOpenProcess: false,
         isOpenPrecision: false,
+        treeDataAlias: [],
       }
     },
     computed: {
@@ -480,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)
           }
@@ -590,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