optimize(projects): 优化代码

This commit is contained in:
AN
2025-07-15 22:49:55 +08:00
parent 01d42722f5
commit 59a69dd9f0
7 changed files with 19 additions and 23 deletions

View File

@ -25,6 +25,6 @@ const iframeUrl = `${baseURL}/warm-flow-ui/index.html?${stringify(urlParams)}`;
<template> <template>
<div> <div>
<iframe :src="iframeUrl" class="h-[600px] w-full" /> <iframe :src="iframeUrl" class="h-[450px] w-full" />
</div> </div>
</template> </template>

View File

@ -281,7 +281,7 @@ watch(visible, initializeData, { immediate: true });
</NForm> </NForm>
</div> </div>
<div v-else> <div v-else>
<NDescriptions bordered :column="2" label-placement="left"> <NDescriptions size="small" bordered :column="2" label-placement="left">
<NDescriptionsItem label="流程类型"> <NDescriptionsItem label="流程类型">
{{ flowCodeTypeRecord[modelDetail.flowCode] }} {{ flowCodeTypeRecord[modelDetail.flowCode] }}
</NDescriptionsItem> </NDescriptionsItem>

View File

@ -323,10 +323,9 @@ const businessId = ref<CommonType.IdType>();
async function handlePreview(row: Api.Workflow.Instance) { async function handlePreview(row: Api.Workflow.Instance) {
businessId.value = row.businessId; businessId.value = row.businessId;
const formPath = row.formPath; const formPath = row.formPath;
if (formPath) { if (!formPath) return;
dynamicComponent.value = await loadDynamicComponent(modules, formPath); dynamicComponent.value = await loadDynamicComponent(modules, formPath);
showPreviewDrawer(); showPreviewDrawer();
}
} }
</script> </script>

View File

@ -169,7 +169,7 @@ const {
} }
return ( return (
<div class="flex-center gap-8px"> <div class="flex-center gap-1px">
{buttons.map((btn, index) => (index > 0 ? [<NDivider vertical />, btn] : btn))} {buttons.map((btn, index) => (index > 0 ? [<NDivider vertical />, btn] : btn))}
</div> </div>
); );
@ -222,10 +222,9 @@ async function handleOpen(row: Api.Workflow.Instance, type: 'edit' | 'detail') {
operateType.value = type; operateType.value = type;
businessId.value = row.businessId; businessId.value = row.businessId;
const formPath = row.formPath; const formPath = row.formPath;
if (formPath) { if (!formPath) return;
dynamicComponent.value = await loadDynamicComponent(modules, formPath); dynamicComponent.value = await loadDynamicComponent(modules, formPath);
showViewDrawer(); showViewDrawer();
}
} }
async function handleDelete(row: Api.Workflow.Instance) { async function handleDelete(row: Api.Workflow.Instance) {

View File

@ -171,10 +171,9 @@ async function handleView(row: Api.Workflow.Task) {
businessId.value = row.businessId; businessId.value = row.businessId;
taskId.value = row.id; taskId.value = row.id;
const formPath = row.formPath; const formPath = row.formPath;
if (formPath) { if (!formPath) return;
dynamicComponent.value = await loadDynamicComponent(modules, formPath); dynamicComponent.value = await loadDynamicComponent(modules, formPath);
showViewDrawer(); showViewDrawer();
}
} }
</script> </script>
@ -240,6 +239,7 @@ async function handleView(row: Api.Workflow.Task) {
/> />
<component <component
:is="dynamicComponent" :is="dynamicComponent"
v-if="dynamicComponent"
:visible="viewVisible" :visible="viewVisible"
operate-type="detail" operate-type="detail"
:business-id="businessId" :business-id="businessId"

View File

@ -184,10 +184,9 @@ async function handleView(row: Api.Workflow.HisTask) {
businessId.value = row.businessId; businessId.value = row.businessId;
taskId.value = row.id; taskId.value = row.id;
const formPath = row.formPath; const formPath = row.formPath;
if (formPath) { if (!formPath) return;
dynamicComponent.value = await loadDynamicComponent(modules, formPath); dynamicComponent.value = await loadDynamicComponent(modules, formPath);
showViewDrawer(); showViewDrawer();
}
} }
</script> </script>

View File

@ -165,10 +165,9 @@ async function handleApproval(row: Api.Workflow.Task) {
businessId.value = row.businessId; businessId.value = row.businessId;
taskId.value = row.id; taskId.value = row.id;
const formPath = row.formPath; const formPath = row.formPath;
if (formPath) { if (!formPath) return;
dynamicComponent.value = await loadDynamicComponent(modules, formPath); dynamicComponent.value = await loadDynamicComponent(modules, formPath);
showViewDrawer(); showViewDrawer();
}
} }
</script> </script>