diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts index d4e59155..f0614eef 100644 --- a/src/components/SimpleProcessDesignerV2/src/consts.ts +++ b/src/components/SimpleProcessDesignerV2/src/consts.ts @@ -246,15 +246,15 @@ export type AssignEmptyHandler = { export type ListenerHandler = { enable: boolean path?: string - header?: ListenerParam[] - body?: ListenerParam[] + header?: HttpRequestParam[] + body?: HttpRequestParam[] } -export type ListenerParam = { +export type HttpRequestParam = { key: string type: number value: string } -export enum ListenerParamTypeEnum { +export enum BpmHttpRequestParamTypeEnum { /** * 固定值 */ @@ -264,7 +264,7 @@ export enum ListenerParamTypeEnum { */ FROM_FORM = 2 } -export const LISTENER_MAP_TYPES = [ +export const BPM_HTTP_REQUEST_PARAM_TYPES = [ { value: 1, label: '固定值' @@ -371,13 +371,13 @@ export enum TimeUnitType { /** * 条件节点设置结构定义,用于条件节点 */ -export type ConditionSetting = { +export type ConditionSetting = { // 条件类型 - conditionType?: ConditionType, + conditionType?: ConditionType // 条件表达式 - conditionExpression?: string, + conditionExpression?: string // 条件组 - conditionGroups?: ConditionGroup, + conditionGroups?: ConditionGroup // 是否默认的条件 defaultFlow?: boolean } @@ -710,13 +710,14 @@ export type RouterSetting = { conditionGroups: ConditionGroup } -// ==================== 触发器相关定义 ==================== +// ==================== 触发器相关定义 ==================== /** * 触发器节点结构定义 */ export type TriggerSetting = { type: TriggerTypeEnum - httpRequestSetting: HttpRequestTriggerSetting + httpRequestSetting?: HttpRequestTriggerSetting + normalFormSetting?: NormalFormTriggerSetting } /** @@ -727,6 +728,10 @@ export enum TriggerTypeEnum { * 发送 HTTP 请求触发器 */ HTTP_REQUEST = 1, + /** + * 更新流程表单触发器 + */ + UPDATE_NORMAL_FORM = 2 // TODO @jason:FORM_UPDATE? } /** @@ -736,11 +741,22 @@ export type HttpRequestTriggerSetting = { // 请求 URL url: string // 请求头参数设置 - header?: ListenerParam[] // TODO 需要重命名一下 + header?: HttpRequestParam[] // 请求体参数设置 - body?: ListenerParam[] + body?: HttpRequestParam[] + // 请求响应设置 + response?: Record[] +} + +/** + * 流程表单触发器配置结构定义 + */ +export type NormalFormTriggerSetting = { + // 更新表单字段 + updateFormFields?: Record } export const TRIGGER_TYPES: DictDataVO[] = [ - { label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST } + { label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST }, + { label: '修改表单数据', value: TriggerTypeEnum.UPDATE_NORMAL_FORM } ] diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts index eba4c7ef..407fd483 100644 --- a/src/components/SimpleProcessDesignerV2/src/node.ts +++ b/src/components/SimpleProcessDesignerV2/src/node.ts @@ -14,7 +14,8 @@ import { AssignStartUserHandlerType, AssignEmptyHandlerType, FieldPermissionType, - ListenerParam + HttpRequestParam, + ProcessVariableEnum } from './consts' import { parseFormFields } from '@/components/FormCreate/src/utils' @@ -105,14 +106,31 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType) getNodeConfigFormFields } } + /** - * @description 获取表单的字段 + * @description 获取流程表单的字段 */ export function useFormFields() { const formFields = inject>('formFields', ref([])) // 流程表单字段 return parseFormCreateFields(unref(formFields)) } +// TODO @芋艿:后续需要把各种类似 useFormFieldsPermission 的逻辑,抽成一个通用方法。 +/** + * @description 获取流程表单的字段和发起人字段 + */ +export function useFormFieldsAndStartUser() { + const injectFormFields = inject>('formFields', ref([])) // 流程表单字段 + const formFields = parseFormCreateFields(unref(injectFormFields)) + // 添加发起人 + formFields.unshift({ + field: ProcessVariableEnum.START_USER_ID, + title: '发起人', + required: true + }) + return formFields +} + export type UserTaskFormType = { candidateStrategy: CandidateStrategy approveMethod: ApproveMethodType @@ -139,20 +157,20 @@ export type UserTaskFormType = { taskCreateListenerEnable?: boolean taskCreateListenerPath?: string taskCreateListener?: { - header: ListenerParam[], - body: ListenerParam[] + header: HttpRequestParam[] + body: HttpRequestParam[] } taskAssignListenerEnable?: boolean taskAssignListenerPath?: string taskAssignListener?: { - header: ListenerParam[], - body: ListenerParam[] + header: HttpRequestParam[] + body: HttpRequestParam[] } taskCompleteListenerEnable?: boolean taskCompleteListenerPath?: string - taskCompleteListener?:{ - header: ListenerParam[], - body: ListenerParam[] + taskCompleteListener?: { + header: HttpRequestParam[] + body: HttpRequestParam[] } signEnable: boolean reasonRequire: boolean diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue index 93e3795a..e9b387a7 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue @@ -47,10 +47,9 @@ import { SimpleFlowNode, ConditionType, COMPARISON_OPERATORS, - ProcessVariableEnum } from '../consts' import { getDefaultConditionNodeName } from '../utils' -import { useFormFields } from '../node' +import { useFormFieldsAndStartUser } from '../node' import Condition from './components/Condition.vue' const message = useMessage() // 消息弹窗 defineOptions({ @@ -176,23 +175,12 @@ const getShowText = (): string => { } return showText } - -const fieldsInfo = useFormFields() -/** 条件规则可选择的表单字段 */ -const fieldOptions = computed(() => { - const fieldsCopy = fieldsInfo.slice() - // 固定添加发起人 ID 字段 - fieldsCopy.unshift({ - field: ProcessVariableEnum.START_USER_ID, - title: '发起人', - required: true - }) - return fieldsCopy -}) +// 流程表单字段和发起人字段 +const fieldOptions = useFormFieldsAndStartUser() /** 获取字段名称 */ const getFieldTitle = (field: string) => { - const item = fieldOptions.value.find((item) => item.field === field) + const item = fieldOptions.find((item) => item.field === field) return item?.title } diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue index 27a351b8..741796d3 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue @@ -124,6 +124,7 @@ const saveConfig = async () => { if (!valid) return false const showText = getShowText() if (!showText) return false + currentNode.value.name = nodeName.value! currentNode.value.showText = showText if (configForm.value.delayType === DelayTypeEnum.FIXED_TIME_DURATION) { currentNode.value.delaySetting = { diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue index ce5e82e1..5c3c05b0 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue @@ -35,6 +35,7 @@ /> +
@@ -46,14 +47,137 @@ :closable="false" /> + + + + + + + +
+
+ + + + + +
+
+ + + +
+
+ +
+
+ + 添加一行 + +
+
+
+ 修改表单设置 +
+
+ + + + + +
+
的值设置为
+
+ + + +
+
+ + + +
+
+ + 添加修改字段 +
@@ -68,7 +192,7 @@ diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 4b177ae8..a5a7e449 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -307,6 +307,18 @@ const remainingRouter: AppRouteRecordRaw[] = [ activityId: route.query.activityId }) }, + { + path: 'process-instance/report', + component: () => import('@/views/bpm/processInstance/report/index.vue'), + name: 'BpmProcessInstanceReport', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '数据报表', + activeMenu: '/bpm/manager/model' + } + }, { path: 'oa/leave/create', component: () => import('@/views/bpm/oa/leave/create.vue'), diff --git a/src/views/bpm/category/CategoryForm.vue b/src/views/bpm/category/CategoryForm.vue index 9c24b3ef..defd7607 100644 --- a/src/views/bpm/category/CategoryForm.vue +++ b/src/views/bpm/category/CategoryForm.vue @@ -13,6 +13,9 @@ + + + { id: undefined, name: undefined, code: undefined, + description: undefined, status: CommonStatusEnum.ENABLE, sort: undefined } diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue index bcbd47d2..0b097847 100644 --- a/src/views/bpm/model/CategoryDraggableModel.vue +++ b/src/views/bpm/model/CategoryDraggableModel.vue @@ -192,6 +192,16 @@ 历史 + + 报表 + useAppStore().getIsDark) // 是否黑暗模式 +const router = useRouter() // 路由 const isModelSorting = ref(false) // 是否正处于排序状态 const originalData = ref([]) // 原始数据 @@ -349,6 +360,15 @@ const handleModelCommand = (command: string, row: any) => { case 'handleClean': handleClean(row) break + case 'handleReport': + router.push({ + name: 'BpmProcessInstanceReport', + query: { + processDefinitionId: row.processDefinition.id, + processDefinitionKey: row.key + } + }) + break default: break } diff --git a/src/views/bpm/model/form/ExtraSettings.vue b/src/views/bpm/model/form/ExtraSettings.vue index 182218e3..d9eb1c61 100644 --- a/src/views/bpm/model/form/ExtraSettings.vue +++ b/src/views/bpm/model/form/ExtraSettings.vue @@ -216,16 +216,16 @@ const formFieldOptions4Title = computed(() => { }) // 固定添加发起人 ID 字段 cloneFormField.unshift({ - label: ProcessVariableEnum.PROCESS_DEFINITION_NAME, - value: '流程名称' + label: '流程名称', + value: ProcessVariableEnum.PROCESS_DEFINITION_NAME }) cloneFormField.unshift({ - label: ProcessVariableEnum.START_TIME, - value: '发起时间' + label: '发起时间', + value: ProcessVariableEnum.START_TIME }) cloneFormField.unshift({ - label: ProcessVariableEnum.START_USER_ID, - value: '发起人' + label: '发起人', + value: ProcessVariableEnum.START_USER_ID }) return cloneFormField }) diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue index 0694ab8a..69fd7014 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue @@ -114,6 +114,16 @@ const setSimpleModelNodeTaskStatus = ( simpleModel.activityStatus = TaskStatusEnum.NOT_START } } + // 触发器节点 + if (simpleModel.type === NodeType.TRIGGER_NODE) { + // 触发器节点,只有通过和未执行状态 + if (finishedActivityIds.includes(simpleModel.id)) { + simpleModel.activityStatus = TaskStatusEnum.APPROVE + } else { + simpleModel.activityStatus = TaskStatusEnum.NOT_START + } + } + // 条件节点对应 SequenceFlow if (simpleModel.type === NodeType.CONDITION_NODE) { // 条件节点,只有通过和未执行状态 diff --git a/src/views/bpm/processInstance/report/index.vue b/src/views/bpm/processInstance/report/index.vue new file mode 100644 index 00000000..939c0bde --- /dev/null +++ b/src/views/bpm/processInstance/report/index.vue @@ -0,0 +1,274 @@ + + diff --git a/src/views/bpm/task/copy/index.vue b/src/views/bpm/task/copy/index.vue index 889028af..91cfaafe 100644 --- a/src/views/bpm/task/copy/index.vue +++ b/src/views/bpm/task/copy/index.vue @@ -46,6 +46,15 @@ + + + - +