[update] 修改在线编辑的查看
This commit is contained in:
+12
-2
@@ -55,6 +55,8 @@ import CommentModal from './CommentModal'
|
||||
import Vue from 'vue'
|
||||
import { kkFilePreview } from '@/utils/kkFilePreview'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { queryFileInfoByEditId } from '../../../../api/workCenter'
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
export default {
|
||||
name: 'CommentObjectEnterBaseInfo',
|
||||
@@ -121,6 +123,7 @@ export default {
|
||||
}
|
||||
],
|
||||
dataSource: [],
|
||||
documentUrl: window._CONFIG.documentUrl,
|
||||
onEditFile: '' // 在线编辑的文件id
|
||||
}
|
||||
},
|
||||
@@ -207,8 +210,15 @@ export default {
|
||||
},
|
||||
// 在线编辑的查看
|
||||
onlineEditView () {
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${this.onEditFile}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${this.onEditFile_dictText}`
|
||||
kkFilePreview(fileFullUrl)
|
||||
queryFileInfoByEditId({ id: this.onEditFile }).then(res => {
|
||||
if (res.success) {
|
||||
const file = res.result
|
||||
const filePaths = file.filePath.split('/')
|
||||
const fileName = filePaths[filePaths.length - 1]
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(this.documentUrl + file.filePath + '&fullfilename=' + fileName))}`
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user