| | |
| | | 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 = '新增' |