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 | 162 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 98 insertions(+), 64 deletions(-) diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue index 78f9599..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> @@ -168,13 +168,13 @@ <a-tabs v-model="activeTabKey" @change="handleTabChange"> <a-tab-pane tab="璁惧鏂囨。" :key="1"> - <eam-equipment-attachment-list ref="tabPaneTableListRef1" /> + <eam-equipment-attachment-list ref="tabPaneTableListRef1"/> </a-tab-pane> <a-tab-pane tab="鐐规宸ュ崟" :key="2"> <eam-inspection-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/> </a-tab-pane> <a-tab-pane tab="鍛ㄤ繚宸ュ崟" :key="3"> - <eam-week-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false" /> + <eam-week-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/> </a-tab-pane> <a-tab-pane tab="缁翠慨宸ュ崟" :key="4"> <eam-repair-order-list ref="tabPaneTableListRef4" :isDisplayOperation="false"/> @@ -189,7 +189,7 @@ <!--閾墝寮圭獥--> <nameplate-modal ref="nameplateModalRef" :printedRows="printedRows"/> <!--灞ュ巻寮圭獥--> - <resume-drawer ref="resumeDrawerRef"/> + <resume-drawer ref="resumeDrawerRef" :currentTableRowRecord="currentTableRowRecord"/> </a-card> </template> @@ -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' }, { @@ -479,7 +474,9 @@ treeData: [], printedRows: [], activeTabKey: 1, - appHomeUrl: '' + appHomeUrl: '', + currentTableRowRecord: {}, + treeDataAlias: [], } }, computed: { @@ -497,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) } @@ -518,7 +517,11 @@ * @param record 琛ㄦ牸琛屼俊鎭� */ handleOpenResumeDrawer(record) { + this.currentTableRowRecord = Object.assign({}, record) + this.$refs.resumeDrawerRef.title = '璁惧灞ュ巻' + `锛�${record.equipmentCode}锛塦 + this.$refs.resumeDrawerRef.dataSource = [] this.$refs.resumeDrawerRef.visible = true + this.$nextTick(() => this.$refs.resumeDrawerRef.getEquipmentResumeByApi()) }, /** @@ -565,7 +568,7 @@ onSelectChange(selectedRowKeys, selectionRows) { this.selectedRowKeys = selectedRowKeys this.selectionRows = selectionRows - this.$refs['tabPaneTableListRef' + this.activeTabKey].queryParam.equipmentId = null; + this.$refs['tabPaneTableListRef' + this.activeTabKey].queryParam.equipmentId = null this.$refs['tabPaneTableListRef' + this.activeTabKey].dataSource = [] this.$refs['tabPaneTableListRef' + this.activeTabKey].onClearSelected() if (selectedRowKeys.length === 1) this.loadTabPaneTableData(selectedRowKeys[0]) @@ -582,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