From ea1497cbb477825522c79cff1b7e1f2e96003ad2 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 02 六月 2025 08:58:58 +0800
Subject: [PATCH] art: 工作流-待办列表调整

---
 src/views/eam/equipment/EamEquipmentList.vue |  149 +++++++++++++++++++++++++++++--------------------
 1 files changed, 89 insertions(+), 60 deletions(-)

diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index 1ba6057..82959a8 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
@@ -85,13 +85,13 @@
       <a-button type="primary" icon="download" @click="handleTemplateXlsDownload">瀵煎叆妯℃澘涓嬭浇</a-button>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/>
-            鍒犻櫎
-          </a-menu-item>
-          <a-menu-item key="2" @click="handleOpenNameplateModal(selectionRows)">
+          <a-menu-item key="1" @click="handleOpenNameplateModal(selectionRows)">
             <a-icon type="printer"/>
             鎵撳嵃閾墝
+          </a-menu-item>
+          <a-menu-item key="2" @click="batchDel" v-if="isShowAuth('eam:equipment:delete')">
+            <a-icon type="delete"/>
+            鍒犻櫎
           </a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
@@ -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"
@@ -117,6 +116,7 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
+        class="j-table-force-nowrap"
         :scroll="{ x: 'max-content' }"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange"
@@ -128,15 +128,15 @@
         <span slot="mdcFlag" slot-scope="text">
           <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�"/>
         </span>
-        <span slot="processParametersFlag" slot-scope="text">
+<!--        <span slot="processParametersFlag" slot-scope="text">
           <lx-switch v-model="text" disabled checked-children="鏈�" un-checked-children="鏃�"/>
-        </span>
-        <span slot="precisionParametersFlag" slot-scope="text">
+        </span>-->
+<!--        <span slot="precisionParametersFlag" slot-scope="text">
           <lx-switch v-model="text" disabled checked-children="鏈�" un-checked-children="鏃�"/>
-        </span>
-        <span slot="specialEquipment" slot-scope="text">
+        </span>-->
+<!--        <span slot="specialEquipment" slot-scope="text">
           <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�"/>
-        </span>
+        </span>-->
         <span slot="action" slot-scope="text, record">
           <a @click.stop="handleEdit(record)">缂栬緫</a>
 
@@ -153,7 +153,7 @@
               <a-menu-item>
                 <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a>
               </a-menu-item>
-              <a-menu-item>
+              <a-menu-item v-if="isShowAuth('eam:equipment:delete')">
                 <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
                   <a>鍒犻櫎</a>
                 </a-popconfirm>
@@ -305,7 +305,6 @@
           {
             title: '璁惧鍒嗙被',
             align: 'center',
-            width: 100,
             dataIndex: 'equipmentCategory_dictText'
           },
           {
@@ -338,23 +337,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'
           },
           {
@@ -394,52 +390,52 @@
             dataIndex: 'mdcFlag',
             scopedSlots: { customRender: 'mdcFlag' }
           },
-          {
-            title: '鏈夋棤宸ヨ壓鍙傛暟',
-            align: 'center',
-            width: 120,
-            dataIndex: 'processParametersFlag',
-            scopedSlots: { customRender: 'processParametersFlag' }
-          },
-          {
-            title: '鏈夋棤绮惧害鍙傛暟',
-            align: 'center',
-            width: 120,
-            dataIndex: 'precisionParametersFlag',
-            scopedSlots: { customRender: 'precisionParametersFlag' }
-          },
-          {
-            title: '鏄惁涓虹壒绉嶈澶�',
-            align: 'center',
-            width: 120,
-            dataIndex: 'specialEquipment',
-            scopedSlots: { customRender: 'specialEquipment' }
-          },
-          {
-            title: '閲嶉噺',
-            align: 'center',
-            dataIndex: 'equipmentWeight'
-          },
-          {
-            title: '璁惧绔彛',
-            align: 'center',
-            width: 100,
-            dataIndex: 'equipmentPort'
-          },
-          {
-            title: '鍧愭爣鏁伴噺',
-            align: 'center',
-            width: 100,
-            dataIndex: 'coordinateNum'
-          },
+          // {
+          //   title: '鏈夋棤宸ヨ壓鍙傛暟',
+          //   align: 'center',
+          //   width: 120,
+          //   dataIndex: 'processParametersFlag',
+          //   scopedSlots: { customRender: 'processParametersFlag' }
+          // },
+          // {
+          //   title: '鏈夋棤绮惧害鍙傛暟',
+          //   align: 'center',
+          //   width: 120,
+          //   dataIndex: 'precisionParametersFlag',
+          //   scopedSlots: { customRender: 'precisionParametersFlag' }
+          // },
+          // {
+          //   title: '鏄惁涓虹壒绉嶈澶�',
+          //   align: 'center',
+          //   width: 120,
+          //   dataIndex: 'specialEquipment',
+          //   scopedSlots: { customRender: 'specialEquipment' }
+          // },
+          // {
+          //   title: '閲嶉噺',
+          //   align: 'center',
+          //   dataIndex: 'equipmentWeight'
+          // },
+          // {
+          //   title: '璁惧绔彛',
+          //   align: 'center',
+          //   dataIndex: 'equipmentPort'
+          // },
+          // {
+          //   title: '鍧愭爣鏁伴噺',
+          //   align: 'center',
+          //   dataIndex: 'coordinateNum'
+          // },
           {
             title: '鍒涘缓浜�',
             align: 'center',
+            width: 100,
             dataIndex: 'createBy_dictText'
           },
           {
             title: '鍒涘缓鏃堕棿',
             align: 'center',
+            width: 200,
             dataIndex: 'createTime'
           },
           {
@@ -455,7 +451,6 @@
           {
             title: '澶囨敞',
             align: 'center',
-            width: 100,
             dataIndex: 'remark'
           },
           {
@@ -480,7 +475,8 @@
         printedRows: [],
         activeTabKey: 1,
         appHomeUrl: '',
-        currentTableRowRecord: {}
+        currentTableRowRecord: {},
+        treeDataAlias: [],
       }
     },
     computed: {
@@ -498,6 +494,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 +585,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