|
@@ -43,6 +43,8 @@ export const DageUpload: FC<DageUploadProps> = ({
|
|
|
disabled,
|
|
|
name = "file",
|
|
|
downloadErrorMessage = "下载失败",
|
|
|
+ children,
|
|
|
+ className,
|
|
|
onChange,
|
|
|
...rest
|
|
|
}) => {
|
|
@@ -218,27 +220,34 @@ export const DageUpload: FC<DageUploadProps> = ({
|
|
|
};
|
|
|
|
|
|
return (
|
|
|
- <UploadContainer>
|
|
|
+ <UploadContainer className={className}>
|
|
|
{[DageUploadType.MODEL, DageUploadType.MOBILE_MODEL].includes(dType) ? (
|
|
|
<AntdDragger style={{ padding: "0 24px", width: "320px" }} {...props}>
|
|
|
- <CloudUploadOutlined style={{ fontSize: "40px", color: "#1677ff" }} />
|
|
|
+ {children || (
|
|
|
+ <>
|
|
|
+ <CloudUploadOutlined
|
|
|
+ style={{ fontSize: "40px", color: "#1677ff" }}
|
|
|
+ />
|
|
|
|
|
|
- <AntdDraggerText>
|
|
|
- 将文件拖到此处,或<span>点击上传</span>
|
|
|
- </AntdDraggerText>
|
|
|
- <UploadTips className="dage-upload__tips">{tips}</UploadTips>
|
|
|
+ <AntdDraggerText>
|
|
|
+ 将文件拖到此处,或<span>点击上传</span>
|
|
|
+ </AntdDraggerText>
|
|
|
+ <UploadTips className="dage-upload__tips">{tips}</UploadTips>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
</AntdDragger>
|
|
|
) : (
|
|
|
<>
|
|
|
<AntdUpload {...props}>
|
|
|
- {isPictureCard ? (
|
|
|
- !disabled &&
|
|
|
- (!value || value.length < maxCount) && <PlusOutlined />
|
|
|
- ) : (
|
|
|
- <Button disabled={disabled} icon={<UploadOutlined />}>
|
|
|
- 上传
|
|
|
- </Button>
|
|
|
- )}
|
|
|
+ {children ||
|
|
|
+ (isPictureCard ? (
|
|
|
+ !disabled &&
|
|
|
+ (!value || value.length < maxCount) && <PlusOutlined />
|
|
|
+ ) : (
|
|
|
+ <Button disabled={disabled} icon={<UploadOutlined />}>
|
|
|
+ 上传
|
|
|
+ </Button>
|
|
|
+ ))}
|
|
|
</AntdUpload>
|
|
|
|
|
|
{!!tips && (
|