From 41710058c166ba40e6cc8b7e3d1f2f18925ef937 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期三, 25 六月 2025 11:13:24 +0800
Subject: [PATCH] 1

---
 src/views/system/user/index.vue |   59 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 4a60aca..d966abc 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -13,7 +13,7 @@
             style="margin-bottom: 15px"
           />
         </div>
-        <div class="head-container">
+        <!-- <div class="head-container">
           <el-tree
             :data="deptOptions"
             :props="defaultProps"
@@ -26,6 +26,21 @@
             highlight-current
             @node-click="handleNodeClick"
           />
+        </div> -->
+        <div class="scrollable-container">
+          <div class="content">
+            <el-tree
+              :data="deptOptions"
+              :props="defaultProps"
+              :expand-on-click-node="false"
+              :filter-node-method="filterNode"
+              ref="tree"
+              node-key="id"
+              :default-expanded-keys="treeId"
+              highlight-current
+              @node-click="handleNodeClick"
+            />
+          </div>
         </div>
       </el-col>
 
@@ -359,7 +374,7 @@
                   icon="el-icon-d-arrow-right"
                   title="鏇村"
                 ></el-button>
-                <el-dropdown-menu slot="dropdown">
+                <el-dropdown-menu slot="dropdown" :append-to-body="true">
                   <el-dropdown-item
                     command="handleResetPwd"
                     icon="el-icon-key"
@@ -372,15 +387,6 @@
                     v-hasPermi="['system:user:edit']"
                     >鍒嗛厤瑙掕壊</el-dropdown-item
                   >
-                  <!-- 娣诲姞鐢ㄦ埛璇︽儏鎸夐挳 鐐瑰嚮璺冲嚭璇ョ敤鎴风殑璇︾粏淇℃伅椤甸潰 -->
-                  <!-- <el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-share"
-                    @click="handleSearch(scope.row)"
-                    v-hasPermi="['hosp:Userinfo:list']"
-                    >璇︾粏淇℃伅</el-button
-                  > -->
                 </el-dropdown-menu>
               </el-dropdown>
             </template>
@@ -531,7 +537,7 @@
 
           <el-form-item label="鎵�鍦ㄥ尰闄�" prop="hospId">
             <el-select
-            v-if="hospList.length > 0" 
+              v-if="hospList.length > 0"
               v-model="form.hospId"
               placeholder="璇烽�夋嫨鎵�鍦ㄥ尰闄�"
               clearable
@@ -552,7 +558,7 @@
             <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="璇烽�夋嫨褰掑睘绉戝"
               style="width: 200px" /> -->
             <el-select
-            v-if="DepartmentList.length > 0" 
+              v-if="DepartmentList.length > 0"
               v-model="form.deptId"
               placeholder="璇烽�夋嫨褰掑睘绉戝"
               clearable
@@ -1451,6 +1457,7 @@
       hospList: [],
       activeNames: ["1"],
       treeId: [],
+      selectedDeptId: null,
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -1635,7 +1642,7 @@
     //   this.initPassword = response.msg;
     // });
   },
- 
+
   methods: {
     handleChange(val) {},
     /** 鏌ヨ鐢ㄦ埛鍒楄〃 */
@@ -1704,6 +1711,7 @@
     // 鑺傜偣鍗曞嚮浜嬩欢
     handleNodeClick(data) {
       this.queryParams.deptId = data.id;
+      this.selectedDeptId = data.id;
       this.handleQuery();
     },
     handlePackage() {
@@ -1738,10 +1746,11 @@
     cancel() {
       this.open = false;
       this.reset();
-      this.$tab.refreshPage();
+      // this.$tab.refreshPage();
     },
     handleClose() {
-      this.$tab.refreshPage();
+      this.cancel();
+      // this.$tab.refreshPage();
     },
     // 琛ㄥ崟閲嶇疆
     reset() {
@@ -1793,7 +1802,7 @@
 
     // 鏇村鎿嶄綔瑙﹀彂
     handleCommand(command, row) {
-      console.log('Command triggered:', command);
+      console.log("Command triggered:", command);
 
       switch (command) {
         case "handleResetPwd":
@@ -1819,6 +1828,9 @@
           this.sendhospName();
         }
       });
+      if (this.selectedDeptId) {
+        this.form.deptId = this.selectedDeptId;
+      }
       // getUser().then((response) => {
       //   this.postOptions = response.posts;
       //   this.roleOptions = response.roles;
@@ -1834,7 +1846,7 @@
       getDeptListByDictHospId(data).then((res) => {
         console.log(res, 123456);
         this.DepartmentList = res.data;
-        this.form.deptId = String(this.form.deptId);
+        // this.form.deptId = String(this.form.deptId);
       });
     },
 
@@ -2019,6 +2031,17 @@
   line-height: 36px;
   width: 200px;
 }
+.scrollable-container {
+  width: 200px; /* 璁剧疆瀹瑰櫒鐨勫搴� */
+  height: 629px; /* 璁剧疆瀹瑰櫒鐨勯珮搴� */
+  overflow: auto; /* 鍏佽鍐呭婧㈠嚭鏃舵樉绀烘粴鍔ㄦ潯 */
+  border: 1px solid #ccc; /* 鍙�夛細娣诲姞杈规浠ユ洿濂藉湴鏄剧ず瀹瑰櫒 */
+  position: relative; /* 鍙�夛細浣垮鍣ㄥ唴鐨勭粷瀵瑰畾浣嶅厓绱犺兘澶熸纭樉绀� */
+}
+.content {
+  width: 600px; /* 璁剧疆鍐呭鐨勫搴︼紝浠ヨЕ鍙戞按骞虫粴鍔ㄦ潯 */
+  height: 1000px; /* 璁剧疆鍐呭鐨勯珮搴︼紝浠ヨЕ鍙戝瀭鐩存粴鍔ㄦ潯 */
+}
 
 .pag {
   width: 100%;

--
Gitblit v1.8.0