From 5350514e716d3383fa3923a007fecac5b1ea365a Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期一, 14 四月 2025 17:37:44 +0800
Subject: [PATCH] qx

---
 src/views/sampling/sampling/index.vue |    2 +-
 src/views/hosp/project/index.vue      |   57 ++++++++++++++++++++++++---------------------------------
 2 files changed, 25 insertions(+), 34 deletions(-)

diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue
index 2fbb1d4..219515f 100644
--- a/src/views/hosp/project/index.vue
+++ b/src/views/hosp/project/index.vue
@@ -14,19 +14,9 @@
         </div>
         <div class="scrollable-container">
           <div class="content">
-            <el-tree
-              :data="deptOptions"
-              :props="defaultProps"
-              :expand-on-click-node="false"
-              :filter-node-method="filterNode"
-              ref="tree1"
-              node-key="id"
-              :default-expanded-keys="treeId"
-              highlight-current
-              @node-click="handleNodeClick"
-              :render-content="renderContent"
-              v-loading="loadings"
-            />
+            <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" :render-content="renderContent" v-loading="loadings" />
           </div>
         </div>
       </el-col>
@@ -216,13 +206,7 @@
             width="90px"
           >
           </el-table-column>
-          <el-table-column
-            label="Lis椤圭洰鍚嶇О"
-            align="center"
-            prop="lisXmmc"
-            :show-overflow-tooltip="true"
-            width="200px"
-          >
+          <el-table-column label="Lis椤圭洰鍚嶇О" align="center" prop="lisXmmc" :show-overflow-tooltip="true" width="200px">
           </el-table-column>
           <el-table-column
             label="Lis缂栫爜"
@@ -1131,18 +1115,23 @@
   },
   methods: {
     debounceFilter: debounce(function (val) {
-      this.$refs.tree1.filter(val);
-    }, 300),
+      this.$refs.tree.filter(val);
+    }, 800),
     precomputePinyin() {
       const traverse = (nodes) => {
         nodes.forEach((node) => {
           if (node.label) {
-            const lowerSpell = node.label.spell("low", "array").join("");
-            const upperSpell = node.label.spell("up", "array").join("");
+            const lowerSpell = cnchar.spell(node.label, 'low', 'array').join(''); // 瀹屾暣灏忓啓鎷奸煶
+            const upperSpell = cnchar.spell(node.label, 'up', 'array').join('');  // 瀹屾暣澶у啓鎷奸煶
+            const shortPinyin = node.label
+              .split('')
+              .map(char => cnchar.spell(char, 'array')[0]?.[0]?.toLowerCase() || char) // 鎷奸煶棣栧瓧姣�
+              .join('');
             this.pinyinCache.set(node.id, {
               lowerSpell,
               upperSpell,
-              label: node.label,
+              shortPinyin, // 缂撳瓨鎷奸煶绠�鍐�
+              label: node.label
             });
           }
           if (node.children) traverse(node.children);
@@ -1153,11 +1142,12 @@
     filterNode(value, data) {
       if (!value) return true;
       const cached = this.pinyinCache.get(data.id);
-      if (!cached) return false;
+      if (!cached) return false; // 濡傛灉娌℃湁缂撳瓨鏁版嵁锛屼笉鏄剧ず璇ヨ妭鐐�
+      const searchLower = value.toLowerCase(); // 灏嗘悳绱㈣瘝杞负灏忓啓
       return (
-        cached.label.includes(value) ||
-        cached.lowerSpell.includes(value) ||
-        cached.upperSpell.includes(value)
+        cached.label.includes(value) ||           // 鐩存帴鍖归厤姹夊瓧
+        cached.shortPinyin.includes(searchLower) || // 鍖归厤鎷奸煶绠�鍐�
+        cached.lowerSpell.includes(searchLower)   // 鍖归厤瀹屾暣鎷奸煶
       );
     },
     filterNode2(value, data) {
@@ -1275,8 +1265,8 @@
             this.open = true;
           } else if (this.treeDate.id) {
             if (this.treeDate.qf == "0") {
-              this.form.proParentId = "0";
-              this.form.deptId = this.treeDate.id;
+              this.form.proParentId = "0"
+              this.form.deptId = this.treeDate.id
             } else {
               this.form.proParentId = this.treeDate.id;
               this.projectOptions.forEach((item) => {
@@ -1288,9 +1278,10 @@
               });
             }
 
+
             this.open = true;
           } else {
-            this.form.proParentId = "0";
+            this.form.proParentId = "0"
             this.open = true;
           }
         }
@@ -1750,7 +1741,7 @@
           this.getList();
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     handleExport() {
       this.download(
diff --git a/src/views/sampling/sampling/index.vue b/src/views/sampling/sampling/index.vue
index 7d97733..8157f73 100644
--- a/src/views/sampling/sampling/index.vue
+++ b/src/views/sampling/sampling/index.vue
@@ -250,7 +250,7 @@
       piliangList: [],
       msg: "",
       getNumbr: null,
-      valueUrl: "ws://127.0.0.1/websocket",
+      valueUrl: "ws://127.0.0.1:6789/websocket",
       webSocket: null,
       list: [],
       selectList: [],

--
Gitblit v1.8.0