fix: 移动端流转树修复断条箭头与分支层级塌陷

- 父节点与第一个主线子节点之间补 ↓ 连线箭头
- 新增 isBranchContext prop:进入分支后子子孙孙强制缩进,不再回主干道
This commit is contained in:
2026-09-01 14:25:17 +08:00
parent 6ff3ee06de
commit a3aa012d6c

View File

@ -21,6 +21,8 @@
<!-- 子任务主线继续主干道(左对齐 + 连线)分支(SPAWN 协助)缩进 -->
<view v-if="node.child_tasks && node.child_tasks.length">
<!-- 修复断条父节点与第一个主线子节点之间的连线箭头 -->
<view v-if="mainChildren.length" class="ft-flow-arrow"></view>
<!-- 主线子任务左边缘对齐形成笔直主干道之间用 连线 -->
<template v-for="(child, i) in mainChildren" :key="'mc-' + child.id">
<view v-if="i > 0" class="ft-flow-arrow"></view>
@ -32,12 +34,13 @@
@view-records="$emit('viewRecords', $event)"
/>
</template>
<!-- 分支子任务缩进 + 左边线 -->
<!-- 分支子任务缩进 + 左边线进入分支后子子孙孙都保持分支上下文 -->
<view v-if="branchChildren.length" class="ft-branch-children">
<FlowTree
v-for="child in branchChildren"
:key="child.id"
:node="child"
:is-branch-context="true"
:current-user="currentUser"
:current-user-id="currentUserId"
:current-username="currentUsername"
@ -58,6 +61,8 @@ export default {
currentUser: { type: Object, default: null },
currentUserId: { type: [String, Number], default: "" },
currentUsername: { type: String, default: "" },
// 分支上下文:一旦进入分支,其子子孙孙都强制缩进,不再回主干道
isBranchContext: { type: Boolean, default: false },
},
emits: ["viewRecords"],
computed: {
@ -67,13 +72,17 @@ export default {
|| this.node.task_type === "RECOVERY";
},
// 主线子任务TRANSFER/RECOVERY继续主干道左对齐
// 分支上下文拦截:一旦处于分支,所有子任务强制归入分支,主线返回空
mainChildren() {
if (this.isBranchContext) return [];
return (this.node.child_tasks || []).filter((c) =>
!c.parent_task_id || c.task_type === "TRANSFER" || c.task_type === "RECOVERY"
);
},
// 分支子任务:其余(SPAWN 协助等),缩进显示
// 分支上下文拦截:处于分支时,全部子任务都作为分支继续缩进
branchChildren() {
if (this.isBranchContext) return this.node.child_tasks || [];
return (this.node.child_tasks || []).filter((c) =>
c.parent_task_id && c.task_type !== "TRANSFER" && c.task_type !== "RECOVERY"
);