From 15abd4d053400b28019b89fb6ba9e2065e7d29db Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 08 九月 2021 11:26:08 +0800
Subject: [PATCH] 优化提示
---
ruoyi-ui/src/views/system/dept/index.vue | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue
index edb8d7c..037c998 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']"
>鏂板</el-button>
</el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-sort"
+ size="mini"
+ @click="toggleExpandAll"
+ >灞曞紑/鎶樺彔</el-button>
+ </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
+ v-if="refreshTable"
v-loading="loading"
:data="deptList"
row-key="deptId"
- default-expand-all
+ :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" width="260"></el-table-column>
@@ -164,6 +174,12 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
+ // 鏄惁灞曞紑锛岄粯璁ゅ叏閮ㄥ睍寮�
+ isExpandAll: true,
+ // 閲嶆柊娓叉煋琛ㄦ牸鐘舵��
+ refreshTable: true,
+ // 鏄惁灞曞紑
+ expand: false,
// 鐘舵�佹暟鎹瓧鍏�
statusOptions: [],
// 鏌ヨ鍙傛暟
@@ -267,6 +283,14 @@
this.deptOptions = this.handleTree(response.data, "deptId");
});
},
+ /** 灞曞紑/鎶樺彔鎿嶄綔 */
+ toggleExpandAll() {
+ this.refreshTable = false;
+ this.isExpandAll = !this.isExpandAll;
+ this.$nextTick(() => {
+ this.refreshTable = true;
+ });
+ },
/** 淇敼鎸夐挳鎿嶄綔 */
handleUpdate(row) {
this.reset();
--
Gitblit v1.9.3