From 964cfa12263cf51b2a3d1ef281130d0e808e9078 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期六, 31 十月 2026 19:04:39 +0800
Subject: [PATCH] feat: 完善业务导入及工艺流程界面
---
src/components/import-modal/import-modal.vue | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/components/import-modal/import-modal.vue b/src/components/import-modal/import-modal.vue
index 4ce97e0..7b3bd0f 100644
--- a/src/components/import-modal/import-modal.vue
+++ b/src/components/import-modal/import-modal.vue
@@ -44,8 +44,13 @@
fileName: string;
/** 鎵ц瀵煎叆鐨勬帴鍙e嚱鏁� (file, updateSupport) => Promise */
importFn: (file: File, updateSupport: boolean) => Promise<unknown>;
+ /** 鏄惁鍏佽瑕嗙洊宸叉湁鏁版嵁 */
+ allowUpdate?: boolean;
+ uploadHint?: string;
+ /** 涓嶆彁渚涙ā鏉夸笅杞芥椂闅愯棌寮圭獥鍐呯殑涓嬭浇鎸夐挳銆� */
+ showTemplateDownload?: boolean;
/** 涓嬭浇妯℃澘鐨勬帴鍙e嚱鏁� () => Promise(blob) */
- templateFn: () => Promise<BlobPart>;
+ templateFn?: () => Promise<BlobPart>;
}
const emit = defineEmits(['success']);
@@ -69,10 +74,11 @@
label: '鏁版嵁鏂囦欢',
component: 'Upload',
rules: 'required',
- help: '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢',
+ help: () => config.value.uploadHint || '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢',
},
{
fieldName: 'updateSupport',
+ dependencies: { triggerFields: ['file'], show: () => config.value.allowUpdate !== false },
label: '鏄惁瑕嗙洊',
component: 'Switch',
componentProps: {
@@ -288,6 +294,7 @@
/** 涓嬭浇妯$増 */
async function handleDownload() {
+ if (!config.value.templateFn) return;
const data = await config.value.templateFn();
downloadFileFromBlobPart({ fileName: config.value.fileName, source: data });
}
@@ -309,7 +316,7 @@
</template>
</Form>
<template #prepend-footer>
- <div class="flex flex-auto items-center">
+ <div v-if="config.showTemplateDownload !== false" class="flex flex-auto items-center">
<Button @click="handleDownload"> 涓嬭浇瀵煎叆妯℃澘 </Button>
</div>
</template>
--
Gitblit v1.9.3