From d2b61762b7c7815e343ad0d6c2673a6919f5e076 Mon Sep 17 00:00:00 2001 From: 稚屿 <1491182878@qq.com> Date: 星期三, 08 九月 2021 11:18:35 +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