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

View File

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