From 353fdae2e6d36a1362425edf593b4012ab68a134 Mon Sep 17 00:00:00 2001 From: ysn <2126564605@qq.com> Date: Wed, 6 May 2026 10:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86-=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=BB=AA=E7=AE=A1=E7=90=86-=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BB=AA-=E6=96=B0=E5=A2=9E=E6=8E=92=E5=BA=8F/=E6=9D=83?= =?UTF-8?q?=E9=99=90=20=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86-=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=BB=AA=E7=AE=A1=E7=90=86-=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BB=AA=E6=9B=B2=E7=BA=BF=E9=85=8D=E7=BD=AE-=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=92=E5=BA=8F/=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/recorderList/index.vue | 168 +++++++++++++++--- .../recorderList/js/recorderColumnData.js | 8 + 2 files changed, 149 insertions(+), 27 deletions(-) diff --git a/src/views/recorderList/index.vue b/src/views/recorderList/index.vue index 320f9eb5..24d4554e 100644 --- a/src/views/recorderList/index.vue +++ b/src/views/recorderList/index.vue @@ -25,38 +25,45 @@ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" + @sort-change="sortChange" + :permission="permissionList" > @@ -77,34 +84,52 @@ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" + @sort-change="sortChange" + :permission="permissionList" > @@ -303,6 +328,7 @@ import { getRecorderHistoryLine, getRecorderHistoryDetail, } from '@/api/equiptManagement/recorderList'; +import { mapGetters } from 'vuex'; export default { data() { return { @@ -319,6 +345,7 @@ export default { loading: false, data: [], form: {}, + query: {}, lineForm: { settingData: [], }, @@ -491,6 +518,65 @@ export default { }, }; }, + computed: { + ...mapGetters(['permission']), + permissionList() { + // 根据当前tab页签返回对应的权限 + if (this.tabPosition === 'recorder') { + // 记录仪权限 + return { + addBtn: this.validData(this.permission.recorderList1_add, false), + viewBtn: this.validData(this.permission.recorderList1_view, false), + delBtn: this.validData(this.permission.recorderList1_del, false), + editBtn: this.validData(this.permission.recorderList1_edit, false), + }; + } else if (this.tabPosition === 'recorderLineSetting') { + // 记录仪曲线配置权限 + return { + addBtn: this.validData(this.permission.recorderList2_add, false), + viewBtn: this.validData(this.permission.recorderList2_view, false), + delBtn: this.validData(this.permission.recorderList2_del, false), + editBtn: this.validData(this.permission.recorderList2_edit, false), + }; + } + return {}; + }, + currentDeletePermission() { + // 当前tab页签对应的删除权限 + if (this.tabPosition === 'recorder') { + return this.validData(this.permission.recorderList1_del, false); + } else if (this.tabPosition === 'recorderLineSetting') { + return this.validData(this.permission.recorderList2_del, false); + } + return false; + }, + currentAddPermission() { + // 当前tab页签对应的新增权限 + if (this.tabPosition === 'recorder') { + return this.validData(this.permission.recorderList1_add, false); + } else if (this.tabPosition === 'recorderLineSetting') { + return this.validData(this.permission.recorderList2_add, false); + } + return false; + }, + currentEditPermission() { + // 当前tab页签对应的修改权限 + if (this.tabPosition === 'recorder') { + return this.validData(this.permission.recorderList1_edit, false); + } else if (this.tabPosition === 'recorderLineSetting') { + return this.validData(this.permission.recorderList2_edit, false); + } + return false; + }, + detailsPermission() { + // 记录仪明细权限 + return this.validData(this.permission.recorderList1_details, false); + }, + packagingCycleSettingPermission() { + // 打包周期配置权限 + return this.validData(this.permission.recorderList1_packagingCycleSetting, false); + }, + }, mounted() { this.tabPositionChange('recorder'); // this.option.column = recorderColumnData[this.tabPosition]; @@ -660,6 +746,34 @@ export default { } }); }, + // 排序 + sortChange({ prop, order }) { + if (this.tabPosition === 'recorder') { + this.query.descs = undefined; + this.query.ascs = undefined; + let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs'; + this.query[orderByFieldKey] = !prop + ? undefined + : prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); + } else if (this.tabPosition === 'recorderLineSetting') { + this.lineQuery.descs = undefined; + this.lineQuery.ascs = undefined; + let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs'; + this.lineQuery[orderByFieldKey] = !prop + ? undefined + : prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); + } + // 重新加载数据 + this.refreshChange(); + }, + // 刷新 + refreshChange() { + if (this.tabPosition === 'recorder') { + this.getRecorder(); + } else if (this.tabPosition === 'recorderLineSetting') { + this.getRecorderLine(); + } + }, setEchart(data) { if (data.xData.length == 0 || data.yArray.length == 0) { return this.$message.warning('暂无数据'); diff --git a/src/views/recorderList/js/recorderColumnData.js b/src/views/recorderList/js/recorderColumnData.js index 6ba1919a..f7fdc56d 100644 --- a/src/views/recorderList/js/recorderColumnData.js +++ b/src/views/recorderList/js/recorderColumnData.js @@ -10,6 +10,7 @@ export default { overflow: true, search: true, hide:true, + sortable: 'custom', rules: [ { required: true, @@ -25,6 +26,7 @@ export default { labelWidth: 140, overflow: true, search: false, + sortable: 'custom', rules: [ { required: true, @@ -40,6 +42,7 @@ export default { labelWidth: 140, overflow: true, search: false, + sortable: 'custom', }, ], 'recorderLineSetting':[ @@ -50,6 +53,7 @@ export default { labelWidth: 140, overflow: true, search: true, + sortable: 'custom', rules: [ { required: true, @@ -65,6 +69,7 @@ export default { labelWidth: 140, overflow: true, search: true, + sortable: 'custom', rules: [ { required: true, @@ -80,6 +85,7 @@ export default { labelWidth: 140, overflow: true, search: true, + sortable: 'custom', rules: [ { required: true, @@ -96,6 +102,7 @@ export default { labelWidth: 140, overflow: true, search: true, + sortable: 'custom', rules: [ { required: true, @@ -115,6 +122,7 @@ export default { labelWidth: 140, overflow: true, search: true, + sortable: 'custom', rules: [ { required: true,