|
@@ -1,13 +1,15 @@
|
|
<template>
|
|
<template>
|
|
<el-dialog class="show-file" :visible="dialogVisibleShowFile" width="1100px" @close="dialogShowFileClose">
|
|
<el-dialog class="show-file" :visible="dialogVisibleShowFile" width="1100px" @close="dialogShowFileClose">
|
|
<div slot="title">{{ $t('Key322') }}【{{ fileName }}】</div>
|
|
<div slot="title">{{ $t('Key322') }}【{{ fileName }}】</div>
|
|
-
|
|
|
|
- <iframe
|
|
|
|
- v-if="fileUrl.length > 0"
|
|
|
|
- :src="`https://docpreview.utschool.cn/onlinePreview?url=${fileUrl}`"
|
|
|
|
- width="100%"
|
|
|
|
- height="540px"
|
|
|
|
- />
|
|
|
|
|
|
+ <div v-loading="loading">
|
|
|
|
+ <iframe
|
|
|
|
+ v-if="fileUrl.length > 0"
|
|
|
|
+ id="iframe"
|
|
|
|
+ :src="`https://docpreview.utschool.cn/onlinePreview?url=${fileUrl}`"
|
|
|
|
+ width="100%"
|
|
|
|
+ height="540px"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
<el-button @click="dialogShowFileClose">
|
|
<el-button @click="dialogShowFileClose">
|
|
@@ -36,6 +38,7 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ loading: false,
|
|
dialogVisibleShowFile: false,
|
|
dialogVisibleShowFile: false,
|
|
pdfSrc: '',
|
|
pdfSrc: '',
|
|
numPages: 1,
|
|
numPages: 1,
|
|
@@ -66,7 +69,13 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
getFileStoreInfo() {
|
|
getFileStoreInfo() {
|
|
GetFileStoreInfo({ file_id: this.fileId }).then(({ file_url_https }) => {
|
|
GetFileStoreInfo({ file_id: this.fileId }).then(({ file_url_https }) => {
|
|
|
|
+ this.loading = true;
|
|
this.fileUrl = encodeURIComponent(encode(file_url_https));
|
|
this.fileUrl = encodeURIComponent(encode(file_url_https));
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ document.getElementById('iframe').onload = () => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ };
|
|
|
|
+ });
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|