From 856f0767b4ada087e9e2cb33f373e23dbcf39b85 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期二, 07 三月 2023 17:56:59 +0800
Subject: [PATCH] update 同步 ruoyi * update element-ui 2.15.10 => 2.15.12 * update 优化 tagsView右选框,首页不应该存在关闭左侧选项 * update copyright 2023 * update 优化 监控页面图标显示 * update 优化 日志注解支持排除指定的请求参数 * update 优化 业务校验优化代码 * fix 修复 优化文件下载出现的异常 * fix 修复 修改密码日志存储明文问题 * add 新增 操作日志消耗时间属性 * update 优化 日志管理使用索引提升查询性能 * update 优化 框架时间检索使用时间默认值 00:00:00 - 23:59:59

---
 ruoyi-ui/src/views/demo/tree/index.vue |   49 +++++++++++++++++++++++++++++++++++--------------
 1 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/ruoyi-ui/src/views/demo/tree/index.vue b/ruoyi-ui/src/views/demo/tree/index.vue
index 57b152f..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,7 +278,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 +286,7 @@
             });
           } else {
             addTree(this.form).then(response => {
-              this.msgSuccess("鏂板鎴愬姛");
+              this.$modal.msgSuccess("鏂板鎴愬姛");
               this.open = false;
               this.getList();
             }).finally(() => {
@@ -275,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