From 9ae5edaa7463bfa470dbbfbabdfbb4add5b0163f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 4 Sep 2021 12:10:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95&=E9=83=A8=E9=97=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B1=95=E5=BC=80/=E6=8A=98=E5=8F=A0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/system/dept/index.vue | 26 +++++++++++++++++++++++- ruoyi-ui/src/views/system/menu/index.vue | 23 +++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue index edb8d7cdc..037c99843 100644 --- a/ruoyi-ui/src/views/system/dept/index.vue +++ b/ruoyi-ui/src/views/system/dept/index.vue @@ -37,14 +37,24 @@ v-hasPermi="['system:dept:add']" >新增 + + 展开/折叠 + @@ -164,6 +174,12 @@ export default { title: "", // 是否显示弹出层 open: false, + // 是否展开,默认全部展开 + isExpandAll: true, + // 重新渲染表格状态 + refreshTable: true, + // 是否展开 + expand: false, // 状态数据字典 statusOptions: [], // 查询参数 @@ -267,6 +283,14 @@ export default { this.deptOptions = this.handleTree(response.data, "deptId"); }); }, + /** 展开/折叠操作 */ + toggleExpandAll() { + this.refreshTable = false; + this.isExpandAll = !this.isExpandAll; + this.$nextTick(() => { + this.refreshTable = true; + }); + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue index e59d1a6ca..f3aa64ae8 100644 --- a/ruoyi-ui/src/views/system/menu/index.vue +++ b/ruoyi-ui/src/views/system/menu/index.vue @@ -37,13 +37,24 @@ v-hasPermi="['system:menu:add']" >新增 + + 展开/折叠 + @@ -275,6 +286,10 @@ export default { title: "", // 是否显示弹出层 open: false, + // 是否展开,默认全部折叠 + isExpandAll: false, + // 重新渲染表格状态 + refreshTable: true, // 显示状态数据字典 visibleOptions: [], // 菜单状态数据字典 @@ -384,6 +399,14 @@ export default { this.open = true; this.title = "添加菜单"; }, + /** 展开/折叠操作 */ + toggleExpandAll() { + this.refreshTable = false; + this.isExpandAll = !this.isExpandAll; + this.$nextTick(() => { + this.refreshTable = true; + }); + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset();