fix: correct updateClusterAfterMerge to trigger computed update

Problem:
- Previous commit tried to splice computed property (clusterAsPending)
- Computed properties cannot be modified directly
- Need to update underlying data (clusterResultsCache)

Solution:
- Remove incorrect clusterAsPending.value.splice()
- Trigger reactive update via clusterResultsCache reassignment
- clusterAsPending computed will auto-update

Technical details:
- Vue computed properties are read-only
- Must modify underlying reactive data
- Reassignment triggers computed recalculation
This commit is contained in:
2026-07-25 13:25:41 +08:00
parent c235d11d03
commit 7b5650d098

View File

@@ -1611,14 +1611,11 @@ function updateClusterAfterMerge(sourceGroupId: string, targetGroupId: string) {
const idx = clusters.findIndex((c: any) => c.identity_uuid === sourceGroupId)
if (idx >= 0) {
clusters.splice(idx, 1) // Remove empty source group
clusters.splice(idx, 1) // Remove empty source group from cache
}
}
// Also remove from clusterAsPending computed
const idx2 = clusterAsPending.value.findIndex((c: any) => c.identity_uuid === sourceGroupId)
if (idx2 >= 0) {
clusterAsPending.value.splice(idx2, 1)
// Trigger computed property update
clusterResultsCache.value = { ...clusterResultsCache.value }
}
}