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_BASE_PATH = '/'
|
||||||
|
|
||||||
VUE_APP_IS_TEST = false
|
VUE_APP_IS_TEST = false
|
||||||
|
# onlyoffice地址
|
||||||
|
VUE_APP_ONLYOFFICE_URL = "https://onlyoffice.test.extimaging.com"
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://123.56.94.154:7000'
|
VUE_APP_BASE_API = 'http://123.56.94.154:7000'
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,9 @@ NODE_ENV = 'prod'
|
||||||
# base public path
|
# base public path
|
||||||
VUE_APP_BASE_PATH = '/'
|
VUE_APP_BASE_PATH = '/'
|
||||||
|
|
||||||
|
# onlyoffice地址
|
||||||
|
VUE_APP_ONLYOFFICE_URL = "https://onlyoffice.test.extimaging.com"
|
||||||
|
|
||||||
# 是否开启登陆限制 true:是 false:否
|
# 是否开启登陆限制 true:是 false:否
|
||||||
VUE_APP_LOGIN_FOR_PERMISSION = true
|
VUE_APP_LOGIN_FOR_PERMISSION = true
|
||||||
|
|
||||||
|
|
3
.env.uat
3
.env.uat
|
@ -4,6 +4,9 @@ NODE_ENV = 'production'
|
||||||
# base public path
|
# base public path
|
||||||
VUE_APP_BASE_PATH = '/'
|
VUE_APP_BASE_PATH = '/'
|
||||||
|
|
||||||
|
# onlyoffice地址
|
||||||
|
VUE_APP_ONLYOFFICE_URL = "https://onlyoffice.test.extimaging.com"
|
||||||
|
|
||||||
# base public path
|
# base public path
|
||||||
VUE_APP_BASE_PATH = '/'
|
VUE_APP_BASE_PATH = '/'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
custom-class="base-dialog-wrapper" @close="handleClose">
|
custom-class="base-dialog-wrapper" @close="handleClose">
|
||||||
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
|
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
|
||||||
<iframe v-if="visible"
|
<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" />
|
width="100%" height="99%" frameborder="0" crossorigin="anonymous" />
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -20,6 +20,7 @@ export default {
|
||||||
title: null,
|
title: null,
|
||||||
documentType: null,
|
documentType: null,
|
||||||
currentUser: zzSessionStorage.getItem('userName'),
|
currentUser: zzSessionStorage.getItem('userName'),
|
||||||
|
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -68,6 +68,12 @@ body .el-table th.gutter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-ellipsis {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
.el-loading-mask {
|
.el-loading-mask {
|
||||||
background-color: rgba(255, 255, 255, 0.5);
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
</style>
|
</style>
|
||||||
<title></title>
|
<title></title>
|
||||||
<!-- 引入外部JavaScript文件 -->
|
<!-- 引入外部JavaScript文件 -->
|
||||||
<script type="text/javascript"
|
<!-- <script type="text/javascript"
|
||||||
src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script>
|
src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script> -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -28,22 +28,34 @@
|
||||||
var arr = item.split('=')
|
var arr = item.split('=')
|
||||||
obj[arr[0]] = window.decodeURIComponent(arr[1])
|
obj[arr[0]] = window.decodeURIComponent(arr[1])
|
||||||
})
|
})
|
||||||
var docEditor = new window.DocsAPI.DocEditor("placeholder", {
|
function loadScript() {
|
||||||
type: "embedded",
|
return new Promise((resolve, reject) => {
|
||||||
"document": {
|
const script = document.createElement('script')
|
||||||
"fileType": obj.type,
|
script.src = `${obj.onlyOffice_url}/web-apps/apps/api/documents/api.js`
|
||||||
"key": "Khirz6zTPdfd7" + Date.now(),
|
script.onload = resolve
|
||||||
"title": obj.title,
|
script.onerror = reject
|
||||||
"url": url,
|
document.head.appendChild(script)
|
||||||
},
|
})
|
||||||
// editorConfig: {
|
}
|
||||||
// lang:'zh'
|
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,
|
"documentType": obj.documentType,
|
||||||
"height": "100%",
|
"height": "100%",
|
||||||
|
|
||||||
});
|
});
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue