聚合
@@ -178,7 +227,7 @@ import {
import { WorkFlowNode, NodeType } from './consts'
import { useWorkFlowStoreWithOut } from '@/store/modules/simpleWorkflow'
let _uid = getCurrentInstance().uid
-
+import { generateUUID } from '@/utils'
let props = defineProps({
nodeConfig: {
type: Object as () => WorkFlowNode,
@@ -293,18 +342,21 @@ const delNode = () => {
const addTerm = (type:number) => {
const len = props.nodeConfig.conditionNodes.length
let lastIndex = props.nodeConfig.conditionNodes.length - 1
- let nodeName = '条件' + len
+ let nodeName = '分支' + len
if(type === NodeType.PARALLEL_NODE_FORK) {
nodeName = '并行' + (len+1);
lastIndex = props.nodeConfig.conditionNodes.length;
}
- // eslint-disable-next-line vue/no-mutating-props
- props.nodeConfig.conditionNodes.splice(lastIndex, 0, {
+ const conditionData = {
+ id: 'SequenceFlow'+ generateUUID(),
name: nodeName,
- type: 3,
- conditionList: [],
- childNode: null
- })
+ type: NodeType.CONDITION_NODE,
+ childNode: undefined,
+ conditionNodes:[],
+ attributes : undefined
+ };
+ // eslint-disable-next-line vue/no-mutating-props
+ props.nodeConfig.conditionNodes.splice(lastIndex, 0, conditionData)
resetConditionNodesErr()
emits('update:nodeConfig', props.nodeConfig)
}
@@ -320,7 +372,7 @@ const delTerm = (nodeType: number, index: number) => {
props.nodeConfig.conditionNodes.map((item, index) => {
// item.priorityLevel = index + 1
if (index !== props.nodeConfig.conditionNodes.length - 1) {
- item.name = `条件${index + 1}`
+ item.name = `分支${index + 1}`
}
})
}
@@ -328,7 +380,7 @@ const delTerm = (nodeType: number, index: number) => {
resetConditionNodesErr()
emits('update:nodeConfig', props.nodeConfig)
if (props.nodeConfig.conditionNodes.length == 1) {
- if (nodeType === NodeType.PARALLEL_NODE_FORK) {
+ if (nodeType === NodeType.PARALLEL_NODE_FORK || nodeType === NodeType.INCLUSIVE_NODE_FORK) {
const joinNode = props.nodeConfig.childNode;
if (joinNode?.childNode) {
if (props.nodeConfig.conditionNodes[0].childNode) {
diff --git a/src/components/SimpleProcessDesigner/src/util.ts b/src/components/SimpleProcessDesigner/src/util.ts
index b33778b7..6b139366 100644
--- a/src/components/SimpleProcessDesigner/src/util.ts
+++ b/src/components/SimpleProcessDesigner/src/util.ts
@@ -164,18 +164,18 @@ export const conditionStr = (nodeConfig, index) => {
// }
}
-export const dealStr = (str: string, obj) => {
- const arr = []
- const list = str.split(',')
- for (const elem in obj) {
- list.map((item) => {
- if (item == elem) {
- arr.push(obj[elem].value)
- }
- })
- }
- return arr.join('或')
-}
+// export const dealStr = (str: string, obj) => {
+// const arr = []
+// const list = str.split(',')
+// for (const elem in obj) {
+// list.map((item) => {
+// if (item == elem) {
+// arr.push(obj[elem].value)
+// }
+// })
+// }
+// return arr.join('或')
+// }
export const removeEle = (arr, elem, key = 'id') => {
let includesIndex
@@ -187,7 +187,7 @@ export const removeEle = (arr, elem, key = 'id') => {
arr.splice(includesIndex, 1)
}
-export const bgColors = ['87, 106, 149', '255, 148, 62', '50, 150, 250','50, 150, 250','248, 107, 248','244, 118, 118']
+export const bgColors = ['87, 106, 149', '255, 148, 62', '50, 150, 250','50, 150, 250','248, 107, 248','244, 118, 118','23, 148, 46','23, 148, 46']
export const placeholderList = ['发起人', '审核人', '抄送人']
export const setTypes = [
{ value: 1, label: '指定成员' },