From 475385bd4309be225b11d7214d7f33a3d3eb109a Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Sun, 26 Jan 2025 13:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=91Http=20=E8=AF=B7=E6=B1=82=E8=A7=A6=E5=8F=91=E5=99=A8?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=80=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SimpleProcessDesignerV2/src/consts.ts | 12 +-- .../SimpleProcessDesignerV2/src/node.ts | 20 ++++- .../src/nodes-config/TriggerNodeConfig.vue | 90 +++++++++++++++++-- .../components/HttpRequestParamSetting.vue | 15 ++-- 4 files changed, 119 insertions(+), 18 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts index 4f66a271..7f982c41 100644 --- a/src/components/SimpleProcessDesignerV2/src/consts.ts +++ b/src/components/SimpleProcessDesignerV2/src/consts.ts @@ -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 } @@ -726,7 +726,7 @@ export enum TriggerTypeEnum { /** * 发送 HTTP 请求触发器 */ - HTTP_REQUEST = 1, + HTTP_REQUEST = 1 } /** @@ -739,6 +739,8 @@ export type HttpRequestTriggerSetting = { header?: HttpRequestParam[] // 请求体参数设置 body?: HttpRequestParam[] + // 请求响应设置 + response?: Record[] } export const TRIGGER_TYPES: DictDataVO[] = [ diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts index 76932088..23e3c52d 100644 --- a/src/components/SimpleProcessDesignerV2/src/node.ts +++ b/src/components/SimpleProcessDesignerV2/src/node.ts @@ -14,7 +14,8 @@ import { AssignStartUserHandlerType, AssignEmptyHandlerType, FieldPermissionType, - HttpRequestParam + HttpRequestParam, + ProcessVariableEnum } from './consts' import { parseFormFields } from '@/components/FormCreate/src/utils' @@ -106,13 +107,28 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType) } } /** - * @description 获取表单的字段 + * @description 获取流程表单的字段。 */ export function useFormFields() { const formFields = inject>('formFields', ref([])) // 流程表单字段 return parseFormCreateFields(unref(formFields)) } +/** + * @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 diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue index ce5e82e1..e29278dd 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,79 @@ :closable="false" /> + + + + + + + +
+
+ + + + + +
+
+ + + +
+
+ +
+
+ + 添加一行 + +
@@ -68,7 +134,7 @@