From b03a1b9b046f8b3cabe22e629bbda40413c28be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=84=E9=94=90=E6=B3=A2?= <10549902+zhuangruibo@user.noreply.gitee.com> Date: Sun, 10 May 2026 17:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E5=8D=95=E4=BD=8D=E9=87=8D?= =?UTF-8?q?=E7=BB=84=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/efcode/virtualUnit/unitBuilder.vue | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/virtualUnit/unitBuilder.vue b/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/virtualUnit/unitBuilder.vue index 6155470a..67aa92cd 100644 --- a/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/virtualUnit/unitBuilder.vue +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/virtualUnit/unitBuilder.vue @@ -191,14 +191,28 @@ const settingForm = ref<{ virIncludeStatistics: string; virIncludeSearch: string; virShowAtBusiness: string; + virZone: number | null; virRemark: string; }>({ virIncludeStatistics: '是', virIncludeSearch: '是', virShowAtBusiness: '是', + virZone: null, virRemark: '' }); +const zoneOptions = [ + { value: 1, label: '市直' }, + { value: 2, label: '区' }, + { value: 3, label: '区直' }, + { value: 4, label: '街道' }, + { value: 5, label: '市公安' }, + { value: 6, label: '市消防' }, + { value: 15, label: '区公安' }, + { value: 16, label: '区消防' } +]; +const zoneMap = new Map(zoneOptions.map(o => [o.value, o.label])); + /** 点击 <-- 按钮打开设置窗口 */ const handleTransfer = () => { if (!selectedVirNode.value) { @@ -214,6 +228,7 @@ const handleTransfer = () => { virIncludeStatistics: '是', virIncludeSearch: '是', virShowAtBusiness: '是', + virZone: null, virRemark: '' }; settingDialogVisible.value = true; @@ -281,7 +296,17 @@ const handleConfirmAdd = async () => { await addVirtualUnit(form); ElMessage.success('添加成功'); settingDialogVisible.value = false; + // 记录当前父节点及其祖先,重新加载后保持展开 + const expandIds = parentNode.virAncestors + ? parentNode.virAncestors.split(',').concat(parentNode.virId) + : [parentNode.virId]; await loadVirtualUnitTree(); + // 确保父节点链路全部展开 + for (const id of expandIds) { + if (!defaultExpandedKeys.value.includes(id)) { + defaultExpandedKeys.value.push(id); + } + } } catch (e: any) { ElMessage.error(e.message || '添加失败'); } @@ -327,6 +352,7 @@ onMounted(() => { @@ -374,7 +400,7 @@ onMounted(() => { {{ row.virShowAtBusiness }} - +