From 81e6577d11920a45284936f591bd8d076006a919 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期四, 01 八月 2024 13:09:57 +0800
Subject: [PATCH] 修改通讯录

---
 src/views/Admin/contactBook/structure.vue |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/views/Admin/contactBook/structure.vue b/src/views/Admin/contactBook/structure.vue
index 85b6e41..672e81b 100644
--- a/src/views/Admin/contactBook/structure.vue
+++ b/src/views/Admin/contactBook/structure.vue
@@ -125,12 +125,24 @@
       const t = this
       const res = await getStructure();
       if(res.data.code == 100){
-        t.tableData = res.data.data
+        t.tableData = t.filterBranches(res.data.data,['自治区直辖县级行政区划'])
       }else{
         t.$message.warning(res.data.msg);
       }
     },
 
+    filterBranches(branches, targetNames) {
+      return branches.filter(branch => {
+        if (targetNames.includes(branch.name)) {
+          return false; // 过滤掉当前分支
+        }
+        if (branch.children && branch.children.length > 0) {
+          branch.children = this.filterBranches(branch.children, targetNames);
+        }
+        return true; // 保留当前分支
+      });
+    },
+
     openAdd(type,row){
       if(type == 'add'){
         this.editTitle = '新增'

--
Gitblit v1.9.2