From 6b8a6b0591e97aa7d175c5f6c61d64534f038124 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期一, 12 五月 2025 14:56:03 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/eam/equipment/EamEquipmentList.vue | 124 ++++++++++++++++++++++++++--------------- 1 files changed, 79 insertions(+), 45 deletions(-) diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue index e136054..4ec8b0c 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 @@ -127,15 +127,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> @@ -389,42 +389,42 @@ 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', - dataIndex: 'equipmentPort' - }, - { - title: '鍧愭爣鏁伴噺', - align: 'center', - 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', @@ -474,7 +474,8 @@ printedRows: [], activeTabKey: 1, appHomeUrl: '', - currentTableRowRecord: {} + currentTableRowRecord: {}, + treeDataAlias: [], } }, computed: { @@ -492,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) } @@ -581,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