模版配置限制
This commit is contained in:
1 parent
391aea1034
commit
c06d8f1fff
3 files changed
+23
-29
No files matched your search
@@ -104,21 +104,6 @@
|
||||
</div>
|
||||
<!-- <<<<<<<<<<<<< 复杂右侧 -->
|
||||
</template>
|
||||
<template>
|
||||
<v-snackbar v-model="isSnackerShown" top timeout="5000">
|
||||
<span>{{disPassValidateText}}</span>
|
||||
<template v-slot:action="{ attrs }">
|
||||
<v-btn
|
||||
color="red"
|
||||
text
|
||||
v-bind="attrs"
|
||||
@click="isSnackerShown = false"
|
||||
>
|
||||
关闭
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-snackbar>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -226,7 +211,6 @@ Vue.component("process-flow", {
|
||||
displayMode: 'complex', // 'complex'、'simple'
|
||||
isAddNodeMenuShown: false,
|
||||
activeMenuIndex: -1,
|
||||
isSnackerShown: false,
|
||||
disPassValidateText:"",
|
||||
isPassValidate: true
|
||||
};
|
||||
@@ -823,10 +807,10 @@ Vue.component("process-flow", {
|
||||
this.isPassValidate = true
|
||||
const { lineList, nodeList } = this.workflowConfig;
|
||||
|
||||
// 不允许多个开始节点或结束节点
|
||||
if(nodeList.filter(n=>n.properties.type == 'start').length != 1 || nodeList.filter(n=>n.properties.type == 'end').length != 1){
|
||||
// 不允许单节点回环
|
||||
if(lineList.filter(l => l.sourceNodeId == l.targetNodeId).length > 0){
|
||||
this.isPassValidate = false
|
||||
this.disPassValidateText += "只允许存在1个开始节点或结束节点!\n"
|
||||
this.disPassValidateText += "不允许单节点回环!\n"
|
||||
}
|
||||
|
||||
// 不允许没有审核节点
|
||||
@@ -902,7 +886,7 @@ Vue.component("process-flow", {
|
||||
// 拿到同一层的条件节点
|
||||
var conditionNode = element.map(l => nodeList.find(n => n.id === l.targetNodeId))
|
||||
|
||||
if(!_.some(conditionNode, i => i.properties.priority == -1)){
|
||||
if(!_.some(conditionNode, i => i.properties?.priority == -1)){
|
||||
this.isPassValidate = false
|
||||
this.disPassValidateText += "不允许存在某层条件节点没有默认条件优先级!\n"
|
||||
}
|
||||
@@ -914,11 +898,11 @@ Vue.component("process-flow", {
|
||||
const element = nodeList[index];
|
||||
|
||||
if(['conditionTask'].includes(element.properties.type)){
|
||||
if(!element.properties.priority){
|
||||
if(!element.properties?.priority){
|
||||
this.isPassValidate = false
|
||||
this.disPassValidateText += `${element.properties.label}节点没有设置优先级!\n`
|
||||
}else{
|
||||
if(element.properties.priority != -1 && element.properties.conditionList.length <= 0){
|
||||
if(element.properties?.priority != -1 && element.properties?.conditionList.length <= 0){
|
||||
this.isPassValidate = false
|
||||
this.disPassValidateText += `${element.properties.label}节点没有设置条件组!\n`
|
||||
}
|
||||
@@ -947,9 +931,8 @@ Vue.component("process-flow", {
|
||||
}
|
||||
|
||||
if(!this.isPassValidate){
|
||||
// await window.vtoast.fail(this.disPassValidateText);
|
||||
this.isSnackerShown = true
|
||||
throw new Error(this.disPassValidateText)
|
||||
await window.vtoast.fail('流程设置:' + this.disPassValidateText);
|
||||
throw new Error('流程设置:' + this.disPassValidateText)
|
||||
}
|
||||
},
|
||||
closeEditNode(){
|
||||
@@ -1091,5 +1074,6 @@ Vue.component("process-flow", {
|
||||
white-space: nowrap;
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user