From d71ee5dba10765e9991608d9d0ba2e136aa8abdf Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 1 Dec 2023 11:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E9=9A=90=E5=88=97=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=8D=E9=80=89=E6=A1=86=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/RightToolbar/index.vue | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/ruoyi-ui/src/components/RightToolbar/index.vue b/ruoyi-ui/src/components/RightToolbar/index.vue index 776fcee5..d3d42523 100644 --- a/ruoyi-ui/src/components/RightToolbar/index.vue +++ b/ruoyi-ui/src/components/RightToolbar/index.vue @@ -8,7 +8,17 @@ - + + + + + + + @@ -35,17 +45,26 @@ export default { }; }, props: { + /* 是否显示检索条件 */ showSearch: { type: Boolean, default: true, }, + /* 显隐列信息 */ columns: { type: Array, }, + /* 是否显示检索图标 */ search: { type: Boolean, default: true, }, + /* 显隐列类型(transfer穿梭框、checkbox复选框) */ + showColumnsType: { + type: String, + default: "checkbox", + }, + /* 右外边距 */ gutter: { type: Number, default: 10, @@ -61,10 +80,12 @@ export default { } }, created() { - // 显隐列初始默认隐藏列 - for (let item in this.columns) { - if (this.columns[item].visible === false) { - this.value.push(parseInt(item)); + if (this.showColumnsType == 'transfer') { + // 显隐列初始默认隐藏列 + for (let item in this.columns) { + if (this.columns[item].visible === false) { + this.value.push(parseInt(item)); + } } } }, @@ -88,6 +109,10 @@ export default { showColumn() { this.open = true; }, + // 勾选 + checkboxChange(event, label) { + this.columns.filter(item => item.label == label)[0].visible = event; + } }, };