diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue index 96cbcafc4a59863382e97300d2f841aff86f300a..4415f2eb91b8cb706b671c9f9b9b22cf587c6ae1 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(); @@ -314,4 +338,4 @@ export default { } } }; - \ No newline at end of file + diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue index 805596921c8ae776f2345182b44bbac9be330d0b..0d64c4655c0d83a9162196cb66f74d0bf5af969d 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();