onlyoffice引入方式修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e2db9c2d51
commit
358864c6c6
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
3
.env.uat
3
.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 = '/'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
custom-class="base-dialog-wrapper" @close="handleClose">
|
||||
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
|
||||
<iframe v-if="visible"
|
||||
:src="`/static/onlyOffice/viewer.html?url=${OSSclientConfig.basePath}${path}?type=${type}&title=${title}&documentType=${documentType}&userName=${currentUser}`"
|
||||
:src="`/static/onlyOffice/viewer.html?url=${OSSclientConfig.basePath}${path}?onlyOffice_url=${onlyOffice_url}&type=${type}&title=${title}&documentType=${documentType}&userName=${currentUser}`"
|
||||
width="100%" height="99%" frameborder="0" crossorigin="anonymous" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -20,6 +20,7 @@ export default {
|
|||
title: null,
|
||||
documentType: null,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
</style>
|
||||
<title></title>
|
||||
<!-- 引入外部JavaScript文件 -->
|
||||
<script type="text/javascript"
|
||||
src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script>
|
||||
<!-- <script type="text/javascript"
|
||||
src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script> -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -28,6 +28,17 @@
|
|||
var arr = item.split('=')
|
||||
obj[arr[0]] = window.decodeURIComponent(arr[1])
|
||||
})
|
||||
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": {
|
||||
|
@ -44,6 +55,7 @@
|
|||
"height": "100%",
|
||||
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
|
Loading…
Reference in New Issue