add kkFile预览;十个版本的回滚
This commit is contained in:
Generated
+12854
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@
|
|||||||
"axios": "^1.5.0",
|
"axios": "^1.5.0",
|
||||||
"babel-plugin-import": "^1.13.8",
|
"babel-plugin-import": "^1.13.8",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
|
"js-base64": "^3.7.6",
|
||||||
"less": "3.9.0",
|
"less": "3.9.0",
|
||||||
"less-loader": "4.1.0",
|
"less-loader": "4.1.0",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
|
|||||||
@@ -5,3 +5,5 @@ window._CONFIG.documentUrl = 'http://10.0.1.19:8184/laws-sinotruk/onlyOffice/dow
|
|||||||
window._CONFIG.callbackUrl = 'http://10.0.1.19:8184/'
|
window._CONFIG.callbackUrl = 'http://10.0.1.19:8184/'
|
||||||
// onlyOffice自定义编辑器的地址(plugins的前端路径,最后一个/是必须的)
|
// onlyOffice自定义编辑器的地址(plugins的前端路径,最后一个/是必须的)
|
||||||
window._CONFIG.configUrl = 'http://10.0.1.19:8082/'
|
window._CONFIG.configUrl = 'http://10.0.1.19:8082/'
|
||||||
|
// 预览文件地址
|
||||||
|
window._CONFIG.onlinePreviewDomainURL = 'http://127.0.0.1:8012/onlinePreview'
|
||||||
|
|||||||
+3
-1
@@ -3,9 +3,11 @@ import { getAction, postAction } from './manage.js'
|
|||||||
const addFile = (params) => getAction('/onlyOffice/saveEditFile', params)
|
const addFile = (params) => getAction('/onlyOffice/saveEditFile', params)
|
||||||
const getList = (params) => getAction('/onlyOffice/pageList', params)
|
const getList = (params) => getAction('/onlyOffice/pageList', params)
|
||||||
const deleteFile = (params) => postAction('/onlyOffice/delete', params)
|
const deleteFile = (params) => postAction('/onlyOffice/delete', params)
|
||||||
|
const historyList = (params) => getAction('/onlyOffice/getAllOnlyOfficeHisFileById', params)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
addFile,
|
addFile,
|
||||||
getList,
|
getList,
|
||||||
deleteFile
|
deleteFile,
|
||||||
|
historyList
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-12
@@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import { historyList } from '../api/fileApi'
|
||||||
|
import { Base64 } from 'js-base64'
|
||||||
|
|
||||||
let docEditor
|
let docEditor
|
||||||
const { location } = window
|
const { location } = window
|
||||||
|
|
||||||
@@ -154,8 +157,8 @@ export default {
|
|||||||
let url = ''
|
let url = ''
|
||||||
let key = ''
|
let key = ''
|
||||||
if (fileInfo.id) {
|
if (fileInfo.id) {
|
||||||
url = this.documentUrl + fileInfo.id
|
url = this.documentUrl + fileInfo.filePath
|
||||||
key = fileInfo.id + nowTime
|
key = this.$route.query.key + nowTime
|
||||||
} else {
|
} else {
|
||||||
url = `${this.documentUrl}${this.$route.query.filePath}`
|
url = `${this.documentUrl}${this.$route.query.filePath}`
|
||||||
key = this.$route.query.key + nowTime
|
key = this.$route.query.key + nowTime
|
||||||
@@ -271,6 +274,14 @@ export default {
|
|||||||
*/
|
*/
|
||||||
handleRestore () {
|
handleRestore () {
|
||||||
this.isFileDisplay = true
|
this.isFileDisplay = true
|
||||||
|
this.initHistoryList()
|
||||||
|
},
|
||||||
|
initHistoryList () {
|
||||||
|
historyList({ fileId: this.$route.query.fileId }).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.fileList = res.result || []
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 关闭历史记录列表
|
* 关闭历史记录列表
|
||||||
@@ -283,20 +294,17 @@ export default {
|
|||||||
* @param file
|
* @param file
|
||||||
*/
|
*/
|
||||||
viewFileClick (file) {
|
viewFileClick (file) {
|
||||||
const { fileName, userId, userName } = this.$route.query
|
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(this.documentUrl + file.filePath + '&fullfilename=' + this.$route.query.fileName))}`
|
||||||
const { href } = this.$router.resolve({
|
window.open(url, '_blank')
|
||||||
path: '/previewPage',
|
|
||||||
query: {
|
|
||||||
fileName, userId, userName
|
|
||||||
}
|
|
||||||
})
|
|
||||||
window.open(href, '_blank')
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 确定回滚到某个版本
|
* 确定回滚到某个版本
|
||||||
*/
|
*/
|
||||||
fileContentClick () {
|
fileContentClick (file) {
|
||||||
|
console.log('回归')
|
||||||
|
this.docEditor.destroyEditor()
|
||||||
|
this.connectEditor(file)
|
||||||
|
this.isFileDisplay = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
|
|||||||
Reference in New Issue
Block a user