【功能优化】条件分支、包容分支后面不允许直接添加并行分支

This commit is contained in:
jason 2024-11-01 23:04:00 +08:00
parent 812e5b5865
commit e504be7d42
7 changed files with 23 additions and 18 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="node-handler-wrapper">
<div class="node-handler" v-if="props.showAdd">
<div class="node-handler">
<el-popover
trigger="hover"
v-model:visible="popoverShow"
@ -27,7 +27,14 @@
</div>
<div class="handler-item-text">条件分支</div>
</div>
<div class="handler-item" @click="addNode(NodeType.PARALLEL_BRANCH_NODE)">
<div
class="handler-item"
@click="addNode(NodeType.PARALLEL_BRANCH_NODE)"
v-if="
NodeType.CONDITION_BRANCH_NODE !== currentNode?.type &&
NodeType.INCLUSIVE_BRANCH_NODE !== currentNode?.type
"
>
<div class="handler-item-icon parallel">
<span class="iconfont icon-size icon-parallel"></span>
</div>
@ -70,13 +77,11 @@ const props = defineProps({
type: Object as () => SimpleFlowNode,
default: null
},
showAdd: {
//
type: Boolean,
default: true
currentNode: {
type: Object as () => SimpleFlowNode,
required: true
}
})
const emits = defineEmits(['update:childNode'])
const readonly = inject<Boolean>('readonly') //
@ -131,7 +136,6 @@ const addNode = (type: number) => {
childNode: undefined,
conditionType: 1,
defaultFlow: false
},
{
id: 'Flow_' + generateUUID(),
@ -183,7 +187,8 @@ const addNode = (type: number) => {
name: '包容条件1',
showText: '',
type: NodeType.CONDITION_NODE,
childNode: undefined
childNode: undefined,
defaultFlow: false
},
{
id: 'Flow_' + generateUUID(),

View File

@ -37,7 +37,7 @@
</div>
<!-- 传递子节点给添加节点组件会在子节点前面添加节点 -->
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" />
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" :current-node="currentNode"/>
</div>
<CopyTaskNodeConfig
v-if="!readonly && currentNode"

View File

@ -74,7 +74,7 @@
<Icon icon="ep:arrow-right" />
</div>
</div>
<NodeHandler v-model:child-node="item.childNode" />
<NodeHandler v-model:child-node="item.childNode" :current-node="item" />
</div>
</div>
<ConditionNodeConfig :node-index="index" :condition-node="item" :ref="item.id" />
@ -87,7 +87,7 @@
/>
</div>
</div>
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" />
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" :current-node="currentNode" />
</div>
</template>

View File

@ -67,7 +67,7 @@
<Icon icon="ep:arrow-right" />
</div>
</div>
<NodeHandler v-model:child-node="item.childNode" />
<NodeHandler v-model:child-node="item.childNode" :current-node="item"/>
</div>
</div>
<ConditionNodeConfig :node-index="index" :condition-node="item" :ref="item.id" />
@ -80,7 +80,7 @@
/>
</div>
</div>
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" />
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" :current-node="currentNode"/>
</div>
</template>

View File

@ -53,7 +53,7 @@
</div>
</div>
</div>
<NodeHandler v-model:child-node="item.childNode" />
<NodeHandler v-model:child-node="item.childNode" :current-node="item"/>
</div>
</div>
<!-- 递归显示子节点 -->
@ -65,7 +65,7 @@
/>
</div>
</div>
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" />
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" :current-node="currentNode" />
</div>
</template>

View File

@ -33,7 +33,7 @@
</div>
</div>
<!-- 传递子节点给添加节点组件会在子节点前面添加节点 -->
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" />
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" :current-node="currentNode" />
</div>
</div>
<StartUserNodeConfig v-if="!readonly && currentNode" ref="nodeSetting" :flow-node="currentNode" />

View File

@ -36,7 +36,7 @@
</div>
</div>
<!-- 传递子节点给添加节点组件会在子节点前面添加节点 -->
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" />
<NodeHandler v-if="currentNode" v-model:child-node="currentNode.childNode" :current-node="currentNode" />
</div>
</div>
<UserTaskNodeConfig