fix: [BPM 工作流] 更多设置表单选项问题修复

pull/191/head
jason 2025-08-05 22:11:21 +08:00
parent f697dfb266
commit 8e4ea3ca44
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { computed, provide, ref, watch } from 'vue';
import { CircleHelp } from '@vben/icons';
@ -146,7 +146,7 @@ function handleTaskAfterTriggerEnableChange(val: boolean | number | string) {
: null;
}
/** 表单选项 */
/** 表单字段 */
const formField = ref<Array<{ field: string; title: string }>>([]);
const formFieldOptions4Title = computed(() => {
const cloneFormField = formField.value.map((item) => {
@ -178,6 +178,9 @@ const formFieldOptions4Summary = computed(() => {
};
});
});
const unParsedFormFields = ref<string[]>([]); //
// HttpRequestSetting 使
provide('formFields', unParsedFormFields);
/** 兼容以前未配置更多设置的流程 */
function initData() {
@ -227,6 +230,7 @@ watch(
const data = await FormApi.getFormDetail(newFormId);
const result: Array<{ field: string; title: string }> = [];
if (data.fields) {
unParsedFormFields.value = data.fields;
data.fields.forEach((fieldStr: string) => {
parseFormFields(JSON.parse(fieldStr), result);
});
@ -234,6 +238,7 @@ watch(
formField.value = result;
} else {
formField.value = [];
unParsedFormFields.value = [];
}
},
{ immediate: true },