预览word
This commit is contained in:
@@ -168,6 +168,7 @@
|
||||
import { getAction, postAction, downloadFile } from '@/api/manage'
|
||||
import libraryPush from '@/components/libraryPush/index'
|
||||
import moment from 'moment'
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
export default {
|
||||
name: 'DocumentLibrary',
|
||||
@@ -288,7 +289,7 @@
|
||||
loading: false,
|
||||
selectModel: '',
|
||||
fileList: [],
|
||||
downLoadFileUrl: window._CONFIG['domianURL'] + '/sys/common/download',
|
||||
downLoadFileUrl: window._CONFIG['domianURL'] + '/sys/common/download'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -469,10 +470,10 @@
|
||||
if (fileSuffix == '.pdf') {
|
||||
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id))
|
||||
} else if (fileSuffix == '.docx') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '?id=' + fileQuery.id)
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(this.downLoadFileUrl + '?id=' + fileQuery.id)
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else {
|
||||
downloadFile('/sys/common/download', fileQuery.fileName, { id: fileQuery.id })
|
||||
|
||||
Reference in New Issue
Block a user