feat: [antd][bpm] 发起流程问题修复, todo 修改

pull/247/head
jason 2025-11-02 09:29:46 +08:00
parent 40f615d3c5
commit 1f767c5090
2 changed files with 27 additions and 19 deletions

View File

@ -51,7 +51,6 @@ const props = defineProps({
const emit = defineEmits(['cancel']);
const { closeCurrentTab } = useTabs();
const isFormReady = ref(false); // form-create
const getTitle = computed(() => {
return `流程表单 - ${props.selectProcessDefinition.name}`;
});
@ -122,21 +121,32 @@ async function initProcessInfo(row: any, formVariables?: any) {
// formVariables row.formFields
// formVariables
//
const formApi = formCreate.create(decodeFields(row.formFields));
const allowedFields = formApi.fields();
for (const key in formVariables) {
if (!allowedFields.includes(key)) {
delete formVariables[key];
//
const decodedFields = decodeFields(row.formFields);
const allowedFields = new Set(
decodedFields.map((field: any) => field.field).filter(Boolean),
);
//
if (formVariables) {
for (const key in formVariables) {
if (!allowedFields.has(key)) {
delete formVariables[key];
}
}
}
setConfAndFields2(detailForm, row.formConf, row.formFields, formVariables);
//
// TODO @jason
isFormReady.value = true;
// form-create
detailForm.value.option = {
...detailForm.value.option,
submitBtn: false,
resetBtn: false,
};
await nextTick();
fApi.value?.btn.show(false); //
// ,
await getApprovalDetail({
@ -153,30 +163,32 @@ async function initProcessInfo(row: any, formVariables?: any) {
}
//
} else if (row.formCustomCreatePath) {
// Tab
await router.push({
path: row.formCustomCreatePath,
});
// Tab
//
emit('cancel');
}
}
/** 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次 */
watch(
detailForm.value,
() => detailForm.value.value,
(newValue) => {
if (newValue && Object.keys(newValue.value).length > 0) {
if (newValue && Object.keys(newValue).length > 0) {
//
tempStartUserSelectAssignees.value = startUserSelectAssignees.value;
startUserSelectAssignees.value = {};
//
getApprovalDetail({
id: props.selectProcessDefinition.id,
processVariablesStr: JSON.stringify(newValue.value), // GET String JSON
processVariablesStr: JSON.stringify(newValue), // GET String JSON
});
}
},
{
immediate: true,
deep: true,
},
);
@ -283,7 +295,6 @@ defineExpose({ initProcessInfo });
class="flex-1 overflow-auto"
>
<form-create
v-if="isFormReady"
:rule="detailForm.rule"
v-model:api="fApi"
v-model="detailForm.value"

View File

@ -268,9 +268,6 @@ async function openPopover(type: string) {
Object.keys(popOverVisible.value).forEach((item) => {
if (popOverVisible.value[item]) popOverVisible.value[item] = item === type;
});
// TODO @jason 2
// await nextTick()
// formRef.value.resetFields()
}
/** 关闭气泡卡 */