fix(strategy-map): 三处缺陷——D1 完备度/摘要路由先注册(修 /completeness/objectives 422)、D2 连线增删显式 flag_modified(修 DELETE 200 不落库)、D3 拖拽命中改 rect 判定(修窄屏知识面板遮挡导致拖拽失效)
ci/woodpecker/push/main Pipeline was successful

This commit is contained in:
wecom-fullstack
2026-10-20 20:35:28 +08:00
parent 86e24c6310
commit 790be2d6b1
3 changed files with 23 additions and 4 deletions
+13 -2
View File
@@ -994,10 +994,21 @@ function onTreeDragStart(payload: { dimKey: string; index: number; obj: any }) {
}
function onTreeDragOver(e: DragEvent) {
if (!treeDragSource.value) return
const el = document.elementFromPoint(e.clientX, e.clientY)?.closest('[data-node-key]') as HTMLElement | null
const key = el?.getAttribute('data-node-key') || null
// 命中判定改用节点 rect 包含判断:elementFromPoint 会被覆盖层(窄屏时的知识面板 .kp-panel、
// 连线 SVG 等)挡住 ⇒ 拖拽在窄屏下永远取不到目标节点。rect 判定与层级无关。
const key = hitTestNodeKey(e.clientX, e.clientY)
dragConnectTarget.value = key && key !== treeDragSource.value.key ? key : null
}
function hitTestNodeKey(x: number, y: number): string | null {
const nodes = document.querySelectorAll('[data-node-key]') as NodeListOf<HTMLElement>
for (const el of Array.from(nodes)) {
const r = el.getBoundingClientRect()
if (r.width > 0 && r.height > 0 && x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) {
return el.getAttribute('data-node-key')
}
}
return null
}
function onTreeDragLeave(e: DragEvent) {
const related = (e as any).relatedTarget as Node | null
const box = scrollWrapRef.value