feat: 添加UserTask自定义配置,审批类型

pull/614/head
Lesan 2024-12-11 08:57:35 +08:00
parent a9c924a421
commit 4bd020857f
1 changed files with 29 additions and 2 deletions

View File

@ -4,9 +4,24 @@
3. 审批人为空时 3. 审批人为空时
4. 操作按钮 4. 操作按钮
5. 字段权限 5. 字段权限
6. 审批类型
--> -->
<template> <template>
<div> <div>
<el-divider content-position="left">审批类型</el-divider>
<el-form-item prop="approveType">
<el-radio-group v-model="approveType.value">
<el-radio
v-for="(item, index) in APPROVE_TYPE"
:key="index"
:value="item.value"
:label="item.value"
>
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-divider content-position="left">审批人拒绝时</el-divider> <el-divider content-position="left">审批人拒绝时</el-divider>
<el-form-item prop="rejectHandlerType"> <el-form-item prop="rejectHandlerType">
<el-radio-group <el-radio-group
@ -158,7 +173,9 @@ import {
AssignEmptyHandlerType, AssignEmptyHandlerType,
OPERATION_BUTTON_NAME, OPERATION_BUTTON_NAME,
DEFAULT_BUTTON_SETTING, DEFAULT_BUTTON_SETTING,
FieldPermissionType FieldPermissionType,
APPROVE_TYPE,
ApproveType
} from '@/components/SimpleProcessDesignerV2/src/consts' } from '@/components/SimpleProcessDesignerV2/src/consts'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
@ -198,6 +215,9 @@ const { formType, fieldsPermissionConfig, getNodeConfigFormFields } = useFormFie
FieldPermissionType.READ FieldPermissionType.READ
) )
//
const approveType = ref({ value: ApproveType.USER })
const elExtensionElements = ref() const elExtensionElements = ref()
const otherExtensions = ref() const otherExtensions = ref()
const bpmnElement = ref() const bpmnElement = ref()
@ -217,6 +237,11 @@ const resetCustomConfigList = () => {
bpmnElement.value.businessObject?.extensionElements ?? bpmnElement.value.businessObject?.extensionElements ??
bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] }) bpmnInstances().moddle.create('bpmn:ExtensionElements', { values: [] })
//
approveType.value =
elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:ApproveType`)?.[0] ||
bpmnInstances().moddle.create(`${prefix}:ApproveType`, { value: ApproveType.USER })
// //
assignStartUserHandlerTypeEl.value = assignStartUserHandlerTypeEl.value =
elExtensionElements.value.values?.filter( elExtensionElements.value.values?.filter(
@ -294,7 +319,8 @@ const resetCustomConfigList = () => {
ex.$type !== `${prefix}:AssignEmptyHandlerType` && ex.$type !== `${prefix}:AssignEmptyHandlerType` &&
ex.$type !== `${prefix}:AssignEmptyUserIds` && ex.$type !== `${prefix}:AssignEmptyUserIds` &&
ex.$type !== `${prefix}:ButtonsSetting` && ex.$type !== `${prefix}:ButtonsSetting` &&
ex.$type !== `${prefix}:FieldsPermission` ex.$type !== `${prefix}:FieldsPermission` &&
ex.$type !== `${prefix}:ApproveType`
) ?? [] ) ?? []
// //
@ -343,6 +369,7 @@ const updateElementExtensions = () => {
returnNodeIdEl.value, returnNodeIdEl.value,
assignEmptyHandlerTypeEl.value, assignEmptyHandlerTypeEl.value,
assignEmptyUserIdsEl.value, assignEmptyUserIdsEl.value,
approveType.value,
...buttonsSettingEl.value, ...buttonsSettingEl.value,
...fieldsPermissionEl.value ...fieldsPermissionEl.value
] ]