优化ImportFile
parent
47fd256ac8
commit
7ca0eebaf1
|
|
@ -12,13 +12,17 @@ export interface ImportFileProps extends Omit<FormProps, "form"> {
|
||||||
/** 弹窗标题 */
|
/** 弹窗标题 */
|
||||||
title?: string;
|
title?: string;
|
||||||
/** 模板文件地址 */
|
/** 模板文件地址 */
|
||||||
templateUrl: string;
|
templateUrl?: string;
|
||||||
/** 子组件 */
|
/** 子组件 */
|
||||||
children?: ReactNode | ((props: { form: FormInstance }) => ReactNode);
|
children?: ReactNode | ((props: { form: FormInstance }) => ReactNode);
|
||||||
/** 确认回调 */
|
/** 确认回调 */
|
||||||
onConfirm: (values: FormValues) => void;
|
onConfirm: (values: FormValues) => void;
|
||||||
/** 取消回调 */
|
/** 取消回调 */
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
|
/** 导出模板按钮文字,默认 “导出模板” */
|
||||||
|
exportTemplateButtonText?: ReactNode;
|
||||||
|
/** 额外按钮 */
|
||||||
|
extraButtons?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ const ImportFile = (props) => {
|
||||||
templateUrl,
|
templateUrl,
|
||||||
labelCol = { span: 4 },
|
labelCol = { span: 4 },
|
||||||
children,
|
children,
|
||||||
|
exportTemplateButtonText = "导出模板",
|
||||||
|
extraButtons,
|
||||||
...restProps
|
...restProps
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
|
@ -55,9 +57,10 @@ const ImportFile = (props) => {
|
||||||
footer={[
|
footer={[
|
||||||
templateUrl && (
|
templateUrl && (
|
||||||
<Button key="export" onClick={handleExportTemplate}>
|
<Button key="export" onClick={handleExportTemplate}>
|
||||||
导出模板
|
{exportTemplateButtonText}
|
||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
|
{extraButtons},
|
||||||
<Button key="cancel" onClick={handleClose}>
|
<Button key="cancel" onClick={handleClose}>
|
||||||
取消
|
取消
|
||||||
</Button>,
|
</Button>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue