|
@@ -155,7 +155,7 @@ import mixins from './index.js'
|
|
|
review: true, //跟踪变化
|
|
|
comment:true,//是否可以注释文档
|
|
|
copy:true,
|
|
|
- chat: false,
|
|
|
+ chat: true,
|
|
|
},
|
|
|
url: option.url,
|
|
|
},
|
|
@@ -168,7 +168,7 @@ import mixins from './index.js'
|
|
|
customization: {
|
|
|
comments:true,
|
|
|
about:false,
|
|
|
- autosave: true,//是否自动保存
|
|
|
+ autosave: false,//是否自动保存
|
|
|
forcesave:true,
|
|
|
|
|
|
help: false,
|
|
@@ -202,6 +202,7 @@ import mixins from './index.js'
|
|
|
onRequestHistoryData:this.onRequestHistoryData,//获取历史文件
|
|
|
onRequestRestore:this.onRequestRestore,//恢复
|
|
|
onRequestHistoryClose:this.onRequestHistoryClose,//关闭历史
|
|
|
+ onDocumentStateChange:this.onDocumentStateChange,
|
|
|
},
|
|
|
width: '100%',
|
|
|
height: '100%',
|
|
@@ -252,13 +253,14 @@ import mixins from './index.js'
|
|
|
return
|
|
|
}
|
|
|
var currentVersion = this.currentVersion.currentVersion
|
|
|
+ this.option.version = currentVersion
|
|
|
var history = []
|
|
|
for(var i = 0;i<that.historyData.length;i++){
|
|
|
var item = that.historyData[i]
|
|
|
history.push(
|
|
|
{
|
|
|
serverVersion:item.serverVersion,
|
|
|
- changes:item.changes,
|
|
|
+ // changes:item.changes,
|
|
|
created:item.created,
|
|
|
user:item.user,
|
|
|
version:item.version,
|
|
@@ -292,12 +294,12 @@ import mixins from './index.js'
|
|
|
key:obj.key,
|
|
|
url:this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' +obj.url,
|
|
|
version:obj.version,
|
|
|
- previous:obj1?{
|
|
|
- fileType:obj1.fileType,
|
|
|
- key:obj1.key,
|
|
|
- url:this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' +obj1.url,
|
|
|
- }:null,
|
|
|
- changesUrl:obj.changesUrl?(this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' +obj.changesUrl):""
|
|
|
+ // previous:obj1?{
|
|
|
+ // fileType:obj1.fileType,
|
|
|
+ // key:obj1.key,
|
|
|
+ // url:this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' +obj1.url,
|
|
|
+ // }:null,
|
|
|
+ // changesUrl:obj.changesUrl?(this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' +obj.changesUrl):""
|
|
|
}
|
|
|
var params = {
|
|
|
jsons:JSON.stringify(obj2)
|
|
@@ -314,19 +316,31 @@ import mixins from './index.js'
|
|
|
this.docEditor.setHistoryData(obj2)
|
|
|
}
|
|
|
},
|
|
|
+ //恢复
|
|
|
onRequestRestore(event){
|
|
|
- console.log(event)
|
|
|
- const fileType = event.data.fileType
|
|
|
- const url = event.data.url
|
|
|
const version = event.data.version
|
|
|
- return
|
|
|
- this.$api.restoreVersion().then(response=>{
|
|
|
-
|
|
|
+ var params = {
|
|
|
+ userId:this.option.user.id,
|
|
|
+ userName:this.option.user.name,
|
|
|
+ restoreVersion:version,
|
|
|
+ previousVersion:this.option.version,
|
|
|
+ guid:this.option.id
|
|
|
+ }
|
|
|
+ this.$api.restoreVersion(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.setEditor(this.option)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
onRequestHistoryClose(event){
|
|
|
this.setEditor(this.option)
|
|
|
},
|
|
|
+ onDocumentStateChange(event){
|
|
|
+ if(this.option.isSave){
|
|
|
+ this.option.isSave = false
|
|
|
+ this.$emit('reLoadQuery',this.option)
|
|
|
+ }
|
|
|
+ },
|
|
|
getFileType(fileType) {
|
|
|
let docType = ''
|
|
|
let fileTypesDoc = [
|