95
95
<Icon
96
96
icon =" ep:delete"
97
97
:size =" 18"
98
- @click =" deleteVariable(configForm.inVariables, index )"
98
+ @click =" deleteVariable(index, configForm.inVariables)"
99
99
/>
100
100
</div >
101
101
</div >
102
102
<el-button type =" primary" text @click =" addVariable(configForm.inVariables)" >
103
103
<Icon icon =" ep:plus" class =" mr-5px" />添加一行
104
104
</el-button >
105
105
</el-form-item >
106
- <!-- TODO @lesan:async、source、target 几个字段,会告警 -->
107
106
<el-form-item
108
107
v-if =" configForm.async === false"
109
108
label =" 子→主变量传递"
152
151
<Icon
153
152
icon =" ep:delete"
154
153
:size =" 18"
155
- @click =" deleteVariable(configForm.outVariables, index )"
154
+ @click =" deleteVariable(index, configForm.outVariables)"
156
155
/>
157
156
</div >
158
157
</div >
159
158
<el-button type =" primary" text @click =" addVariable(configForm.outVariables)" >
160
159
<Icon icon =" ep:plus" class =" mr-5px" />添加一行
161
160
</el-button >
162
161
</el-form-item >
163
- <!-- TODO @lesan:startUserType、startUserEmptyType 要不走写下枚举类? -->
164
162
<el-form-item label =" 子流程发起人" prop =" startUserType" >
165
163
<el-radio-group v-model =" configForm.startUserType" >
166
- <el-radio :value =" 1" >同主流程发起人</el-radio >
167
- <el-radio :value =" 2" >表单</el-radio >
164
+ <el-radio
165
+ v-for =" item in CHILD_PROCESS_START_USER_TYPE"
166
+ :key =" item.value"
167
+ :value =" item.value" >
168
+ {{ item.label }}</el-radio >
168
169
</el-radio-group >
169
170
</el-form-item >
170
171
<el-form-item
173
174
prop =" startUserType"
174
175
>
175
176
<el-radio-group v-model =" configForm.startUserEmptyType" >
176
- <el-radio :value =" 1" >同主流程发起人</el-radio >
177
- <el-radio :value =" 2" >子流程管理员</el-radio >
178
- <el-radio :value =" 3" >主流程管理员</el-radio >
177
+ <el-radio
178
+ v-for =" item in CHILD_PROCESS_START_USER_EMPTY_TYPE"
179
+ :key =" item.value"
180
+ :value =" item.value" >
181
+ {{ item.label }}</el-radio >
179
182
</el-radio-group >
180
183
</el-form-item >
181
184
<el-form-item
@@ -268,7 +271,12 @@ import {
268
271
TIME_UNIT_TYPES ,
269
272
TimeUnitType ,
270
273
DelayTypeEnum ,
271
- DELAY_TYPE
274
+ DELAY_TYPE ,
275
+ IOParameter ,
276
+ ChildProcessStartUserTypeEnum ,
277
+ CHILD_PROCESS_START_USER_TYPE ,
278
+ ChildProcessStartUserEmptyTypeEnum ,
279
+ CHILD_PROCESS_START_USER_EMPTY_TYPE
272
280
} from ' ../consts'
273
281
import { useWatchNode , useDrawer , useNodeName , useFormFieldsAndStartUser } from ' ../node'
274
282
import { parseFormFields } from ' @/components/FormCreate/src/utils'
@@ -309,14 +317,29 @@ const formRules = reactive({
309
317
timeDuration: [{ required: true , message: ' 超时设置时间不能为空' , trigger: ' change' }],
310
318
dateTime: [{ required: true , message: ' 超时设置时间不能为空' , trigger: ' change' }]
311
319
})
312
- const configForm = ref ({
320
+ type ChildProcessFormType = {
321
+ async: boolean
322
+ calledProcessDefinitionKey: string
323
+ skipStartUserNode: boolean
324
+ inVariables? : IOParameter []
325
+ outVariables? : IOParameter []
326
+ startUserType: ChildProcessStartUserTypeEnum
327
+ startUserEmptyType: ChildProcessStartUserEmptyTypeEnum
328
+ startUserFormField: string
329
+ timeoutEnable: boolean
330
+ timeoutType: DelayTypeEnum
331
+ timeDuration: number
332
+ timeUnit: TimeUnitType
333
+ dateTime: string
334
+ }
335
+ const configForm = ref <ChildProcessFormType >({
313
336
async: false ,
314
337
calledProcessDefinitionKey: ' ' ,
315
338
skipStartUserNode: false ,
316
339
inVariables: [],
317
340
outVariables: [],
318
- startUserType: 1 ,
319
- startUserEmptyType: 1 ,
341
+ startUserType: ChildProcessStartUserTypeEnum . MAIN_PROCESS_START_USER ,
342
+ startUserEmptyType: ChildProcessStartUserEmptyTypeEnum . MAIN_PROCESS_START_USER ,
320
343
startUserFormField: ' ' ,
321
344
timeoutEnable: false ,
322
345
timeoutType: DelayTypeEnum .FIXED_TIME_DURATION ,
@@ -334,9 +357,8 @@ const saveConfig = async () => {
334
357
if (! formRef ) return false
335
358
const valid = await formRef .value .validate ()
336
359
if (! valid ) return false
337
- // TODO @lesan:这里的 option 黄色告警,也处理下哈
338
360
const childInfo = childProcessOptions .value .find (
339
- (option ) => option .key === configForm .value .calledProcessDefinitionKey
361
+ (option : any ) => option .key === configForm .value .calledProcessDefinitionKey
340
362
)
341
363
currentNode .value .name = nodeName .value !
342
364
if (currentNode .value .childProcessSetting ) {
@@ -378,7 +400,6 @@ const saveConfig = async () => {
378
400
return true
379
401
}
380
402
// 显示子流程节点配置, 由父组件传过来
381
- // TODO @lesan:inVariables、outVariables 红色告警
382
403
const showChildProcessNodeConfig = (node : SimpleFlowNode ) => {
383
404
nodeName .value = node .name
384
405
if (node .childProcessSetting ) {
@@ -421,15 +442,14 @@ const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
421
442
422
443
defineExpose ({ openDrawer , showChildProcessNodeConfig }) // 暴露方法给父组件
423
444
424
- // TODO @lesan:这里的 arr 黄色告警,也处理下哈,可以用 cursor quick fix 哈
425
- const addVariable = (arr ) => {
426
- arr .push ({
445
+ const addVariable = (arr ? : IOParameter []) => {
446
+ arr ?.push ({
427
447
source: ' ' ,
428
448
target: ' '
429
449
})
430
450
}
431
- const deleteVariable = (arr , index : number ) => {
432
- arr .splice (index , 1 )
451
+ const deleteVariable = (index : number , arr ? : IOParameter [] ) => {
452
+ arr ? .splice (index , 1 )
433
453
}
434
454
const handleCalledElementChange = () => {
435
455
configForm .value .inVariables = []
0 commit comments