From 457f9c817adef8b003ee6379f493798bae5cbb69 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期一, 19 五月 2025 09:31:19 +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