From 7056a75cc2d05e8c6fd0b21710d76471fc45c59b Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 28 五月 2025 11:28:42 +0800
Subject: [PATCH] art: 设备管理-列表样式调整
---
src/views/eam/equipment/EamEquipmentList.vue | 125 ++++++++++++++++++++++++++---------------
1 files changed, 80 insertions(+), 45 deletions(-)
diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index e136054..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
@@ -116,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"
@@ -127,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>
@@ -389,42 +390,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 +475,8 @@
printedRows: [],
activeTabKey: 1,
appHomeUrl: '',
- currentTableRowRecord: {}
+ currentTableRowRecord: {},
+ treeDataAlias: [],
}
},
computed: {
@@ -492,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)
}
@@ -581,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