diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index 614a536c..74b2bb79 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -53,14 +53,25 @@
2导出本页数据
3导出全部数据
- - + diff --git a/src/views/wpm_bx/mlogs.vue b/src/views/wpm_bx/mlogs.vue index 37206920..abedf219 100644 --- a/src/views/wpm_bx/mlogs.vue +++ b/src/views/wpm_bx/mlogs.vue @@ -57,6 +57,19 @@ label="已提交" @change="hiddenChange" /> + + +
+
+ {{ col.label }} +
+
+
+ 重置 +
+
@@ -91,7 +104,7 @@ > --> - + - + - + - + - + - + - + - + - + @@ -169,8 +183,9 @@ - + @@ -178,12 +193,14 @@ - + @@ -191,6 +208,7 @@ col.show); + }, + }, watch: { mgroupName: { handler: function (newval,odlval) { @@ -356,6 +419,12 @@ export default { that.route_code = this.$route.path.split("/")[2]; that.params.mgroup =that.mgroupId; that.apiObj = that.$API.wpm.mlog.list; + const saved = localStorage.getItem('mlogs_columnVisibility'); + if (saved) { + try { + Object.assign(that.columnVisibility, JSON.parse(saved)); + } catch (e) {} + } this.getDeptUsers(); }, methods: { @@ -549,6 +618,20 @@ export default { } this.$refs.table.queryData(this.query); }, + onColumnVisibilityChange(key, val) { + this.columnVisibility[key] = val; + localStorage.setItem('mlogs_columnVisibility', JSON.stringify(this.columnVisibility)); + }, + resetColumnVisibility() { + const defaults = { + batch: true, rodNumber: true, plateNumber: true, rawRodNumber: true, + equipment: true, deptGroup: true, heatPreservation: true, temperature: true, + pressure: true, scale: true, pressTime: true, handler: true, + remainTime: true, startTime: true, endTime: true, submitter: true, submitTime: true, + }; + this.columnVisibility = { ...defaults }; + localStorage.setItem('mlogs_columnVisibility', JSON.stringify(this.columnVisibility)); + }, //表格选择后回调事件 selectionChange(selection) { this.selection = selection; @@ -578,3 +661,9 @@ export default { +