update kkFile预览修改

This commit is contained in:
赵霄
2023-10-11 16:05:04 +08:00
parent 0ea26a3272
commit 8b40a6a6d7
10 changed files with 32 additions and 22 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ window._CONFIG["staticDomainURL"] = window._CONFIG["domianURL"] + "/sys/common/d
window._CONFIG["pdfDomainURL"] = window._CONFIG["domianURL"] + "/sys/common/pdf/pdfPreviewIframe";
window._CONFIG["casPrefixUrl"] = "http://cas.example.org:8443/cas";
// 预览文件地址
window._CONFIG["onlinePreviewDomainURL"] = "http://cwp.catarc.org.cn:8092/onlinePreview";
window._CONFIG["onlinePreviewDomainURL"] = "http://cwp.catarc.org.cn:8092/perview/onlinePreview";
// 会议报名页面-报名二维码网址 -生成小程序二维码使用
window._CONFIG['singUpQRCodeURL'] = 'https://cwp.catarc.org.cn/signupentrance'
+3 -1
View File
@@ -22,6 +22,8 @@ const emailCheck = (params) => getAction('/sys/user/emailCheck', params)
const getMemberBaseInfo = (param) => incomeGetAction('/company/payContactsManagement/baseInfo', param)
// pdf预览网址
// eslint-disable-next-line
const Base64 = require('js-base64').Base64
const previewPdf = (file) => {
// const url = `${window._CONFIG['memberURL']}/sys/common/static/${id}?type=view&${TokenKey}=${Vue.ls.get(ACCESS_TOKEN)}`
// return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf'
@@ -31,7 +33,7 @@ const previewPdf = (file) => {
const fileFullUrl = `${window._CONFIG['memberDomianWebSocketURL']}/sys/common/static/${file.id}?type=view&token=${token}&fullfilename=${fileName}`
console.log(fileFullUrl, '$$$$$$$$')
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
return url
}
+5 -2
View File
@@ -56,6 +56,9 @@ const columns = [
scopedSlots: { customRender: 'action' }
}
]
// eslint-disable-next-line
const Base64 = require('js-base64').Base64
export default {
name: 'FileList',
props: {
@@ -92,7 +95,7 @@ export default {
preview(record) {
if (record && record.fileId) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ record.fileId }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ record.fileName }&type=view`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -103,4 +106,4 @@ export default {
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
</style>
+2 -2
View File
@@ -35,7 +35,7 @@
import { getFileAccessHttpUrl } from '@/api/manage'
import {getFileInfo} from '@api/api'
// eslint-disable-next-line
// const Base64 = require('js-base64').Base64
const Base64 = require('js-base64').Base64
const uidGenerator=()=>{
return '-'+parseInt(Math.random()*10000+1,10)
@@ -229,7 +229,7 @@
// &fullfilename=${file.name}
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
},
+3 -3
View File
@@ -20,7 +20,7 @@ import {getFileInfo} from '@/api/api'
import {downloadFile} from '@api/manage'
import JEllipsis from '@comp/jero/JEllipsis'
// eslint-disable-next-line
// const Base64 = require('js-base64').Base64
const Base64 = require('js-base64').Base64
export default {
@@ -106,7 +106,7 @@ export default {
handlePreview(file) {
if (file && file.id) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}&type=view`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -150,4 +150,4 @@ export default {
}
}
}
</style>
</style>
+3 -3
View File
@@ -56,7 +56,7 @@ import {getFileAccessHttpUrl, downloadFile} from '@/api/manage'
import {getFileInfo} from '@/api/api'
// eslint-disable-next-line no-undef
// const Base64 = require('js-base64').Base64
const Base64 = require('js-base64').Base64
const FILE_TYPE_ALL = 'all'
const FILE_TYPE_IMG = 'image'
@@ -384,7 +384,7 @@ export default {
// eslint-disable-next-line no-unreachable
if (file && file.url) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -438,7 +438,7 @@ export default {
myPreview(file) {
if (file && file.url) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -56,7 +56,7 @@ import {getFileAccessHttpUrl, downloadFile} from '@/api/memberManage'
import {getFilesByIds} from '@/api/standardsAssociationApi'
// eslint-disable-next-line no-undef
// const Base64 = require('js-base64').Base64
const Base64 = require('js-base64').Base64
const FILE_TYPE_ALL = 'all'
const FILE_TYPE_IMG = 'image'
@@ -385,7 +385,7 @@ export default {
// eslint-disable-next-line no-unreachable
if (file && file.url) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -440,7 +440,7 @@ export default {
myPreview(file) {
if (file && file.url) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/static/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
+3 -1
View File
@@ -45,6 +45,8 @@ const columns = [
width: 100
}
]
// eslint-disable-next-line
const Base64 = require('js-base64').Base64
export default {
name: 'FileTable',
@@ -137,7 +139,7 @@ export default {
handlePreview(file) {
if (file && file.id) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}&type=view`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -50,6 +50,9 @@ import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { processingTimestamp } from '@/utils/util'
// eslint-disable-next-line
const Base64 = require('js-base64').Base64
export default {
name: 'UnderStudyFilesModal',
props: {
@@ -99,13 +102,13 @@ export default {
if (this.isCommittee) {
if (record && record.FILE_ID) {
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/payResearchProject/payResearchProject/download/?fileId=${record.FILE_ID}&token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.FILE_NAME}`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
window.open(url)
}
} else {
if (record && record.fileId) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ record.fileId }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ record.fileName }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
window.open(url)
}
}
@@ -120,4 +123,4 @@ export default {
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
</style>
@@ -43,7 +43,7 @@ import { getFileInfo } from '@api/api'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
// eslint-disable-next-line
// const Base64 = require('js-base64').Base64
const Base64 = require('js-base64').Base64
export default {
name: 'SubBidCommitteeDetail',
@@ -129,7 +129,7 @@ export default {
if (file && file.id) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ file.id }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ file.name }`
// let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
window.open(url)
}
@@ -157,4 +157,4 @@ h3.title::before {
color: #069f99;
cursor: pointer;
}
</style>
</style>