From 3ff1a860aa3f6d70a6a24e7891715eea669b9bee Mon Sep 17 00:00:00 2001 From: zhuyangbin Date: Tue, 8 Sep 2020 21:32:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apolloTable/component/base/extra/upload/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/apolloTable/component/base/extra/upload/index.tsx b/components/apolloTable/component/base/extra/upload/index.tsx index 1713a0a..9c9c685 100644 --- a/components/apolloTable/component/base/extra/upload/index.tsx +++ b/components/apolloTable/component/base/extra/upload/index.tsx @@ -11,7 +11,9 @@ message.config({ }); const UploadCom = (props) => { - const { onChange, CDN_HOST, getFormat, setFormat, data, maxLength, disabled } = props; + const { + onChange, CDN_HOST, getFormat, setFormat, data, maxLength, disabled, + } = props; const selfProps = antiAssign(props, ['onChange', 'CDN_HOST', 'data']); const getFormatFileList = (fileList = []) => { if (!fileList) { @@ -106,7 +108,7 @@ const UploadCom = (props) => { const previewFile = (file) => { return new Promise((res, rej) => { const obj = checkoutFileType(file.name); - const typeArr = file.name.match(/\.[a-zA-Z]+$/); + const typeArr = file.name.match(/\.[a-zA-Z0-9]+$/); const type = typeArr && typeArr[0] ? typeArr[0].replace('.', '') : ''; if (!['png', 'gif', 'bmp', 'jpg', 'jpeg'].includes(type)) { res(obj.thumbUrl); @@ -125,6 +127,8 @@ const UploadCom = (props) => { onSaveFileList(newFileList); }; + const onDownload = (file) => {}; + const beforeUpload = async () => { await getToken(); return true; @@ -144,6 +148,7 @@ const UploadCom = (props) => { onRemove={onRemove} previewFile={previewFile} onPreview={onPreview} + onDownload={onDownload} showUploadList={{ showPreviewIcon: true, showRemoveIcon: true, -- 2.21.0