diff --git a/components/apolloTable/component/base/extra/upload/index.tsx b/components/apolloTable/component/base/extra/upload/index.tsx index 1713a0af5f208a9eaa899eea7faeaa7170db1d69..9c9c6853ff17764741aa6f74d0ce8e49596d118d 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,