From aeaf5640ea95d6ac4f4e2c98c5b15b4145f17fbd Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期四, 28 九月 2023 11:43:40 +0800
Subject: [PATCH] feat: 合同管理页列表配置列显隐控制
---
src/views/sales/contractManage/index.vue | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/views/sales/contractManage/index.vue b/src/views/sales/contractManage/index.vue
index 964874b..3be819d 100644
--- a/src/views/sales/contractManage/index.vue
+++ b/src/views/sales/contractManage/index.vue
@@ -26,6 +26,7 @@
:table-list="tableList"
@selCommonClick="selCommonClick"
@getSelectArray="getSelectArray"
+ @selTableCol="selTableCol"
>
<template slot="tableButton">
<el-table-column label="鎿嶄綔" width="100">
@@ -104,7 +105,15 @@
searchSel: {
value: "number",
label: "鍗曟嵁缂栧彿"
- }
+ },
+ tableColumn: [
+ { label: "鍗曟嵁缂栧彿", prop: "number", min: 120, isCommonClick: true, default: true },
+ { label: "璐熻矗浜�", prop: "member_name", min: 90 },
+ { label: "瀹㈡埛鍚嶇О", prop: "client_name" },
+ { label: "鍚堝悓鐘舵��", prop: "serviceContractStatus_name", min: 100 },
+ { label: "鍒涘缓鏃堕棿", prop: "created_at" }
+ ],
+ showCol:["鍗曟嵁缂栧彿", "璐熻矗浜�", "瀹㈡埛鍚嶇О", "鍚堝悓鐘舵��", "鍒涘缓鏃堕棿"]
}
},
created() {
@@ -122,14 +131,11 @@
setTable() {
this.tableList = {
tableInfomation: [],
- tableColumn: [
- { label: "鍗曟嵁缂栧彿", prop: "number", min: 120, isCommonClick: true },
- { label: "璐熻矗浜�", prop: "member_name", min: 90 },
- { label: "瀹㈡埛鍚嶇О", prop: "client_name" },
- { label: "鍚堝悓鐘舵��", prop: "serviceContractStatus_name", min: 100 },
- { label: "鍒涘缓鏃堕棿", prop: "created_at" }
- ]
+ allcol: [],
+ showcol: this.showCol,
+ tableColumn:this.setColumnVisible(this.showCol)
}
+ this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
this.searchOptions = []
for (let i = 0; i < this.tableList.tableColumn.length; i++) {
const label = this.tableList.tableColumn[i].label
@@ -137,6 +143,18 @@
this.searchOptions.push({ value: value, label: label })
}
},
+ setColumnVisible(showCol){
+ return this.tableColumn.map(ele=>{
+ return {
+ ...ele,
+ isShowColumn:showCol.includes(ele.label)
+ }
+ })
+ },
+ selTableCol(val) {
+ this.showcol = val;
+ this.tableList.tableColumn = this.setColumnVisible(val);
+ },
// 璇锋眰鏁版嵁
async getData() {
this.loading = true
--
Gitblit v1.8.0