From a7ed137d53ebcaaf8f9429a53a34ece9351cc05c Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期四, 22 五月 2025 10:26:11 +0800 Subject: [PATCH] art: 设备管理-三保-列表、新增修改,增加精度参数明细项 --- src/views/eam/equipment/EamEquipmentList.vue | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue index 43af2a1..c5b9af1 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 @@ -250,7 +250,13 @@ dataIndex: 'equipmentImportance_dictText', }, { - title: '璧勪骇鐘舵��', + title: '鎶�鏈姸鎬�', + align: 'center', + width: 100, + dataIndex: 'technologyStatus_dictText' + }, + { + title: '璧勪骇浣跨敤鐘舵��', align: 'center', width: 100, dataIndex: 'assetStatus_dictText' @@ -300,12 +306,6 @@ align: 'center', width: 100, dataIndex: 'equipmentSpecification' - }, - { - title: '鍖哄彿', - align: 'center', - width: 100, - dataIndex: 'areaCode' }, { title: '鐢垫満鍙版暟', @@ -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