From 7874262b15ca8d2495012ed5f934332dbeeadf29 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期四, 28 九月 2023 09:42:57 +0800
Subject: [PATCH] feat: 客户管理页列表配置列显隐控制
---
src/views/client/client/index.vue | 40 +++++++++++++++++++++++++++++-----------
1 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/src/views/client/client/index.vue b/src/views/client/client/index.vue
index a1c4e19..357b5fc 100644
--- a/src/views/client/client/index.vue
+++ b/src/views/client/client/index.vue
@@ -44,6 +44,7 @@
@selClientClick="selClientClick"
@selContactsClick="selContactsClick"
@getSelectArray="getSelectArray"
+ @selTableCol="selTableCol"
>
<template slot="tableButton">
<el-table-column label="鎿嶄綔" width="150">
@@ -149,7 +150,18 @@
visible: false,
infomation: {}
},
- not_admin: 2
+ not_admin: 2,
+ tableColumn:[
+ { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100, isClientClick: true, default:true}, // 瀹㈡埛鍚嶇О
+ { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
+ { label: "閲嶈绾у埆", prop: "client_level" }, // 閲嶈绾у埆
+ { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", min: 90 }, // 涓嬫鍥炶鏃ユ湡
+ { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃
+ { label: "瀹㈡埛鐘舵��", prop: "client_status" }, // 瀹㈡埛鐘舵��
+ { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚�
+ { label: "鑱旂郴浜烘墜鏈哄彿鐮�", prop: "contact_phone" } // 鎵嬫満鍙风爜
+ ],
+ showCol:['瀹㈡埛鍚嶇О','閿�鍞礋璐d汉','閲嶈绾у埆','涓嬫鍥炶鏃ユ湡','璇︾粏鍦板潃','瀹㈡埛鐘舵��','鑱旂郴浜哄鍚�','鑱旂郴浜烘墜鏈哄彿鐮�']
}
},
created() {
@@ -163,17 +175,11 @@
setTable() {
this.tableList = {
tableInfomation: [],
- tableColumn: [
- { label: "瀹㈡埛鍚嶇О", prop: "name", min: 100, isClientClick: true }, // 瀹㈡埛鍚嶇О
- { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
- { label: "閲嶈绾у埆", prop: "client_level" }, // 閲嶈绾у埆
- { label: "涓嬫鍥炶鏃ユ湡", prop: "next_visit_time", min: 90 }, // 涓嬫鍥炶鏃ユ湡
- { label: "璇︾粏鍦板潃", prop: "detail_address", min: 200 }, // 璇︾粏鍦板潃
- { label: "瀹㈡埛鐘舵��", prop: "client_status" }, // 瀹㈡埛鐘舵��
- { label: "鑱旂郴浜哄鍚�", prop: "contact_name", isContactClick: true }, // 鑱旂郴浜哄鍚�
- { label: "鑱旂郴浜烘墜鏈哄彿鐮�", prop: "contact_phone" } // 鎵嬫満鍙风爜
- ]
+ 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
@@ -181,6 +187,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