修改部分预览,数据完整性,暂态列表等bug调整

This commit is contained in:
sjl
2025-12-24 10:41:04 +08:00
parent a52021572a
commit dbb6a9f72b
10 changed files with 100 additions and 38 deletions

View File

@@ -20,13 +20,13 @@
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
: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-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.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>
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
<img v-if="
url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
" :src="url" />
</div>
</pane>
@@ -56,6 +56,7 @@ import VueOfficeExcel from '@vue-office/excel'
import VueOfficePdf from '@vue-office/pdf'
import { deleteyLibstandard } from '@/api/supervision-boot/database/index'
import { useAdminInfo } from '@/stores/adminInfo'
import {previewFile } from '@/utils/fileDownLoad'
const adminInfo = useAdminInfo()
defineOptions({
name: 'database/standard'
@@ -77,7 +78,7 @@ onMounted(() => {
}
})
const urlKey=ref('')
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
const handleNodeClick = (data: any, node: any) => {
console.log("🚀 ~ handleNodeClick ~ data:", data)
@@ -86,13 +87,14 @@ const handleNodeClick = (data: any, node: any) => {
flag.value = false
if (data?.url != null && data?.url != '') {
flag.value = true
setTimeout(() => {
urlKey.value = data.url
setTimeout(async () => {
if(VITE_FLAG){
url.value = `/api-docx/excelreport` + data.url
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
}else{
const previewUrl = await previewFile(data.url);
url.value = previewUrl;
}
// getFileNameAndFilePath({ filePath: data.url }).then(res => {

View File

@@ -36,7 +36,7 @@ defineOptions({
})
const information = adminInfo.roleCode.includes('information_info')
const popupEditRef = ref()
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
const TableHeaderRef = ref()
const tableStore = new TableStore({
@@ -59,6 +59,9 @@ const tableStore = new TableStore({
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
disabled: row => {
return !VITE_FLAG
},
click: row => {
window.open(window.location.origin + '/#/previewFile?' + row.url)
}