|
@@ -15,9 +15,9 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
loading: {
|
|
|
- editor: false,
|
|
|
- save: false,
|
|
|
- forceSave: false
|
|
|
+ editor: true,
|
|
|
+ save: true,
|
|
|
+ forceSave: true
|
|
|
},
|
|
|
// 支持的word编辑器的类型
|
|
|
supportWordFile:['doc', 'docm', 'docx', 'dot', 'dotm', 'dotx', 'epub', 'fb2', 'fodt', 'htm', 'html', 'mht', 'mhtml', 'odt', 'ott', 'rtf', 'stw', 'sxw', 'txt', 'wps', 'wpt', 'xml'],
|
|
@@ -38,6 +38,7 @@ export default {
|
|
|
documentType: null,
|
|
|
// 文档配置
|
|
|
document: {
|
|
|
+ key: null,
|
|
|
// 文件类型
|
|
|
fileType: null,
|
|
|
// 文档url地址
|
|
@@ -46,13 +47,17 @@ export default {
|
|
|
title: null,
|
|
|
// 文档权限配置
|
|
|
permissions: {
|
|
|
- edit: false, //文件是否可以编辑,false时文件不可编辑
|
|
|
+ edit: true, //文件是否可以编辑,false时文件不可编辑
|
|
|
}
|
|
|
},
|
|
|
//编辑配置
|
|
|
editorConfig: {
|
|
|
//文档操作模式 view 视图模式不可编辑 edit 编辑模式可编辑文档
|
|
|
- mode: 'view'
|
|
|
+ mode: 'edit',
|
|
|
+ // 回调地址
|
|
|
+ callbackUrl: 'http://mbs.scdayou.com/api/onlyoffice/callback',
|
|
|
+ // 设置语言
|
|
|
+ lang: 'zh-CN',
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -65,7 +70,7 @@ export default {
|
|
|
setConfigInfo() {
|
|
|
this.editorConfig.document.title = this.$route.query.title;
|
|
|
this.editorConfig.document.url = process.env.VUE_APP_API_SERVER + this.$route.query.url;
|
|
|
-
|
|
|
+ this.editorConfig.editorConfig.callbackUrl = "http://mbs.scdayou.com/api/onlyoffice/callback?originPath=/opt"+this.$route.query.url;
|
|
|
const lastIndex = this.$route.query.title.lastIndexOf('.');
|
|
|
this.editorConfig.document.fileType = lastIndex !== -1 ? this.$route.query.title.substring(lastIndex + 1) : null;
|
|
|
if (this.supportWordFile.includes(this.editorConfig.document.fileType)) {
|
|
@@ -82,6 +87,7 @@ export default {
|
|
|
// this.editorConfig.documentType = "pdf";
|
|
|
this.editorConfig.documentType = "word";
|
|
|
}
|
|
|
+ console.log(this.editorConfig.editorConfig.callbackUrl)
|
|
|
}
|
|
|
}
|
|
|
}
|