From 7ca0eebaf12271b1c0185bb7724cda01ca79147e Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Thu, 18 Dec 2025 16:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ImportFile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ImportFile/index.d.ts | 6 +++++- components/ImportFile/index.js | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/ImportFile/index.d.ts b/components/ImportFile/index.d.ts index 67fbb9f..de3e4cf 100644 --- a/components/ImportFile/index.d.ts +++ b/components/ImportFile/index.d.ts @@ -12,13 +12,17 @@ export interface ImportFileProps extends Omit { /** 弹窗标题 */ title?: string; /** 模板文件地址 */ - templateUrl: string; + templateUrl?: string; /** 子组件 */ children?: ReactNode | ((props: { form: FormInstance }) => ReactNode); /** 确认回调 */ onConfirm: (values: FormValues) => void; /** 取消回调 */ onCancel: () => void; + /** 导出模板按钮文字,默认 “导出模板” */ + exportTemplateButtonText?: ReactNode; + /** 额外按钮 */ + extraButtons?: ReactNode; } /** diff --git a/components/ImportFile/index.js b/components/ImportFile/index.js index 1ee0962..bf7d9bd 100644 --- a/components/ImportFile/index.js +++ b/components/ImportFile/index.js @@ -14,6 +14,8 @@ const ImportFile = (props) => { templateUrl, labelCol = { span: 4 }, children, + exportTemplateButtonText = "导出模板", + extraButtons, ...restProps } = props; @@ -55,9 +57,10 @@ const ImportFile = (props) => { footer={[ templateUrl && ( ), + {extraButtons}, ,