From 29a44642f965192a85dafbdf68fd67abbe08a7cf Mon Sep 17 00:00:00 2001 From: cjh <949661474@qq.com> Date: Wed, 24 Jun 2026 15:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E7=99=BE=E5=88=86=E6=AF=94=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/progress/binding.vue | 15 +- src/pages/progress/index.vue | 284 +++++++++++++++++++++++++++++---- src/service/api/api.js | 28 +++- src/service/api/progress.js | 12 +- 4 files changed, 289 insertions(+), 50 deletions(-) diff --git a/src/pages/progress/binding.vue b/src/pages/progress/binding.vue index 8dc38d1..4781530 100644 --- a/src/pages/progress/binding.vue +++ b/src/pages/progress/binding.vue @@ -188,6 +188,7 @@ function toggleRowSelection(row) { const allSelected = row.ids.every((id) => selectedCodes.has(String(id))); if (allSelected) { selectedComponents.value = selectedComponents.value.filter((item) => !row.ids.includes(String(item.code))); + syncSelectedComponentsToModel(); return; } const next = [...selectedComponents.value]; @@ -196,15 +197,10 @@ function toggleRowSelection(row) { next.push({ code: String(id), data: { url: row.url, id: String(id) } }); }); selectedComponents.value = next; - highlightRow(row); + syncSelectedComponentsToModel(); } -function highlightRow(row) { - const ids = row.ids.map((id) => Number(id)).filter((id) => Number.isFinite(id)); - if (row.url && ids.length) modelRef.value?.highlightModels?.([{ url: row.url, ids }]); -} - -function highlightBoundComponents() { +function syncSelectedComponentsToModel() { const grouped = new Map(); selectedComponents.value.forEach((item) => { const url = String(item?.data?.url || "").trim(); @@ -214,9 +210,14 @@ function highlightBoundComponents() { grouped.get(url).push(id); }); const refs = Array.from(grouped.entries()).map(([url, ids]) => ({ url, ids })); + modelRef.value?.cancelLightModels?.(); if (refs.length) modelRef.value?.highlightModels?.(refs); } +function highlightBoundComponents() { + syncSelectedComponentsToModel(); +} + async function confirm() { if (!selectedComponents.value.length && !isUnbind.value) { showToast("请先选择需要绑定的模型构件", "error"); diff --git a/src/pages/progress/index.vue b/src/pages/progress/index.vue index e7e12be..93ef04d 100644 --- a/src/pages/progress/index.vue +++ b/src/pages/progress/index.vue @@ -12,17 +12,17 @@