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

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

diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index 39d314e..7a31fb8 100644
--- a/src/views/eam/equipment/EamEquipmentList.vue
+++ b/src/views/eam/equipment/EamEquipmentList.vue
@@ -43,7 +43,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
@@ -107,7 +107,6 @@
         style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
         <a style="margin-left: 24px" @click="onSelectChange([])">娓呯┖</a>
       </div>
-
       <a-table
         ref="table"
         size="middle"
@@ -305,7 +304,6 @@
           {
             title: '璁惧鍒嗙被',
             align: 'center',
-            width: 100,
             dataIndex: 'equipmentCategory_dictText'
           },
           {
@@ -338,23 +336,20 @@
             width: 100,
             dataIndex: 'installationPosition'
           },
-
           {
             title: '绔嬮」鍗″彿',
             align: 'center',
-            width: 100,
             dataIndex: 'cardNumber'
           },
           {
             title: '鍑哄巶缂栧彿',
             align: 'center',
-            width: 100,
             dataIndex: 'factoryNumber'
           },
           {
             title: '鏈哄簥鍘傚',
             align: 'center',
-            width: 100,
+            width: 300,
             dataIndex: 'manufacturingEnterprise'
           },
           {
@@ -423,23 +418,23 @@
           {
             title: '璁惧绔彛',
             align: 'center',
-            width: 100,
             dataIndex: 'equipmentPort'
           },
           {
             title: '鍧愭爣鏁伴噺',
             align: 'center',
-            width: 100,
             dataIndex: 'coordinateNum'
           },
           {
             title: '鍒涘缓浜�',
             align: 'center',
+            width: 100,
             dataIndex: 'createBy_dictText'
           },
           {
             title: '鍒涘缓鏃堕棿',
             align: 'center',
+            width: 200,
             dataIndex: 'createTime'
           },
           {
@@ -455,7 +450,6 @@
           {
             title: '澶囨敞',
             align: 'center',
-            width: 100,
             dataIndex: 'remark'
           },
           {
@@ -480,7 +474,8 @@
         printedRows: [],
         activeTabKey: 1,
         appHomeUrl: '',
-        currentTableRowRecord: {}
+        currentTableRowRecord: {},
+        treeDataAlias: [],
       }
     },
     computed: {
@@ -498,6 +493,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)
           }
@@ -587,7 +584,38 @@
             this.appHomeUrl = res.result.settingValue
           }
         })
-      }
+      },
+      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