From 98bb1f00eeca2b459bd8b9fe5a745e65c6081f97 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 19 十月 2022 19:06:14 +0800
Subject: [PATCH] fix 修复 修改用户信息 校验用户名未排除当前用户问题
---
ruoyi-ui/src/views/demo/tree/index.vue | 44 ++++++++++++++++++++++++++++++++------------
1 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/ruoyi-ui/src/views/demo/tree/index.vue b/ruoyi-ui/src/views/demo/tree/index.vue
index ea54195..6cfa7f2 100644
--- a/ruoyi-ui/src/views/demo/tree/index.vue
+++ b/ruoyi-ui/src/views/demo/tree/index.vue
@@ -39,14 +39,24 @@
v-hasPermi="['demo:tree: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="treeList"
row-key="id"
- default-expand-all
+ :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="鐖秈d" prop="parentId" />
@@ -54,12 +64,12 @@
<el-table-column label="鐢ㄦ埛id" align="center" prop="userId" />
<el-table-column label="鏍戣妭鐐瑰悕" align="center" prop="treeName" />
<el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
- <template slot-scope="scope">
+ <template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
+ <template #default="scope">
<el-button
size="mini"
type="text"
@@ -135,6 +145,10 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
+ // 鏄惁灞曞紑锛岄粯璁ゅ叏閮ㄥ睍寮�
+ isExpandAll: true,
+ // 閲嶆柊娓叉煋琛ㄦ牸鐘舵��
+ refreshTable: true,
// 鍒涘缓鏃堕棿鏃堕棿鑼冨洿
daterangeCreateTime: [],
// 鏌ヨ鍙傛暟
@@ -233,6 +247,14 @@
this.open = true;
this.title = "娣诲姞娴嬭瘯鏍戣〃";
},
+ /** 灞曞紑/鎶樺彔鎿嶄綔 */
+ toggleExpandAll() {
+ this.refreshTable = false;
+ this.isExpandAll = !this.isExpandAll;
+ this.$nextTick(() => {
+ this.refreshTable = true;
+ });
+ },
/** 淇敼鎸夐挳鎿嶄綔 */
handleUpdate(row) {
this.loading = true;
@@ -255,7 +277,7 @@
this.buttonLoading = true;
if (this.form.id != null) {
updateTree(this.form).then(response => {
- this.msgSuccess("淇敼鎴愬姛");
+ this.$modal.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
}).finally(() => {
@@ -263,7 +285,7 @@
});
} else {
addTree(this.form).then(response => {
- this.msgSuccess("鏂板鎴愬姛");
+ this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
}).finally(() => {
@@ -275,18 +297,16 @@
},
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
- this.$confirm('鏄惁纭鍒犻櫎娴嬭瘯鏍戣〃缂栧彿涓�"' + row.id + '"鐨勬暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(() => {
+ this.$modal.confirm('鏄惁纭鍒犻櫎娴嬭瘯鏍戣〃缂栧彿涓�"' + row.id + '"鐨勬暟鎹」锛�').then(() => {
this.loading = true;
return delTree(row.id);
}).then(() => {
this.loading = false;
this.getList();
- this.msgSuccess("鍒犻櫎鎴愬姛");
- })
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).finally(() => {
+ this.loading = false;
+ });
}
}
};
--
Gitblit v1.9.3