diff --git a/app/view/component/flow/editNode.html b/app/view/component/flow/editNode.html
index 950cc21..4784494 100644
--- a/app/view/component/flow/editNode.html
+++ b/app/view/component/flow/editNode.html
@@ -1,5 +1,5 @@
-
+
GUID
@@ -156,13 +156,13 @@
-
+
@@ -172,26 +172,28 @@
+ @change="changeConditionId($event, item)" :rules="validationRules.requireRules">
-
+
+ @change="changeExpress($event, item, index)" :rules="validationRules.requireRules">
-
+
+
- 添加条件
+ 添加条件
@@ -264,7 +266,14 @@
},
data() {
return {
- isFormValid: true,
+ validationRules: {
+ requireRules: [
+ v => !!v || '必填',
+ ],
+ arrayRequireRules: [
+ v => (v && !!v.length) || '必填',
+ ],
+ },
node: {
id: ''
},
@@ -342,7 +351,6 @@
},
'node.conditionList': {
handler: async function (val) {
- this.$forceUpdate()
this.$emit('reflesh-workflow')
},
deep: true
@@ -362,6 +370,9 @@
})
]
},
+ selectedCondition(){
+ return this.node.conditionList?.map(item => item.id).filter(item => item)
+ },
conditions(){
var conditions = [
{
@@ -373,7 +384,8 @@
text: '包含'
}
],
- optionList: this.user
+ optionList: this.user,
+ disabled: this.selectedCondition.includes('single-applyPerson')
},
...this.workflowForm
.filter(i => ['single', 'multiple', 'number'].includes(i.type))
@@ -383,7 +395,8 @@
name: i.statement,
type: i.type,
operator: this.constantObj.operators[i.type],
- optionList: i.optionList
+ optionList: i.optionList,
+ disabled: this.selectedCondition.includes(i.id)
}
})
]
@@ -407,6 +420,7 @@
await this.deleteCondition(uiActionData);
break;
case 'closeConditionGroupDialog':
+ await this.conditionValidate();
await this.closeConditionGroupDialog();
break;
default:
@@ -423,11 +437,18 @@
},
addCondition(){
if(this.node?.conditionList && this.node.conditionList.length > 0){
- this.$set(this.node, 'conditionList', [...this.node.conditionList, {}])
+ this.$set(this.node, 'conditionList', [...this.node.conditionList, {
+ id: null,
+ express: null,
+ option: null
+ }])
}else{
- this.$set(this.node, 'conditionList', [{}])
+ this.$set(this.node, 'conditionList', [{
+ id: null,
+ express: null,
+ option: null
+ }])
}
- this.$forceUpdate()
},
deleteCondition(index){
this.node.conditionList.splice(index, 1)
@@ -436,16 +457,21 @@
var conditionItem = this.conditions.find(c => c.id == id)
item.type = conditionItem.type || null
item.express = null
- // item.option = item.type == 'number'? { begin: null, end: null} : null
item.option = null
},
- changeExpress(express, item){
- if(item.type == 'number' && express == 'between'){
- this.$set(item, 'option', { begin: null, end: null})
- }else{
- this.$set(item, 'option', null)
+ changeExpress(express, item, index){
+ if (item.type === 'number' && express === 'between') {
+ this.node.conditionList[index].option = { begin: null, end: null };
+ } else {
+ this.node.conditionList[index].option = null;
}
- this.$forceUpdate()
+ },
+ async conditionValidate(){
+ if (await this.$refs.conditionForm.validate()) {
+ return true;
+ }
+ await window.vtoast.fail("请完善信息!");
+ throw new Error("请完善信息!")
},
closeConditionGroupDialog(){
this.$forceUpdate()