diff --git a/components/apolloTable/component/base/extra/upload/index.tsx b/components/apolloTable/component/base/extra/upload/index.tsx index 9c9c6853ff17764741aa6f74d0ce8e49596d118d..2b8e1b9acdba7594cf93843216ac621eff6ca0d6 100644 --- a/components/apolloTable/component/base/extra/upload/index.tsx +++ b/components/apolloTable/component/base/extra/upload/index.tsx @@ -110,7 +110,7 @@ const UploadCom = (props) => { const obj = checkoutFileType(file.name); 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)) { + if (!['png', 'gif', 'bmp', 'jpg', 'jpeg', 'heic'].includes(type)) { res(obj.thumbUrl); } }); diff --git a/components/apolloTable/component/base/extra/upload/preview.tsx b/components/apolloTable/component/base/extra/upload/preview.tsx index 3f4fa4ced81f7b4b07149556e05325877a187066..0b2c885dba2c7c1e01a2e72f688bd5c46e6edb7d 100644 --- a/components/apolloTable/component/base/extra/upload/preview.tsx +++ b/components/apolloTable/component/base/extra/upload/preview.tsx @@ -10,14 +10,12 @@ export default class uploadDetail extends React.Component { }; onPreview = (url:string, name:string) => { - console.log('name: ', name); - console.log('url: ', url); const nameTypeArr = name.match(/\.[a-zA-Z0-9]+$/); const urlTypeArr = url.match(/\.[a-zA-Z0-9]+$/); const typeArr = nameTypeArr || urlTypeArr; let type = typeArr && typeArr[0] ? typeArr[0].replace('.', '') : ''; type = type.toLowerCase(); - if (['png', 'gif', 'bmp', 'jpg', 'jpeg'].includes(type)) { + if (['png', 'gif', 'bmp', 'jpg', 'jpeg', 'heic'].includes(type)) { this.setState({ showDialog: true, type: 'image', url }); } else if (['doc', 'docx', 'document', 'xls', 'xlsx', 'ppt', 'pptx'].includes(type)) { this.setState({ showDialog: true, type: 'office', url }); diff --git a/components/apolloTable/component/base/extra/upload/utils.ts b/components/apolloTable/component/base/extra/upload/utils.ts index 8cc0d0f376c9cecc339ff325a97e749f57dae60d..5fd02e4e6da3afa869682006f684a116a3134d0c 100644 --- a/components/apolloTable/component/base/extra/upload/utils.ts +++ b/components/apolloTable/component/base/extra/upload/utils.ts @@ -4,7 +4,7 @@ export const checkoutFileType = (url = '') => { const typeArr = url.match(/\.[a-zA-Z0-9]+$/); let type = typeArr && typeArr[0] ? typeArr[0].replace('.', '') : ''; type = type.toLowerCase(); - if (type === 'png' || type === 'jpg' || type === 'gif' || type === 'bmp' || type === 'jpeg') { + if (type === 'png' || type === 'jpg' || type === 'gif' || type === 'bmp' || type === 'jpeg' || type === 'heic') { return { thumbUrl: `${url}?imageView2/1/w/120/h/120`, fileType: type }; } return fileType[type] ? fileType[type] : fileType.other;