From 5f674a2f456f1d9a6f1353a6e37f9f2e172db54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Fri, 19 Apr 2024 18:04:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A2=84=E8=A7=88=E6=94=B9=E4=B8=BAon?= =?UTF-8?q?lyOffice=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/dev_api_config.js | 2 - public/prod_api_config.js | 2 - src/router/index.js | 5 + src/views/EditorPage.vue | 9 +- src/views/PreviewHistoryPage.vue | 205 +++++++++++++++++++++++++++++++ 5 files changed, 215 insertions(+), 8 deletions(-) create mode 100644 src/views/PreviewHistoryPage.vue diff --git a/public/dev_api_config.js b/public/dev_api_config.js index 7ccaa2e..bf1401f 100644 --- a/public/dev_api_config.js +++ b/public/dev_api_config.js @@ -5,5 +5,3 @@ 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' diff --git a/public/prod_api_config.js b/public/prod_api_config.js index 089b346..33f7efb 100644 --- a/public/prod_api_config.js +++ b/public/prod_api_config.js @@ -5,5 +5,3 @@ window._CONFIG.documentUrl = 'http://laws-sinotruk-server-kmc2c.yf-grp:8080/laws window._CONFIG.callbackUrl = 'http://laws-sinotruk-server-kmc2c.yf-grp:8080/' // onlyOffice自定义编辑器的地址(plugins的前端路径,最后一个/是必须的) window._CONFIG.configUrl = 'http://srms-test.sinotruk.com/onlyofficeplugins/' -// 预览文件地址 -window._CONFIG.onlinePreviewDomainURL = 'http://srms-test.sinotruk.com/kkfileview/onlinePreview' diff --git a/src/router/index.js b/src/router/index.js index 29ce94b..364389c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -32,6 +32,11 @@ const routes = [ // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. component: () => import('../views/EditorPage.vue') + }, + { + path: '/previewHistoryPage', + name: 'PreviewHistoryPage', + component: () => import('../views/PreviewHistoryPage') } ] diff --git a/src/views/EditorPage.vue b/src/views/EditorPage.vue index 99091c3..2719a9f 100644 --- a/src/views/EditorPage.vue +++ b/src/views/EditorPage.vue @@ -300,10 +300,11 @@ export default { * @param file */ viewFileClick (file) { - const filePaths = file.filePath.split('/') - const fileName = filePaths[filePaths.length - 1] - const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(this.documentUrl + file.filePath + '&fullfilename=' + fileName))}` - window.open(url, '_blank') + const { href } = this.$router.resolve({ + path: '/previewHistoryPage', + query: this.$route.query + }) + window.open(href, '_blank') }, /** * 确定回滚到某个版本 diff --git a/src/views/PreviewHistoryPage.vue b/src/views/PreviewHistoryPage.vue new file mode 100644 index 0000000..53a3d91 --- /dev/null +++ b/src/views/PreviewHistoryPage.vue @@ -0,0 +1,205 @@ + + + + +