feat: [bpm][antd] bpmn设计器脚本任务优化

This commit is contained in:
jason
2025-12-08 23:41:34 +08:00
parent fba43de19f
commit 70bcc5ea0f
2 changed files with 53 additions and 49 deletions

View File

@@ -2,6 +2,7 @@
import { nextTick, onBeforeUnmount, ref, toRaw, watch } from 'vue';
import {
Form,
FormItem,
Input,
Select,
@@ -75,6 +76,7 @@ watch(
<template>
<div class="mt-4">
<Form :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
<FormItem label="脚本格式">
<Input
v-model:value="scriptTaskForm.scriptFormat"
@@ -83,6 +85,7 @@ watch(
@change="updateElementTask()"
/>
</FormItem>
<!-- TODO scriptType 外部资源 内联脚本 flowable 文档 https://www.flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs#script-task 没看到到有相应的属性 -->
<FormItem label="脚本类型">
<Select v-model:value="scriptTaskForm.scriptType">
<SelectOption value="inline">内联脚本</SelectOption>
@@ -117,5 +120,6 @@ watch(
@change="updateElementTask()"
/>
</FormItem>
</Form>
</div>
</template>

View File

@@ -73,7 +73,6 @@ const httpTaskForm = ref<any>({ ...DEFAULT_HTTP_FORM });
const bpmnElement = ref();
const httpInitializing = ref(false);
const bpmnInstances = () => (window as any)?.bpmnInstances;
// 判断字符串是否包含表达式
@@ -84,7 +83,6 @@ const isExpression = (value: string): boolean => {
};
const collectHttpExtensionInfo = () => {
const businessObject = bpmnElement.value?.businessObject;
const extensionElements = businessObject?.extensionElements;
const httpFields = new Map<string, string>();
@@ -311,9 +309,11 @@ const handleExecuteTypeChange = (value: any) => {
/** 打开请求头编辑器 */
const openHttpHeaderEditor = () => {
httpHeaderEditorApi.setData ({
headers: httpTaskForm.value.requestHeaders
}).open();
httpHeaderEditorApi
.setData({
headers: httpTaskForm.value.requestHeaders,
})
.open();
};
/** 保存请求头 */
@@ -323,7 +323,7 @@ const handleHeadersSave = (headersStr: string) => {
const [HttpHeaderEditorModal, httpHeaderEditorApi] = useVbenModal({
connectedComponent: HttpHeaderEditor,
})
});
onBeforeUnmount(() => {
bpmnElement.value = null;