From f8c87707377b5a35d30ac3b740723437909d7b4e Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 24 三月 2023 11:08:04 +0800
Subject: [PATCH] update springboot 3.0.4 => 3.0.5 修复 DoS 漏洞 update mapstruct-plus 1.1.8 => 1.1.9
---
ruoyi-ui/src/views/demo/tree/index.vue | 55 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/ruoyi-ui/src/views/demo/tree/index.vue b/ruoyi-ui/src/views/demo/tree/index.vue
index afe96c4..d66c6f9 100644
--- a/ruoyi-ui/src/views/demo/tree/index.vue
+++ b/ruoyi-ui/src/views/demo/tree/index.vue
@@ -15,11 +15,12 @@
v-model="daterangeCreateTime"
size="small"
style="width: 240px"
- value-format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="寮�濮嬫棩鏈�"
end-placeholder="缁撴潫鏃ユ湡"
+ :default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item>
@@ -39,14 +40,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 +65,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"
@@ -110,7 +121,7 @@
</template>
<script>
-import { listTree, getTree, delTree, addTree, updateTree, exportTree } from "@/api/demo/tree";
+import { listTree, getTree, delTree, addTree, updateTree } from "@/api/demo/tree";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -135,6 +146,10 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
+ // 鏄惁灞曞紑锛岄粯璁ゅ叏閮ㄥ睍寮�
+ isExpandAll: true,
+ // 閲嶆柊娓叉煋琛ㄦ牸鐘舵��
+ refreshTable: true,
// 鍒涘缓鏃堕棿鏃堕棿鑼冨洿
daterangeCreateTime: [],
// 鏌ヨ鍙傛暟
@@ -233,6 +248,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,17 +278,19 @@
this.buttonLoading = true;
if (this.form.id != null) {
updateTree(this.form).then(response => {
- this.buttonLoading = false;
- this.msgSuccess("淇敼鎴愬姛");
+ this.$modal.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
} else {
addTree(this.form).then(response => {
- this.buttonLoading = false;
- this.msgSuccess("鏂板鎴愬姛");
+ this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
+ }).finally(() => {
+ this.buttonLoading = false;
});
}
}
@@ -273,18 +298,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