[update] 企标,搜索中心,企标预览增加判断是否是onlyOffice生成的,是的话预览onlyOffice生成的pdf文件

This commit is contained in:
lideqin
2024-04-25 15:06:56 +08:00
parent 386b99a97b
commit 5d2d82e935
5 changed files with 48 additions and 3 deletions
@@ -828,6 +828,14 @@ export default {
}
console.log('seletedFile', file)
// 是onlyOffice生成的,预览关联的pdf文件
if (file.pdf_id) {
// 说明是onlyOffice生成的
const url = previewPdf(file.pdf_id)
window.open(url)
return
}
// 预览选择的文件
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
console.log(fileFullUrl)
@@ -844,7 +852,10 @@ export default {
*/
async selectNewestFile (fileList) {
if (!fileList || fileList.length === 0) return null
if (fileList.length === 1) return fileList[0]
if (fileList.length === 1) {
const res = await getFileInfo(fileList[0])
return { ...fileList[0], ...res.result }
}
const newFileList = []
// 获取时间信息
for (const file of fileList) {
@@ -287,6 +287,12 @@ export default {
if (!file || !file.url) {
return
}
if (file.pdf_id) {
// 说明是onlyOffice生成的
const url = previewPdf(file.pdf_id)
window.open(url)
return
}
// 截取文件后缀名
const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : ''
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)