feat: add configurable DSL rule manager and simplify dynamic-group settings

This commit is contained in:
2026-02-27 22:13:04 +08:00
parent f5ae91df43
commit 271b722c97
13 changed files with 1674 additions and 158 deletions

View File

@@ -123,6 +123,7 @@ import { normalizePropertiesWithStyle, normalizeNodeStyle, styleEquals } from '@
import { useCanvasSettings } from '@/ts/useCanvasSettings';
import { validateGraphGroupRules, type GroupRuleWarning } from '@/utils/groupRules';
import { subscribeSharedGroupRulesConfig } from '@/utils/groupRulesConfigSource';
import { getProblemTargetCandidateIds } from '@/utils/problemTarget';
type AlignType = 'left' | 'right' | 'top' | 'bottom' | 'hcenter' | 'vcenter';
type DistributeType = 'horizontal' | 'vertical';
@@ -732,7 +733,7 @@ function locateProblemNode(warning: GroupRuleWarning) {
const lfInstance = lf.value as any;
if (!lfInstance) return;
const candidateIds = [...(warning.nodeIds || []), warning.groupId].filter((id) => !!id);
const candidateIds = getProblemTargetCandidateIds(warning);
const targetId = candidateIds.find((id) => !!lfInstance.getNodeModelById(id));
if (!targetId) {
showMessage('warning', '未找到告警对应节点,可能已被删除');