|
@@ -1,67 +1,108 @@
|
|
|
<template>
|
|
|
- <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
|
|
|
- </myUpload>
|
|
|
- <!-- <DocumentEditor id="docEditor" documentServerUrl="http://documentserver/" :config="config" /> -->
|
|
|
+ <div>
|
|
|
+ <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
|
|
|
+ </myUpload>
|
|
|
+ <div id="DocEditor">
|
|
|
+ <onlyoffice-editor editorId="DocEditor" :src="src" :config="config" @ready="onReady" />
|
|
|
+ <!-- <DocumentEditor id="docEditor" :documentServerUrl="src" :config="config"/> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { DocumentEditor } from "@onlyoffice/document-editor-vue";
|
|
|
+// import { onlyofficeEditor } from "@onlyoffice/document-editor-vue"
|
|
|
import myUpload from '../../../components/upload'
|
|
|
export default {
|
|
|
name: 'ExampleComponent',
|
|
|
components: {
|
|
|
DocumentEditor,
|
|
|
- myUpload
|
|
|
+ myUpload,
|
|
|
+ // DocumentEditor
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
+ let _this = this;
|
|
|
return {
|
|
|
+
|
|
|
+ url: '',
|
|
|
+
|
|
|
+ src: 'http://192.168.2.221:7778/web-apps/apps/api/documents/api.js',
|
|
|
+
|
|
|
config: {
|
|
|
|
|
|
- },
|
|
|
- configs: {
|
|
|
+ documentType: 'cell',
|
|
|
document: {
|
|
|
- fileType: "docx",
|
|
|
- key: "Khirz6zTPdfd7",
|
|
|
- title: "Example Document Title.docx",
|
|
|
- url: "https://example.com/url-to-example-document.docx"
|
|
|
+ fileType: "xlsx",
|
|
|
+ key: "e07e63993f3aaa920cbed74d8fc15794",
|
|
|
+ title: "后评估模板.xlsx",
|
|
|
+ url: "http://192.168.2.124:7779/api/file/download?id=e07e63993f3aaa920cbed74d8fc15794"
|
|
|
},
|
|
|
- documentType: "word",
|
|
|
+
|
|
|
editorConfig: {
|
|
|
- callbackUrl: "https://example.com/url-to-callback.ashx"
|
|
|
+ user: {
|
|
|
+ id: "78e1e841",
|
|
|
+ name: "范岩"
|
|
|
+ },
|
|
|
+ callbackUrl: "http://192.168.2.124:7779/api/online/callback?type=callback&fileName=安装mysql-udf-http.docx&userIdfanyan&userName=范岩"
|
|
|
}
|
|
|
},
|
|
|
fileInfo: {
|
|
|
- limit: 10,
|
|
|
- url: '/aps/api/file/upload',
|
|
|
- fileList: []
|
|
|
- },
|
|
|
+ limit: 10,
|
|
|
+ url: '/aps/api/file/upload',
|
|
|
+ fileList: []
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.getList()
|
|
|
- },
|
|
|
+ mounted() {
|
|
|
+ this.getList()
|
|
|
+ this.getLists()
|
|
|
+ },
|
|
|
methods: {
|
|
|
getList() {
|
|
|
this.$http({
|
|
|
- url: "/aps/restEdit",
|
|
|
+ url: "/aps/api/restfile/edit",
|
|
|
+ method: "post",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ id: '647f6c6cff4d05f18d1fbcc89769d5fb',
|
|
|
+ edit: true,
|
|
|
+ userId: 'fanyan',
|
|
|
+ userName: '范岩'
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ let url = 'http://192.168.2.124:7779/api/online/callback?type=callback&fileName=%E5%AE%89%E8%A3%85mysql-udf-http.docx&userIdfanyan&userName=%E8%8C%83%E5%B2%A9'
|
|
|
+ let urls = decodeURIComponent(url)
|
|
|
+ // console.log(123);
|
|
|
+ console.log(urls);
|
|
|
+ // this.config.document.url = urls;
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getLists() {
|
|
|
+ this.$http({
|
|
|
+ url: "/aps/api/restfile/list",
|
|
|
method: "post",
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
},
|
|
|
data: {
|
|
|
- edit:true,
|
|
|
- userId:'fanyan',
|
|
|
- userName:'范岩'
|
|
|
+
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
console.log(res);
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
- onDocumentReady() {
|
|
|
- console.log("Document is loaded");
|
|
|
+ onReady(editor) {
|
|
|
+ console.log('[ editor ] >', editor)
|
|
|
},
|
|
|
- uploadBack(){
|
|
|
+ uploadBack() {
|
|
|
|
|
|
}
|
|
|
},
|