修改 xls文件无法预览问题

This commit is contained in:
GGJ
2024-10-15 10:39:28 +08:00
parent 7062305c01
commit 9404412823
7 changed files with 37 additions and 15 deletions

View File

@@ -21,7 +21,7 @@
:style="`height: calc(${height.height} - 60px);`" />
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url" />
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url" :options="excelOptions"/>
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
<img v-if="
@@ -59,6 +59,7 @@ const adminInfo = useAdminInfo()
defineOptions({
name: 'database/standard'
})
const excelOptions=ref({})
const monitoringPoint = useMonitoringPoint()
const height = mainHeight(20)
const size = ref(0)
@@ -84,6 +85,7 @@ const handleNodeClick = (data: any, node: any) => {
setTimeout(() => {
url.value = `/api-docx/excelreport` + data.url
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
// url.value = res.data.url
// })