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 | 40 +++++++++++++++++++++++++++++++++++++--- 1 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue index e136054..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 @@ -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