|
|
@@ -37,14 +37,24 @@
|
|
37
|
37
|
v-hasPermi="['system:dept:add']"
|
|
38
|
38
|
>新增</el-button>
|
|
39
|
39
|
</el-col>
|
|
|
40
|
+ <el-col :span="1.5">
|
|
|
41
|
+ <el-button
|
|
|
42
|
+ type="info"
|
|
|
43
|
+ plain
|
|
|
44
|
+ icon="el-icon-sort"
|
|
|
45
|
+ size="mini"
|
|
|
46
|
+ @click="toggleExpandAll"
|
|
|
47
|
+ >展开/折叠</el-button>
|
|
|
48
|
+ </el-col>
|
|
40
|
49
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
41
|
50
|
</el-row>
|
|
42
|
51
|
|
|
43
|
52
|
<el-table
|
|
|
53
|
+ v-if="refreshTable"
|
|
44
|
54
|
v-loading="loading"
|
|
45
|
55
|
:data="deptList"
|
|
46
|
56
|
row-key="deptId"
|
|
47
|
|
- default-expand-all
|
|
|
57
|
+ :default-expand-all="isExpandAll"
|
|
48
|
58
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
49
|
59
|
>
|
|
50
|
60
|
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
|
|
@@ -164,6 +174,12 @@ export default {
|
|
164
|
174
|
title: "",
|
|
165
|
175
|
// 是否显示弹出层
|
|
166
|
176
|
open: false,
|
|
|
177
|
+ // 是否展开,默认全部展开
|
|
|
178
|
+ isExpandAll: true,
|
|
|
179
|
+ // 重新渲染表格状态
|
|
|
180
|
+ refreshTable: true,
|
|
|
181
|
+ // 是否展开
|
|
|
182
|
+ expand: false,
|
|
167
|
183
|
// 状态数据字典
|
|
168
|
184
|
statusOptions: [],
|
|
169
|
185
|
// 查询参数
|
|
|
@@ -267,6 +283,14 @@ export default {
|
|
267
|
283
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
268
|
284
|
});
|
|
269
|
285
|
},
|
|
|
286
|
+ /** 展开/折叠操作 */
|
|
|
287
|
+ toggleExpandAll() {
|
|
|
288
|
+ this.refreshTable = false;
|
|
|
289
|
+ this.isExpandAll = !this.isExpandAll;
|
|
|
290
|
+ this.$nextTick(() => {
|
|
|
291
|
+ this.refreshTable = true;
|
|
|
292
|
+ });
|
|
|
293
|
+ },
|
|
270
|
294
|
/** 修改按钮操作 */
|
|
271
|
295
|
handleUpdate(row) {
|
|
272
|
296
|
this.reset();
|
|
|
@@ -314,4 +338,4 @@ export default {
|
|
314
|
338
|
}
|
|
315
|
339
|
}
|
|
316
|
340
|
};
|
|
317
|
|
-</script>
|
|
|
341
|
+</script>
|