26
26
</div >
27
27
</template >
28
28
<div >
29
- <div class =" mb-3 text-size-sm" v-if =" currentNode.attributes.defaultFlow"
30
- >其它条件不满足进入此分支(该分支不可编辑和删除)</div
31
- >
29
+ <div class =" mb-3 font-size-16px" v-if =" currentNode.defaultFlow" >其它条件不满足进入此分支(该分支不可编辑和删除)</div >
32
30
<div v-else >
33
31
<el-form
34
32
ref =" formRef"
35
- :model =" currentNode.attributes "
33
+ :model =" currentNode"
36
34
:rules =" formRules"
37
35
label-position =" top"
38
36
>
39
37
<el-form-item label =" 配置方式" prop =" conditionType" >
40
38
<el-radio-group
41
- v-model =" currentNode.attributes. conditionType"
39
+ v-model =" currentNode.conditionType"
42
40
@change =" changeConditionType"
43
41
>
44
42
<el-radio
53
51
</el-form-item >
54
52
55
53
<el-form-item
56
- v-if =" currentNode.attributes. conditionType === 1"
54
+ v-if =" currentNode.conditionType === 1"
57
55
label =" 条件表达式"
58
56
prop =" conditionExpression"
59
57
>
60
58
<el-input
61
59
type =" textarea"
62
- v-model =" currentNode.attributes. conditionExpression"
60
+ v-model =" currentNode.conditionExpression"
63
61
clearable
64
62
style =" width : 100% "
65
63
/>
66
64
</el-form-item >
67
- <el-form-item v-if =" currentNode.attributes. conditionType === 2" label =" 条件规则" >
65
+ <el-form-item v-if =" currentNode.conditionType === 2" label =" 条件规则" >
68
66
<div class =" condition-group-tool" >
69
67
<div class =" flex items-center" >
70
68
<div class =" mr-4" >条件组关系</div >
75
73
inactive-text =" 或"
76
74
/>
77
75
</div >
78
- <!-- <div class="flex items-center">
79
- <el-button size="small" type="primary">添加条件组</el-button>
80
- </div> -->
81
76
</div >
82
77
<el-space direction =" vertical" :spacer =" conditionGroups.and ? '且' : '或'" >
83
78
<el-card
166
161
import {
167
162
SimpleFlowNode ,
168
163
CONDITION_CONFIG_TYPES ,
169
- ConditionConfigType ,
164
+ ConditionType ,
170
165
COMPARISON_OPERATORS ,
171
166
ConditionGroup ,
172
167
Condition ,
@@ -183,7 +178,7 @@ const conditionConfigTypes = computed(() => {
183
178
return CONDITION_CONFIG_TYPES .filter ((item ) => {
184
179
// 业务表单暂时去掉条件规则选项
185
180
if (formType ?.value !== 10 ) {
186
- return item .value === 1
181
+ return item .value === ConditionType . RULE
187
182
} else {
188
183
return true
189
184
}
@@ -202,9 +197,9 @@ const props = defineProps({
202
197
})
203
198
const settingVisible = ref (false )
204
199
const open = () => {
205
- if (currentNode .value .attributes . conditionType === ConditionConfigType .RULE ) {
206
- if (currentNode .value .attributes . conditionGroups ) {
207
- conditionGroups .value = currentNode .value .attributes . conditionGroups
200
+ if (currentNode .value .conditionType === ConditionType .RULE ) {
201
+ if (currentNode .value .conditionGroups ) {
202
+ conditionGroups .value = currentNode .value .conditionGroups
208
203
}
209
204
}
210
205
settingVisible .value = true
@@ -227,7 +222,7 @@ const blurEvent = () => {
227
222
showInput .value = false
228
223
currentNode .value .name =
229
224
currentNode .value .name ||
230
- getDefaultConditionNodeName (props .nodeIndex , currentNode .value . attributes ?.defaultFlow )
225
+ getDefaultConditionNodeName (props .nodeIndex , currentNode .value ?.defaultFlow )
231
226
}
232
227
233
228
const currentNode = ref <SimpleFlowNode >(props .conditionNode )
@@ -256,7 +251,7 @@ const formRef = ref() // 表单 Ref
256
251
257
252
// 保存配置
258
253
const saveConfig = async () => {
259
- if (! currentNode .value .attributes . defaultFlow ) {
254
+ if (! currentNode .value .defaultFlow ) {
260
255
// 校验表单
261
256
if (! formRef ) return false
262
257
const valid = await formRef .value .validate ()
@@ -266,25 +261,25 @@ const saveConfig = async () => {
266
261
return false
267
262
}
268
263
currentNode .value .showText = showText
269
- if (currentNode .value .attributes . conditionType === ConditionConfigType .EXPRESSION ) {
270
- currentNode .value .attributes . conditionGroups = undefined
264
+ if (currentNode .value .conditionType === ConditionType .EXPRESSION ) {
265
+ currentNode .value .conditionGroups = undefined
271
266
}
272
- if (currentNode .value .attributes . conditionType === ConditionConfigType .RULE ) {
273
- currentNode .value .attributes . conditionExpression = undefined
274
- currentNode .value .attributes . conditionGroups = conditionGroups .value
267
+ if (currentNode .value .conditionType === ConditionType .RULE ) {
268
+ currentNode .value .conditionExpression = undefined
269
+ currentNode .value .conditionGroups = conditionGroups .value
275
270
}
276
271
}
277
272
settingVisible .value = false
278
273
return true
279
274
}
280
275
const getShowText = (): string => {
281
276
let showText = ' '
282
- if (currentNode .value .attributes . conditionType === ConditionConfigType .EXPRESSION ) {
283
- if (currentNode .value .attributes . conditionExpression ) {
284
- showText = ` 表达式:${currentNode .value .attributes . conditionExpression } `
277
+ if (currentNode .value .conditionType === ConditionType .EXPRESSION ) {
278
+ if (currentNode .value .conditionExpression ) {
279
+ showText = ` 表达式:${currentNode .value .conditionExpression } `
285
280
}
286
281
}
287
- if (currentNode .value .attributes . conditionType === ConditionConfigType .RULE ) {
282
+ if (currentNode .value .conditionType === ConditionType .RULE ) {
288
283
// 条件组是否为与关系
289
284
const groupAnd = conditionGroups .value .and
290
285
let warningMesg: undefined | string = undefined
@@ -298,7 +293,7 @@ const getShowText = (): string => {
298
293
getFieldTitle (rule .leftSide ) + ' ' + getOpName (rule .opCode ) + ' ' + rule .rightSide
299
294
)
300
295
} else {
301
- // 又一条规则不完善 。提示错误
296
+ // 有一条规则不完善 。提示错误
302
297
warningMesg = ' 请完善条件规则'
303
298
return ' '
304
299
}
0 commit comments