[update] 企标,搜索中心,企标预览增加判断是否是onlyOffice生成的,是的话预览onlyOffice生成的pdf文件
This commit is contained in:
@@ -299,6 +299,12 @@ export default {
|
|||||||
if (!file || !file.url) {
|
if (!file || !file.url) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (file.pdf_id) {
|
||||||
|
// 说明是onlyOffice生成的
|
||||||
|
const url = previewPdf(file.pdf_id)
|
||||||
|
window.open(url)
|
||||||
|
return
|
||||||
|
}
|
||||||
// 截取文件后缀名
|
// 截取文件后缀名
|
||||||
const fileSuffix = (file.name ? file.name.split('.')[file.name.split('.').length - 1] : '').toLowerCase()
|
const fileSuffix = (file.name ? file.name.split('.')[file.name.split('.').length - 1] : '').toLowerCase()
|
||||||
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
|
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
|
||||||
|
|||||||
@@ -394,6 +394,14 @@ export default {
|
|||||||
}
|
}
|
||||||
console.log('seletedFile', file)
|
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}`
|
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
||||||
console.log(fileFullUrl)
|
console.log(fileFullUrl)
|
||||||
@@ -410,7 +418,10 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async selectNewestFile (fileList) {
|
async selectNewestFile (fileList) {
|
||||||
if (!fileList || fileList.length === 0) return null
|
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 = []
|
const newFileList = []
|
||||||
// 获取时间信息
|
// 获取时间信息
|
||||||
for (const file of fileList) {
|
for (const file of fileList) {
|
||||||
|
|||||||
@@ -618,6 +618,14 @@ export default {
|
|||||||
}
|
}
|
||||||
console.log('seletedFile', file)
|
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}`
|
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
||||||
console.log(fileFullUrl)
|
console.log(fileFullUrl)
|
||||||
@@ -634,7 +642,10 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async selectNewestFile (fileList) {
|
async selectNewestFile (fileList) {
|
||||||
if (!fileList || fileList.length === 0) return null
|
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 = []
|
const newFileList = []
|
||||||
// 获取时间信息
|
// 获取时间信息
|
||||||
for (const file of fileList) {
|
for (const file of fileList) {
|
||||||
|
|||||||
@@ -828,6 +828,14 @@ export default {
|
|||||||
}
|
}
|
||||||
console.log('seletedFile', file)
|
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}`
|
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
||||||
console.log(fileFullUrl)
|
console.log(fileFullUrl)
|
||||||
@@ -844,7 +852,10 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async selectNewestFile (fileList) {
|
async selectNewestFile (fileList) {
|
||||||
if (!fileList || fileList.length === 0) return null
|
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 = []
|
const newFileList = []
|
||||||
// 获取时间信息
|
// 获取时间信息
|
||||||
for (const file of fileList) {
|
for (const file of fileList) {
|
||||||
|
|||||||
@@ -287,6 +287,12 @@ export default {
|
|||||||
if (!file || !file.url) {
|
if (!file || !file.url) {
|
||||||
return
|
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 fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : ''
|
||||||
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
|
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
|
||||||
|
|||||||
Reference in New Issue
Block a user