27
27
<el-tab-pane label =" 子流程" name =" child" >
28
28
<div >
29
29
<el-form ref =" formRef" :model =" configForm" label-position =" top" :rules =" formRules" >
30
- <el-form-item label =" 选择子流程" prop =" calledElement" >
30
+ <el-form-item label =" 是否异步" prop =" async" >
31
+ <el-switch
32
+ v-model =" configForm.async"
33
+ active-text =" 异步"
34
+ inactive-text =" 不异步"
35
+ />
36
+ </el-form-item >
37
+ <el-form-item label =" 选择子流程" prop =" calledProcessDefinitionKey" >
31
38
<el-select
32
- v-model =" configForm.calledElement "
39
+ v-model =" configForm.calledProcessDefinitionKey "
33
40
clearable
34
41
@change =" handleCalledElementChange"
35
42
>
48
55
inactive-text =" 不跳过"
49
56
/>
50
57
</el-form-item >
51
- <el-form-item label =" 主→子变量传递" prop =" inVariable " >
52
- <div class =" flex pt-2" v-for =" (item, index) in configForm.inVariable " :key =" index" >
58
+ <el-form-item label =" 主→子变量传递" prop =" inVariables " >
59
+ <div class =" flex pt-2" v-for =" (item, index) in configForm.inVariables " :key =" index" >
53
60
<div class =" mr-2" >
54
61
<el-form-item
55
- :prop =" `inVariable .${index}.source`"
62
+ :prop =" `inVariables .${index}.source`"
56
63
:rules =" {
57
64
required: true,
58
65
message: '变量不能为空',
71
78
</div >
72
79
<div class =" mr-2" >
73
80
<el-form-item
74
- :prop =" `inVariable .${index}.target`"
81
+ :prop =" `inVariables .${index}.target`"
75
82
:rules =" {
76
83
required: true,
77
84
message: '变量不能为空',
92
99
<Icon
93
100
icon =" ep:delete"
94
101
:size =" 18"
95
- @click =" deleteVariable(configForm.inVariable , index)"
102
+ @click =" deleteVariable(configForm.inVariables , index)"
96
103
/>
97
104
</div >
98
105
</div >
99
- <el-button type =" primary" text @click =" addVariable(configForm.inVariable )" >
106
+ <el-button type =" primary" text @click =" addVariable(configForm.inVariables )" >
100
107
<Icon icon =" ep:plus" class =" mr-5px" />添加一行
101
108
</el-button >
102
109
</el-form-item >
103
110
<el-form-item
104
- v-if =" currentNode.childProcessSetting? .async === false"
111
+ v-if =" configForm .async === false"
105
112
label =" 子→主变量传递"
106
- prop =" outVariable "
113
+ prop =" outVariables "
107
114
>
108
- <div class =" flex pt-2" v-for =" (item, index) in configForm.outVariable " :key =" index" >
115
+ <div class =" flex pt-2" v-for =" (item, index) in configForm.outVariables " :key =" index" >
109
116
<div class =" mr-2" >
110
117
<el-form-item
111
- :prop =" `outVariable .${index}.source`"
118
+ :prop =" `outVariables .${index}.source`"
112
119
:rules =" {
113
120
required: true,
114
121
message: '变量不能为空',
127
134
</div >
128
135
<div class =" mr-2" >
129
136
<el-form-item
130
- :prop =" `outVariable .${index}.target`"
137
+ :prop =" `outVariables .${index}.target`"
131
138
:rules =" {
132
139
required: true,
133
140
message: '变量不能为空',
148
155
<Icon
149
156
icon =" ep:delete"
150
157
:size =" 18"
151
- @click =" deleteVariable(configForm.outVariable , index)"
158
+ @click =" deleteVariable(configForm.outVariables , index)"
152
159
/>
153
160
</div >
154
161
</div >
155
- <el-button type =" primary" text @click =" addVariable(configForm.outVariable )" >
162
+ <el-button type =" primary" text @click =" addVariable(configForm.outVariables )" >
156
163
<Icon icon =" ep:plus" class =" mr-5px" />添加一行
157
164
</el-button >
158
165
</el-form-item >
@@ -227,7 +234,8 @@ const activeTabName = ref('child')
227
234
const formRef = ref () // 表单 Ref
228
235
// 表单校验规则
229
236
const formRules = reactive ({
230
- calledElement: [{ required: true , message: ' 子流程不能为空' , trigger: ' change' }],
237
+ async: [{ required: true , message: ' 是否异步不能为空' , trigger: ' change' }],
238
+ calledProcessDefinitionKey: [{ required: true , message: ' 子流程不能为空' , trigger: ' change' }],
231
239
skipStartUserNode: [
232
240
{ required: true , message: ' 是否自动跳过子流程发起节点不能为空' , trigger: ' change' }
233
241
],
@@ -238,10 +246,10 @@ const formRules = reactive({
238
246
startUserFormField: [{ required: true , message: ' 发起人表单不能为空' , trigger: ' change' }]
239
247
})
240
248
const configForm = ref ({
241
- calledElement : ' ' ,
249
+ calledProcessDefinitionKey : ' ' ,
242
250
skipStartUserNode: false ,
243
- inVariable : [],
244
- outVariable : [],
251
+ inVariables : [],
252
+ outVariables : [],
245
253
startUserType: 1 ,
246
254
startUserEmptyType: 1 ,
247
255
startUserFormField: ' '
@@ -257,17 +265,18 @@ const saveConfig = async () => {
257
265
const valid = await formRef .value .validate ()
258
266
if (! valid ) return false
259
267
const childInfo = childProcessOptions .value .find (
260
- (option ) => option .key === configForm .value .calledElement
268
+ (option ) => option .key === configForm .value .calledProcessDefinitionKey
261
269
)
262
270
currentNode .value .name = nodeName .value !
263
271
if (currentNode .value .childProcessSetting ) {
264
- currentNode .value .childProcessSetting .calledElement = childInfo .key
265
- currentNode .value .childProcessSetting .calledElementName = childInfo .name
272
+ currentNode .value .childProcessSetting .async = configForm .value .async
273
+ currentNode .value .childProcessSetting .calledProcessDefinitionKey = childInfo .key
274
+ currentNode .value .childProcessSetting .calledProcessDefinitionName = childInfo .name
266
275
currentNode .value .childProcessSetting .skipStartUserNode = configForm .value .skipStartUserNode
267
- currentNode .value .childProcessSetting .inVariable = configForm .value .inVariable
268
- currentNode .value .childProcessSetting .outVariable = configForm .value .outVariable
276
+ currentNode .value .childProcessSetting .inVariables = configForm .value .inVariables
277
+ currentNode .value .childProcessSetting .outVariables = configForm .value .outVariables
269
278
currentNode .value .childProcessSetting .startUserSetting .type = configForm .value .startUserType
270
- currentNode .value .childProcessSetting .startUserSetting .emptyHandleType =
279
+ currentNode .value .childProcessSetting .startUserSetting .emptyType =
271
280
configForm .value .startUserEmptyType
272
281
currentNode .value .childProcessSetting .startUserSetting .formField =
273
282
configForm .value .startUserFormField
@@ -280,13 +289,15 @@ const saveConfig = async () => {
280
289
const showChildProcessNodeConfig = (node : SimpleFlowNode ) => {
281
290
nodeName .value = node .name
282
291
if (node .childProcessSetting ) {
283
- configForm .value .calledElement = node .childProcessSetting .calledElement
292
+ configForm .value .async =
293
+ node .childProcessSetting .async
294
+ configForm .value .calledProcessDefinitionKey =
295
+ node .childProcessSetting .calledProcessDefinitionKey
284
296
configForm .value .skipStartUserNode = node .childProcessSetting .skipStartUserNode
285
- configForm .value .inVariable = node .childProcessSetting .inVariable
286
- configForm .value .outVariable = node .childProcessSetting .outVariable
297
+ configForm .value .inVariables = node .childProcessSetting .inVariables
298
+ configForm .value .outVariables = node .childProcessSetting .outVariables
287
299
configForm .value .startUserType = node .childProcessSetting .startUserSetting .type
288
- configForm .value .startUserEmptyType =
289
- node .childProcessSetting .startUserSetting .emptyHandleType ?? 1
300
+ configForm .value .startUserEmptyType = node .childProcessSetting .startUserSetting .emptyType ?? 1
290
301
configForm .value .startUserFormField = node .childProcessSetting .startUserSetting .formField ?? ' '
291
302
}
292
303
loadFormInfo ()
@@ -304,13 +315,13 @@ const deleteVariable = (arr, index: number) => {
304
315
arr .splice (index , 1 )
305
316
}
306
317
const handleCalledElementChange = () => {
307
- configForm .value .inVariable = []
308
- configForm .value .outVariable = []
318
+ configForm .value .inVariables = []
319
+ configForm .value .outVariables = []
309
320
loadFormInfo ()
310
321
}
311
322
const loadFormInfo = async () => {
312
323
const childInfo = childProcessOptions .value .find (
313
- (option ) => option .key === configForm .value .calledElement
324
+ (option ) => option .key === configForm .value .calledProcessDefinitionKey
314
325
)
315
326
const formInfo = await getForm (childInfo .formId )
316
327
childFormFieldOptions .value = []
0 commit comments