|
227 | 227 | </el-form-item>
|
228 | 228 | <el-form-item
|
229 | 229 | label="执行动作"
|
230 |
| - prop="timeoutHandlerAction" |
| 230 | + prop="timeoutHandlerType" |
231 | 231 | v-if="configForm.timeoutHandlerEnable"
|
232 | 232 | >
|
233 | 233 | <el-radio-group
|
234 |
| - v-model="configForm.timeoutHandlerAction" |
235 |
| - @change="timeoutActionChanged" |
| 234 | + v-model="configForm.timeoutHandlerType" |
| 235 | + @change="timeoutHandlerTypeChanged" |
236 | 236 | >
|
237 | 237 | <el-radio-button
|
238 |
| - v-for="item in TIMEOUT_HANDLER_ACTION_TYPES" |
| 238 | + v-for="item in TIMEOUT_HANDLER_TYPES" |
239 | 239 | :key="item.value"
|
240 | 240 | :value="item.value"
|
241 | 241 | :label="item.label"
|
|
271 | 271 | <el-form-item
|
272 | 272 | label="最大提醒次数"
|
273 | 273 | prop="maxRemindCount"
|
274 |
| - v-if="configForm.timeoutHandlerEnable && configForm.timeoutHandlerAction === 1" |
| 274 | + v-if="configForm.timeoutHandlerEnable && configForm.timeoutHandlerType === 1" |
275 | 275 | >
|
276 | 276 | <el-input-number v-model="configForm.maxRemindCount" :min="1" :max="10" />
|
277 | 277 | </el-form-item>
|
@@ -370,13 +370,14 @@ import {
|
370 | 370 | ApproveMethodType,
|
371 | 371 | TimeUnitType,
|
372 | 372 | RejectHandlerType,
|
373 |
| - TIMEOUT_HANDLER_ACTION_TYPES, |
| 373 | + TIMEOUT_HANDLER_TYPES, |
374 | 374 | TIME_UNIT_TYPES,
|
375 | 375 | REJECT_HANDLER_TYPES,
|
376 | 376 | DEFAULT_BUTTON_SETTING,
|
377 | 377 | OPERATION_BUTTON_NAME,
|
378 | 378 | ButtonSetting,
|
379 |
| - ASSIGN_START_USER_HANDLER_TYPES |
| 379 | + ASSIGN_START_USER_HANDLER_TYPES, |
| 380 | + TimeoutHandlerType |
380 | 381 | } from '../consts'
|
381 | 382 | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
382 | 383 | import {
|
@@ -426,7 +427,7 @@ const formRules = reactive({
|
426 | 427 | approveRatio: [{ required: true, message: '通过比例不能为空', trigger: 'blur' }],
|
427 | 428 | returnNodeId: [{ required: true, message: '驳回节点不能为空', trigger: 'change' }],
|
428 | 429 | timeoutHandlerEnable: [{ required: true }],
|
429 |
| - timeoutHandlerAction: [{ required: true }], |
| 430 | + timeoutHandlerType: [{ required: true }], |
430 | 431 | timeDuration: [{ required: true, message: '超时时间不能为空', trigger: 'blur' }],
|
431 | 432 | maxRemindCount: [{ required: true, message: '提醒次数不能为空', trigger: 'blur' }]
|
432 | 433 | })
|
@@ -482,8 +483,8 @@ const returnTaskList = ref<SimpleFlowNode[]>([])
|
482 | 483 | // 审批人超时未处理设置
|
483 | 484 | const {
|
484 | 485 | timeoutHandlerChange,
|
485 |
| - cTimeoutAction, |
486 |
| - timeoutActionChanged, |
| 486 | + cTimeoutType, |
| 487 | + timeoutHandlerTypeChanged, |
487 | 488 | timeUnit,
|
488 | 489 | timeUnitChange,
|
489 | 490 | isoTimeDuration,
|
@@ -514,7 +515,7 @@ const saveConfig = async () => {
|
514 | 515 | // 设置超时处理
|
515 | 516 | currentNode.value.timeoutHandler = {
|
516 | 517 | enable: configForm.value.timeoutHandlerEnable!,
|
517 |
| - action: cTimeoutAction.value, |
| 518 | + type: cTimeoutType.value, |
518 | 519 | timeDuration: isoTimeDuration.value,
|
519 | 520 | maxRemindCount: cTimeoutMaxRemindCount.value
|
520 | 521 | }
|
@@ -572,7 +573,7 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
|
572 | 573 | configForm.value.timeDuration = parseInt(parseTime)
|
573 | 574 | timeUnit.value = convertTimeUnit(parseTimeUnit)
|
574 | 575 | }
|
575 |
| - configForm.value.timeoutHandlerAction = node.timeoutHandler?.action |
| 576 | + configForm.value.timeoutHandlerType = node.timeoutHandler?.type |
576 | 577 | configForm.value.maxRemindCount = node.timeoutHandler?.maxRemindCount
|
577 | 578 | // 1.5 设置用户任务的审批人与发起人相同时
|
578 | 579 | configForm.value.assignStartUserHandlerType = node.assignStartUserHandlerType
|
@@ -619,21 +620,21 @@ function useTimeoutHandler() {
|
619 | 620 | if (configForm.value.timeoutHandlerEnable) {
|
620 | 621 | timeUnit.value = 2
|
621 | 622 | configForm.value.timeDuration = 6
|
622 |
| - configForm.value.timeoutHandlerAction = 1 |
| 623 | + configForm.value.timeoutHandlerType = 1 |
623 | 624 | configForm.value.maxRemindCount = 1
|
624 | 625 | }
|
625 | 626 | }
|
626 | 627 | // 超时执行的动作
|
627 |
| - const cTimeoutAction = computed(() => { |
| 628 | + const cTimeoutType = computed(() => { |
628 | 629 | if (!configForm.value.timeoutHandlerEnable) {
|
629 | 630 | return undefined
|
630 | 631 | }
|
631 |
| - return configForm.value.timeoutHandlerAction |
| 632 | + return configForm.value.timeoutHandlerType |
632 | 633 | })
|
633 | 634 |
|
634 | 635 | // 超时处理动作改变
|
635 |
| - const timeoutActionChanged = () => { |
636 |
| - if (configForm.value.timeoutHandlerAction === 1) { |
| 636 | + const timeoutHandlerTypeChanged = () => { |
| 637 | + if (configForm.value.timeoutHandlerType === TimeoutHandlerType.REMINDER) { |
637 | 638 | configForm.value.maxRemindCount = 1 // 超时提醒次数,默认为1
|
638 | 639 | }
|
639 | 640 | }
|
@@ -676,16 +677,16 @@ function useTimeoutHandler() {
|
676 | 677 | if (!configForm.value.timeoutHandlerEnable) {
|
677 | 678 | return undefined
|
678 | 679 | }
|
679 |
| - if (configForm.value.timeoutHandlerAction !== 1) { |
| 680 | + if (configForm.value.timeoutHandlerType !== TimeoutHandlerType.REMINDER) { |
680 | 681 | return undefined
|
681 | 682 | }
|
682 | 683 | return configForm.value.maxRemindCount
|
683 | 684 | })
|
684 | 685 |
|
685 | 686 | return {
|
686 | 687 | timeoutHandlerChange,
|
687 |
| - cTimeoutAction, |
688 |
| - timeoutActionChanged, |
| 688 | + cTimeoutType, |
| 689 | + timeoutHandlerTypeChanged, |
689 | 690 | timeUnit,
|
690 | 691 | timeUnitChange,
|
691 | 692 | isoTimeDuration,
|
|
0 commit comments