From a7c90f4a5ed7619a6682f22665338acfed22564e Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期四, 14 十二月 2023 18:07:52 +0800
Subject: [PATCH] qxtj

---
 src/views/system/user/index.vue |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 3f2accd..90ddfc1 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -9,7 +9,7 @@
         </div>
         <div class="head-container">
           <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
-            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
+            :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all  :default-expanded-keys="treeId" highlight-current
             @node-click="handleNodeClick" />
         </div>
       </el-col>
@@ -739,6 +739,7 @@
       userInfoList: [],
       hospList: [],
       activeNames: ["1"],
+      treeId: [],
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -893,6 +894,15 @@
     deptName(val) {
       this.$refs.tree.filter(val);
     },
+    treeId(newVal, oldVal) {
+      if (newVal) {
+        this.$nextTick(() => {
+          document
+            .querySelector('.el-tree-node__children .el-tree-node__content')
+            .click();
+        });
+      }
+    }
   },
   computed: {
     type() {
@@ -903,8 +913,9 @@
     }
   },
   created() {
-    this.getList();
     this.getDeptTree();
+    this.getList();
+   
     // this.getRoleList();
     // this.getConfigKey("sys.user.initPassword").then((response) => {
     //   this.initPassword = response.msg;
@@ -960,6 +971,8 @@
     getDeptTree() {
       deptTreeSelect().then((response) => {
         this.deptOptions = response.data;
+        this.treeId.push(this.deptOptions[0].id)
+        this.queryParams.deptId = this.deptOptions[0].id
       });
     },
     // 绛涢�夎妭鐐�

--
Gitblit v1.8.0