|
@@ -15,10 +15,13 @@
|
|
|
<div class="node-container">
|
|
|
<div class="node-box" :class="{ 'node-config-error': !item.showText }">
|
|
|
<div class="branch-node-title-container">
|
|
|
- <div class="branch-title" v-if="showInputs[index]">
|
|
|
+ <div v-if="showInputs[index]">
|
|
|
<input
|
|
|
-type="text" class="input-max-width editable-title-input" @blur="blurEvent(index)"
|
|
|
- v-mountedFocus v-model="item.name" />
|
|
|
+ type="text"
|
|
|
+ class="input-max-width editable-title-input"
|
|
|
+ @blur="blurEvent(index)"
|
|
|
+ v-mountedFocus
|
|
|
+ v-model="item.name" />
|
|
|
</div>
|
|
|
<div v-else class="branch-title" @click="clickEvent(index)"> {{ item.name }} </div>
|
|
|
<div class="branch-priority"> 优先级{{ index + 1 }} </div>
|
|
@@ -33,7 +36,7 @@ type="text" class="input-max-width editable-title-input" @blur="blurEvent(index)
|
|
|
</div>
|
|
|
<div class="node-toolbar" v-if="index + 1 !== currentNode.conditionNodes?.length">
|
|
|
<div class="toolbar-icon">
|
|
|
- <Icon icon="ep:delete" :size="16" @click="deleteCondition(index)" />
|
|
|
+ <Icon color="#0089ff" icon="ep:circle-close-filled" :size="18" @click="deleteCondition(index)" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
@@ -52,7 +55,7 @@ type="text" class="input-max-width editable-title-input" @blur="blurEvent(index)
|
|
|
<NodeHandler v-model:child-node="item.childNode" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <ConditionNodeConfig :condition-node="item" :ref="item.id" />
|
|
|
+ <ConditionNodeConfig :node-index="index" :condition-node="item" :ref="item.id" />
|
|
|
<!-- 递归显示子节点 -->
|
|
|
<ProcessNodeTree v-if="item && item.childNode" v-model:flow-node="item.childNode" />
|
|
|
</div>
|
|
@@ -65,6 +68,7 @@ type="text" class="input-max-width editable-title-input" @blur="blurEvent(index)
|
|
|
import NodeHandler from '../NodeHandler.vue'
|
|
|
import ProcessNodeTree from '../ProcessNodeTree.vue'
|
|
|
import { SimpleFlowNode, NodeType, NODE_DEFAULT_TEXT } from '../consts'
|
|
|
+import { getDefaultConditionNodeName } from '../utils'
|
|
|
import { generateUUID } from '@/utils'
|
|
|
import ConditionNodeConfig from '../nodes-config/ConditionNodeConfig.vue'
|
|
|
const { proxy } = getCurrentInstance() as any
|
|
@@ -88,29 +92,24 @@ const currentNode = ref<SimpleFlowNode>(props.flowNode)
|
|
|
watch(() => props.flowNode, (newValue) => {
|
|
|
currentNode.value = newValue;
|
|
|
});
|
|
|
-// TODO 测试后续去掉
|
|
|
-// watch(() => conditionNodes, (newValue) => {
|
|
|
-// console.log('new conditionNodes is ', newValue);
|
|
|
-// },{ deep: true });
|
|
|
+
|
|
|
|
|
|
const showInputs = ref<boolean[]>([])
|
|
|
// 失去焦点
|
|
|
const blurEvent = (index: number) => {
|
|
|
showInputs.value[index] = false
|
|
|
const conditionNode = currentNode.value.conditionNodes?.at(index) as SimpleFlowNode;
|
|
|
- conditionNode.name = conditionNode.name || '条件' + index
|
|
|
+ conditionNode.name = conditionNode.name || getDefaultConditionNodeName(index, conditionNode.attributes?.defaultFlow)
|
|
|
}
|
|
|
+
|
|
|
// 点击条件名称
|
|
|
const clickEvent = (index: number) => {
|
|
|
showInputs.value[index] = true
|
|
|
}
|
|
|
|
|
|
const conditionNodeConfig = (nodeId: string) => {
|
|
|
- console.log('nodeId', nodeId);
|
|
|
console.log("proxy.$refs", proxy.$refs);
|
|
|
- // TODO 测试后续去掉
|
|
|
const conditionNode = proxy.$refs[nodeId][0];
|
|
|
- console.log("node inf is ", conditionNode.nodeInfo);
|
|
|
conditionNode.open()
|
|
|
}
|
|
|
|