|
@@ -4,19 +4,19 @@
|
|
|
<div class="branch-box-wrap">
|
|
|
<div class="branch-box" style="margin-bottom: 15px">
|
|
|
<el-button class="add-branch" color="#345da2" plain round @click="addTerm"> 添加条件 </el-button>
|
|
|
- <div v-for="(item, index) in nodeConfig.parallelNodes" :key="index" class="col-box">
|
|
|
+ <div v-for="(item, index) in nodeConfig.inclusiveNodes" :key="index" class="col-box">
|
|
|
<div class="condition-node">
|
|
|
<div class="condition-node-box">
|
|
|
<div :class="['auto-judge', `auto-judge--${item.local_status}`]" @click="show(index)">
|
|
|
<!-- 不是第一个 也不是 最后一个-->
|
|
|
- <div v-if="index != 0 && index != nodeConfig.parallelNodes.length - 1" class="sort-left" @click.stop="arrTransfer(index, -1)">
|
|
|
+ <div v-if="index != 0 && index != nodeConfig.inclusiveNodes.length - 1" class="sort-left" @click.stop="arrTransfer(index, -1)">
|
|
|
<el-icon><ArrowLeft /></el-icon>
|
|
|
</div>
|
|
|
<div class="title">
|
|
|
<span style="display: inline-block; width: 115px"
|
|
|
- ><le-text class="flex-1" tag="b" :value="index === nodeConfig.parallelNodes.length - 1 ? '默认条件' : item.nodeName"
|
|
|
+ ><le-text class="flex-1" tag="b" :value="index === nodeConfig.inclusiveNodes.length - 1 ? '默认条件' : item.nodeName"
|
|
|
/></span>
|
|
|
- <div class="close" v-if="index != nodeConfig.parallelNodes.length - 1">
|
|
|
+ <div class="close" v-if="index != nodeConfig.inclusiveNodes.length - 1">
|
|
|
<el-icon class="mx-1" @click.stop="copyTerm(index)">
|
|
|
<CopyDocument />
|
|
|
</el-icon>
|
|
@@ -28,7 +28,7 @@
|
|
|
</div>
|
|
|
<div
|
|
|
class="content"
|
|
|
- :class="[index === nodeConfig.parallelNodes.length - 1 ? 'last-child-title' : '']"
|
|
|
+ :class="[index === nodeConfig.inclusiveNodes.length - 1 ? 'last-child-title' : '']"
|
|
|
style="width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis"
|
|
|
>
|
|
|
<span v-if="toText(nodeConfig, index)" :title="toText(nodeConfig, index)">{{ toText(nodeConfig, index) }}</span>
|
|
@@ -37,10 +37,10 @@
|
|
|
<!-- 最后一个没有,长度大于2倒数第二个没有 -->
|
|
|
<div
|
|
|
v-if="
|
|
|
- !(nodeConfig.parallelNodes.length == 2 && (index === nodeConfig.parallelNodes.length - 1 || index === 0)) &&
|
|
|
+ !(nodeConfig.inclusiveNodes.length == 2 && (index === nodeConfig.inclusiveNodes.length - 1 || index === 0)) &&
|
|
|
!(
|
|
|
- (nodeConfig.parallelNodes.length > 2 && index === nodeConfig.parallelNodes.length - 1) ||
|
|
|
- index === nodeConfig.parallelNodes.length - 2
|
|
|
+ (nodeConfig.inclusiveNodes.length > 2 && index === nodeConfig.inclusiveNodes.length - 1) ||
|
|
|
+ index === nodeConfig.inclusiveNodes.length - 2
|
|
|
)
|
|
|
"
|
|
|
class="sort-right"
|
|
@@ -55,8 +55,8 @@
|
|
|
<slot v-if="item.childNode" :node="item"></slot>
|
|
|
<div v-if="index == 0" class="top-left-cover-line"></div>
|
|
|
<div v-if="index == 0" class="bottom-left-cover-line"></div>
|
|
|
- <div v-if="index == nodeConfig.parallelNodes.length - 1" class="top-right-cover-line"></div>
|
|
|
- <div v-if="index == nodeConfig.parallelNodes.length - 1" class="bottom-right-cover-line"></div>
|
|
|
+ <div v-if="index == nodeConfig.inclusiveNodes.length - 1" class="top-right-cover-line"></div>
|
|
|
+ <div v-if="index == nodeConfig.inclusiveNodes.length - 1" class="bottom-right-cover-line"></div>
|
|
|
</div>
|
|
|
<div class="svg-icon-box">
|
|
|
<svg-icon style="font-size: 18px" color="#345da2" icon-class="flow-merge" />
|
|
@@ -204,13 +204,13 @@ export default {
|
|
|
methods: {
|
|
|
show(index) {
|
|
|
if (this.disabled) return
|
|
|
- if (index === this.nodeConfig.parallelNodes.length - 1) {
|
|
|
+ if (index === this.nodeConfig.inclusiveNodes.length - 1) {
|
|
|
// 最后一个节点不能编辑
|
|
|
return
|
|
|
}
|
|
|
this.index = index
|
|
|
this.form = {}
|
|
|
- this.form = JSON.parse(JSON.stringify(this.nodeConfig.parallelNodes[index]))
|
|
|
+ this.form = JSON.parse(JSON.stringify(this.nodeConfig.inclusiveNodes[index]))
|
|
|
const { formStructure } = JSON.parse(this.processForm) // 表单设计字段
|
|
|
// 使用 filter 方法找到 required 属性为 true 的对象
|
|
|
const requiredList = (formStructure?.fields || []).filter(item => item.options && item.options.required === true)
|
|
@@ -231,13 +231,13 @@ export default {
|
|
|
if (!this.form.nodeKey) {
|
|
|
return ElMessage.error('请填写nodeKey')
|
|
|
}
|
|
|
- this.nodeConfig.parallelNodes[this.index] = this.form
|
|
|
+ this.nodeConfig.inclusiveNodes[this.index] = this.form
|
|
|
this.$emit('update:modelValue', this.nodeConfig)
|
|
|
this.drawer = false
|
|
|
},
|
|
|
addTerm() {
|
|
|
- let len = this.nodeConfig.parallelNodes.length + 1
|
|
|
- this.nodeConfig.parallelNodes.push({
|
|
|
+ let len = this.nodeConfig.inclusiveNodes.length + 1
|
|
|
+ this.nodeConfig.inclusiveNodes.push({
|
|
|
nodeName: '包容条件' + len,
|
|
|
nodeKey: getNodeKey(),
|
|
|
type: 3,
|
|
@@ -247,28 +247,28 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
delTerm(index) {
|
|
|
- this.nodeConfig.parallelNodes.splice(index, 1)
|
|
|
- if (this.nodeConfig.parallelNodes.length == 1) {
|
|
|
+ this.nodeConfig.inclusiveNodes.splice(index, 1)
|
|
|
+ if (this.nodeConfig.inclusiveNodes.length == 1) {
|
|
|
if (this.nodeConfig.childNode) {
|
|
|
- if (this.nodeConfig.parallelNodes[0].childNode) {
|
|
|
- this.reData(this.nodeConfig.parallelNodes[0].childNode, this.nodeConfig.childNode)
|
|
|
+ if (this.nodeConfig.inclusiveNodes[0].childNode) {
|
|
|
+ this.reData(this.nodeConfig.inclusiveNodes[0].childNode, this.nodeConfig.childNode)
|
|
|
} else {
|
|
|
- this.nodeConfig.parallelNodes[0].childNode = this.nodeConfig.childNode
|
|
|
+ this.nodeConfig.inclusiveNodes[0].childNode = this.nodeConfig.childNode
|
|
|
}
|
|
|
}
|
|
|
- this.$emit('update:modelValue', this.nodeConfig.parallelNodes[0].childNode)
|
|
|
+ this.$emit('update:modelValue', this.nodeConfig.inclusiveNodes[0].childNode)
|
|
|
}
|
|
|
},
|
|
|
copyTerm(index) {
|
|
|
- let len = this.nodeConfig.parallelNodes.length + 1
|
|
|
- const currentNode = JSON.parse(JSON.stringify(this.nodeConfig.parallelNodes[index]))
|
|
|
+ let len = this.nodeConfig.inclusiveNodes.length + 1
|
|
|
+ const currentNode = JSON.parse(JSON.stringify(this.nodeConfig.inclusiveNodes[index]))
|
|
|
const item = {
|
|
|
...currentNode,
|
|
|
nodeKey: getNodeKey(),
|
|
|
nodeName: currentNode.nodeName + '-Copy',
|
|
|
priorityLevel: len
|
|
|
}
|
|
|
- this.nodeConfig.parallelNodes.push(item)
|
|
|
+ this.nodeConfig.inclusiveNodes.push(item)
|
|
|
this.$emit('update:modelValue', this.nodeConfig)
|
|
|
},
|
|
|
reData(data, addData) {
|
|
@@ -279,8 +279,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
arrTransfer(index, type = 1) {
|
|
|
- this.nodeConfig.parallelNodes[index] = this.nodeConfig.parallelNodes.splice(index + type, 1, this.nodeConfig.parallelNodes[index])[0]
|
|
|
- this.nodeConfig.parallelNodes.map((item, index) => {
|
|
|
+ this.nodeConfig.inclusiveNodes[index] = this.nodeConfig.inclusiveNodes.splice(index + type, 1, this.nodeConfig.inclusiveNodes[index])[0]
|
|
|
+ this.nodeConfig.inclusiveNodes.map((item, index) => {
|
|
|
item.priorityLevel = index + 1
|
|
|
})
|
|
|
this.$emit('update:modelValue', this.nodeConfig)
|
|
@@ -304,7 +304,7 @@ export default {
|
|
|
this.form.conditionList.splice(index, 1)
|
|
|
},
|
|
|
toText(nodeConfig, index) {
|
|
|
- var { conditionList } = nodeConfig.parallelNodes[index]
|
|
|
+ var { conditionList } = nodeConfig.inclusiveNodes[index]
|
|
|
if (conditionList && conditionList.length == 1) {
|
|
|
const text = conditionList.map(conditionGroup =>
|
|
|
conditionGroup
|
|
@@ -322,7 +322,7 @@ export default {
|
|
|
} else if (conditionList && conditionList.length > 1) {
|
|
|
return conditionList.length + '个条件,或满足'
|
|
|
} else {
|
|
|
- if (index == nodeConfig.parallelNodes.length - 1) {
|
|
|
+ if (index == nodeConfig.inclusiveNodes.length - 1) {
|
|
|
return '未满足时其他条件时,将进入默认流程'
|
|
|
} else {
|
|
|
return false
|