add kkFile预览;十个版本的回滚

This commit is contained in:
赵霄
2024-01-24 10:29:38 +08:00
parent 620ef5b5cb
commit 3e38a7ae18
6 changed files with 21711 additions and 13 deletions
+12854
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -12,6 +12,7 @@
"axios": "^1.5.0",
"babel-plugin-import": "^1.13.8",
"core-js": "^3.6.5",
"js-base64": "^3.7.6",
"less": "3.9.0",
"less-loader": "4.1.0",
"vue": "^2.6.11",
+2
View File
@@ -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/'
// onlyOffice自定义编辑器的地址(plugins的前端路径,最后一个/是必须的)
window._CONFIG.configUrl = 'http://10.0.1.19:8082/'
// 预览文件地址
window._CONFIG.onlinePreviewDomainURL = 'http://127.0.0.1:8012/onlinePreview'
+3 -1
View File
@@ -3,9 +3,11 @@ import { getAction, postAction } from './manage.js'
const addFile = (params) => getAction('/onlyOffice/saveEditFile', params)
const getList = (params) => getAction('/onlyOffice/pageList', params)
const deleteFile = (params) => postAction('/onlyOffice/delete', params)
const historyList = (params) => getAction('/onlyOffice/getAllOnlyOfficeHisFileById', params)
export {
addFile,
getList,
deleteFile
deleteFile,
historyList
}
+20 -12
View File
@@ -21,6 +21,9 @@
<script>
import { historyList } from '../api/fileApi'
import { Base64 } from 'js-base64'
let docEditor
const { location } = window
@@ -154,8 +157,8 @@ export default {
let url = ''
let key = ''
if (fileInfo.id) {
url = this.documentUrl + fileInfo.id
key = fileInfo.id + nowTime
url = this.documentUrl + fileInfo.filePath
key = this.$route.query.key + nowTime
} else {
url = `${this.documentUrl}${this.$route.query.filePath}`
key = this.$route.query.key + nowTime
@@ -271,6 +274,14 @@ export default {
*/
handleRestore () {
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
*/
viewFileClick (file) {
const { fileName, userId, userName } = this.$route.query
const { href } = this.$router.resolve({
path: '/previewPage',
query: {
fileName, userId, userName
}
})
window.open(href, '_blank')
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(this.documentUrl + file.filePath + '&fullfilename=' + this.$route.query.fileName))}`
window.open(url, '_blank')
},
/**
* 确定回滚到某个版本
*/
fileContentClick () {
fileContentClick (file) {
console.log('回归')
this.docEditor.destroyEditor()
this.connectEditor(file)
this.isFileDisplay = false
}
},
beforeDestroy () {
+8831
View File
File diff suppressed because it is too large Load Diff