Commit 36c79ec8 authored by 田翔's avatar 田翔

fix: 支持xls格式

parent 6db57b86
{
"name": "panda-xform",
"version": "5.1.9",
"description": "5.1.9 excel表格预览优化",
"version": "5.2.0",
"description": "5.2.0 支持xls格式",
"keywords": [
"panda-xform"
],
......
......@@ -36,6 +36,9 @@ const getFileType = (fileName) => {
if (fileName.includes('docx')) {
return 'docx'
}
if (fileName.includes('xls')) {
return 'xls'
}
if (fileName.includes('xlsx')) {
return 'xlsx'
}
......@@ -124,7 +127,7 @@ const FileUpload = (props) => {
if (!preview) return message.info('该附件禁止预览')
let fileType = getFileType(file.name)
if (fileType) {
if (fileType === 'xlsx') {
if (['xlsx', 'xls'].includes(fileType)) {
downloadFile(file.sourcePath)
.then(response => response.arrayBuffer())
.then(buffer => {
......@@ -154,7 +157,7 @@ const FileUpload = (props) => {
<img style={{ maxWidth: '100%', maxHeight: '100%' }} src={window.location.origin + showFile.filePath}></img>
</div>
)
} else if (['xlsx'.includes(showFile.fileType)]) {
} else if (['xlsx', 'xls'].includes(showFile.fileType)) {
return (
<div>
<Tabs>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment