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 @@
- +
整体完成百分比:{{ formatPercentValue(overallPercent, 2) }}
进度百分比 - - - - - + + + + +
@@ -205,7 +205,7 @@