From b7329b0c44d90e5847c24608c1223164695cbea2 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Fri, 24 Jan 2025 23:36:26 +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=91Simple=20=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E5=99=A8=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/NodeHandler.vue | 16 +- .../src/ProcessNodeTree.vue | 7 + .../SimpleProcessDesignerV2/src/consts.ts | 37 ++++ .../SimpleProcessDesignerV2/src/node.ts | 18 +- .../src/nodes-config/TriggerNodeConfig.vue | 140 +++++++++++++ .../src/nodes-config/UserTaskNodeConfig.vue | 34 ++-- .../components/HttpRequestParamSetting.vue | 181 +++++++++++++++++ .../components/UserTaskListener.vue | 187 +----------------- .../src/nodes/TriggerNode.vue | 97 +++++++++ 9 files changed, 508 insertions(+), 209 deletions(-) create mode 100644 src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue create mode 100644 src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue create mode 100644 src/components/SimpleProcessDesignerV2/src/nodes/TriggerNode.vue diff --git a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue index 3a50fe65..b3f62340 100644 --- a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue +++ b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue @@ -51,15 +51,13 @@
路由分支
- - +
触发器
+ + @@ -272,7 +270,7 @@ const addNode = (type: number) => { if (type === NodeType.TRIGGER_NODE) { const data: SimpleFlowNode = { id: 'Activity_' + generateUUID(), - name: NODE_DEFAULT_NAME.get(NodeType.ROUTER_BRANCH_NODE) as string, + name: NODE_DEFAULT_NAME.get(NodeType.TRIGGER_NODE) as string, showText: '', type: NodeType.TRIGGER_NODE, childNode: props.childNode diff --git a/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue b/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue index 26ef13dd..048764c1 100644 --- a/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue +++ b/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue @@ -49,6 +49,12 @@ v-if="currentNode && currentNode.type === NodeType.ROUTER_BRANCH_NODE" :flow-node="currentNode" @update:flow-node="handleModelValueUpdate" + /> + + + + +
+ + + + + + +
+ + + + + + + +
+
+
+ +
+ + + + diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue index 6a76beeb..ced8c8fd 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue @@ -627,7 +627,7 @@ const userTaskListenerRef = ref() // 保存配置 const saveConfig = async () => { - activeTabName.value = 'user' + // activeTabName.value = 'user' // 设置审批节点名称 currentNode.value.name = nodeName.value! // 设置审批类型 @@ -684,22 +684,22 @@ const saveConfig = async () => { currentNode.value.taskCreateListener = { enable: configForm.value.taskCreateListenerEnable ?? false, path: configForm.value.taskCreateListenerPath, - header: configForm.value.taskCreateListenerHeader, - body: configForm.value.taskCreateListenerBody + header: configForm.value.taskCreateListener?.header, + body: configForm.value.taskCreateListener?.body } // 指派任务监听器 currentNode.value.taskAssignListener = { enable: configForm.value.taskAssignListenerEnable ?? false, path: configForm.value.taskAssignListenerPath, - header: configForm.value.taskAssignListenerHeader, - body: configForm.value.taskAssignListenerBody + header: configForm.value.taskAssignListener?.header, + body: configForm.value.taskAssignListener?.body } // 完成任务监听器 currentNode.value.taskCompleteListener = { enable: configForm.value.taskCompleteListenerEnable ?? false, path: configForm.value.taskCompleteListenerPath, - header: configForm.value.taskCompleteListenerHeader, - body: configForm.value.taskCompleteListenerBody + header: configForm.value.taskCompleteListener?.header, + body: configForm.value.taskCompleteListener?.body } // 签名 currentNode.value.signEnable = configForm.value.signEnable @@ -760,18 +760,24 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => { // 5.1 创建任务 configForm.value.taskCreateListenerEnable = node.taskCreateListener!.enable configForm.value.taskCreateListenerPath = node.taskCreateListener!.path - configForm.value.taskCreateListenerHeader = node.taskCreateListener?.header ?? [] - configForm.value.taskCreateListenerBody = node.taskCreateListener?.body ?? [] + configForm.value.taskCreateListener = { + header: node.taskCreateListener?.header ?? [], + body: node.taskCreateListener?.body ?? [] + } // 5.2 指派任务 configForm.value.taskAssignListenerEnable = node.taskAssignListener!.enable configForm.value.taskAssignListenerPath = node.taskAssignListener!.path - configForm.value.taskAssignListenerHeader = node.taskAssignListener?.header ?? [] - configForm.value.taskAssignListenerBody = node.taskAssignListener?.body ?? [] - // 5.3 完成任务 + configForm.value.taskAssignListener = { + header: node.taskAssignListener?.header ?? [], + body: node.taskAssignListener?.body ?? [] + } + // 5.3 完成任务 configForm.value.taskCompleteListenerEnable = node.taskCompleteListener!.enable configForm.value.taskCompleteListenerPath = node.taskCompleteListener!.path - configForm.value.taskCompleteListenerHeader = node.taskCompleteListener?.header ?? [] - configForm.value.taskCompleteListenerBody = node.taskCompleteListener?.body ?? [] + configForm.value.taskCompleteListener = { + header: node.taskCompleteListener?.header ?? [], + body: node.taskCompleteListener?.body ?? [] + } // 6. 签名 configForm.value.signEnable = node?.signEnable ?? false // 7. 审批意见 diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue new file mode 100644 index 00000000..1c86e21a --- /dev/null +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue @@ -0,0 +1,181 @@ + + + + diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/UserTaskListener.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/UserTaskListener.vue index 6ab587c7..09b48e4e 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/UserTaskListener.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/UserTaskListener.vue @@ -31,181 +31,19 @@ > - -
-
- - - -
-
- - - -
-
- - - - - - - - -
-
- -
-
- - 添加一行 - -
- -
-
- - - -
-
- - - -
-
- - - - - - - - -
-
- -
-
- - 添加一行 - -
+ + +