fix: 去除流程设计器跳过表达式值为null

This commit is contained in:
tony
2023-01-06 10:38:42 +08:00
parent de8e4d5881
commit 31e14dd7a3
3 changed files with 180 additions and 19 deletions

View File

@@ -18,6 +18,7 @@
<script>
import mixinPanel from '../../common/mixinPanel'
import {StrUtil} from '@/utils/StrUtil'
import mixinExecutionListener from '../../common/mixinExecutionListener'
import { commonParse, conditionExpressionParse } from '../../common/parseElement'
export default {
@@ -69,16 +70,20 @@ export default {
},
watch: {
'formData.conditionExpression': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
const newCondition = this.modeler.get('moddle').create('bpmn:FormalExpression', { body: val })
this.updateProperties({ conditionExpression: newCondition })
} else {
this.updateProperties({ conditionExpression: null })
}
// else {
// this.updateProperties({ conditionExpression: null })
// }
},
'formData.skipExpression': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:skipExpression': val })
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:skipExpression': val})
} else {
delete this.element.businessObject.$attrs[`flowable:skipExpression`]
}
}
},
created() {

View File

@@ -119,6 +119,7 @@ import executionListenerDialog from './property/executionListener'
import taskListenerDialog from './property/taskListener'
import multiInstanceDialog from './property/multiInstance'
import { commonParse, userTaskParse } from '../../common/parseElement'
import {StrUtil} from '@/utils/StrUtil'
import FlowUser from '@/components/flow/User'
import FlowRole from '@/components/flow/Role'
import FlowExp from '@/components/flow/Expression'
@@ -357,7 +358,7 @@ export default {
watch: {
'formData.userType': function(val, oldVal) {
const types = ['assignee', 'candidateUsers', 'candidateGroups']
if (oldVal) {
if (StrUtil.isNotBlank(oldVal)) {
types.forEach(type => {
delete this.element.businessObject.$attrs[`flowable:${type}`]
delete this.formData[type]
@@ -367,67 +368,69 @@ export default {
this.updateProperties({'flowable:userType': val})
},
'formData.async': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:async': val})
}
},
'formData.dueDate': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:dueDate': val})
}
},
'formData.formKey': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:formKey': val})
}
},
'formData.priority': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:priority': val})
}
},
'formData.skipExpression': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:skipExpression': val})
} else {
delete this.element.businessObject.$attrs[`flowable:skipExpression`]
}
},
'formData.isForCompensation': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'isForCompensation': val})
}
},
'formData.triggerable': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:triggerable': val})
}
},
'formData.class': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:class': val})
}
},
'formData.autoStoreVariables': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:autoStoreVariables': val})
}
},
'formData.exclude': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:exclude': val})
}
},
'formData.ruleVariablesInput': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:ruleVariablesInput': val})
}
},
'formData.rules': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:rules': val})
}
},
'formData.resultVariable': function(val) {
if (val) {
if (StrUtil.isNotBlank(val)) {
this.updateProperties({'flowable:resultVariable': val})
}
}