diff --git a/.env.development b/.env.development
index 1cd11a20..72dca223 100644
--- a/.env.development
+++ b/.env.development
@@ -5,7 +5,8 @@ NODE_ENV = 'development'
VUE_APP_BASE_PATH = '/'
VUE_APP_IS_TEST = false
-
+# onlyoffice地址
+VUE_APP_ONLYOFFICE_URL = "https://onlyoffice.test.extimaging.com"
# base api
VUE_APP_BASE_API = 'http://123.56.94.154:7000'
diff --git a/.env.prod b/.env.prod
index 2f8d7ea6..9e55b50c 100644
--- a/.env.prod
+++ b/.env.prod
@@ -5,6 +5,9 @@ NODE_ENV = 'prod'
# base public path
VUE_APP_BASE_PATH = '/'
+# onlyoffice地址
+VUE_APP_ONLYOFFICE_URL = "https://onlyoffice.test.extimaging.com"
+
# 是否开启登陆限制 true:是 false:否
VUE_APP_LOGIN_FOR_PERMISSION = true
diff --git a/.env.uat b/.env.uat
index b4586518..0d2a97e5 100644
--- a/.env.uat
+++ b/.env.uat
@@ -4,6 +4,9 @@ NODE_ENV = 'production'
# base public path
VUE_APP_BASE_PATH = '/'
+# onlyoffice地址
+VUE_APP_ONLYOFFICE_URL = "https://onlyoffice.test.extimaging.com"
+
# base public path
VUE_APP_BASE_PATH = '/'
diff --git a/src/components/Preview_onlyoffice/index.vue b/src/components/Preview_onlyoffice/index.vue
index ae94ac95..afebb1af 100644
--- a/src/components/Preview_onlyoffice/index.vue
+++ b/src/components/Preview_onlyoffice/index.vue
@@ -3,7 +3,7 @@
custom-class="base-dialog-wrapper" @close="handleClose">
@@ -20,6 +20,7 @@ export default {
title: null,
documentType: null,
currentUser: zzSessionStorage.getItem('userName'),
+ onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL
};
},
methods: {
diff --git a/src/styles/index.scss b/src/styles/index.scss
index 802cb3cb..d95173e6 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -68,6 +68,12 @@ body .el-table th.gutter {
}
}
+.text-ellipsis {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
.el-loading-mask {
background-color: rgba(255, 255, 255, 0.5);
}
diff --git a/static/onlyOffice/viewer.html b/static/onlyOffice/viewer.html
index f0d2c0a8..9d470273 100644
--- a/static/onlyOffice/viewer.html
+++ b/static/onlyOffice/viewer.html
@@ -12,8 +12,8 @@
-
+
@@ -28,22 +28,34 @@
var arr = item.split('=')
obj[arr[0]] = window.decodeURIComponent(arr[1])
})
- var docEditor = new window.DocsAPI.DocEditor("placeholder", {
- type: "embedded",
- "document": {
- "fileType": obj.type,
- "key": "Khirz6zTPdfd7" + Date.now(),
- "title": obj.title,
- "url": url,
- },
- // editorConfig: {
- // lang:'zh'
+ function loadScript() {
+ return new Promise((resolve, reject) => {
+ const script = document.createElement('script')
+ script.src = `${obj.onlyOffice_url}/web-apps/apps/api/documents/api.js`
+ script.onload = resolve
+ script.onerror = reject
+ document.head.appendChild(script)
+ })
+ }
+ loadScript().then(() => {
+ console.log('JS 加载完成')
+ var docEditor = new window.DocsAPI.DocEditor("placeholder", {
+ type: "embedded",
+ "document": {
+ "fileType": obj.type,
+ "key": "Khirz6zTPdfd7" + Date.now(),
+ "title": obj.title,
+ "url": url,
+ },
+ // editorConfig: {
+ // lang:'zh'
- // },
- "documentType": obj.documentType,
- "height": "100%",
+ // },
+ "documentType": obj.documentType,
+ "height": "100%",
- });
+ });
+ })