fix 81642
This commit is contained in:
+17
-1
@@ -10,8 +10,10 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- 左侧文件预览 -->
|
<!-- 左侧文件预览 -->
|
||||||
<div class="content-left">
|
<div class="content-left">
|
||||||
<iframe v-if="iframeSrc" :src="iframeSrc" width="100%" frameborder="0"></iframe>
|
<iframe @load="loadIframe" v-if="iframeSrc" :src="iframeSrc" width="100%" frameborder="0"></iframe>
|
||||||
<a-empty class="empty-file" v-else :description="$t('noFileAvailableForPreview')"></a-empty>
|
<a-empty class="empty-file" v-else :description="$t('noFileAvailableForPreview')"></a-empty>
|
||||||
|
<!-- iframe加载时显示 -->
|
||||||
|
<a-spin v-if="iframeSrc && loading" class="iframe-loading"/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 右侧表单区域 -->
|
<!-- 右侧表单区域 -->
|
||||||
<div class="content-right">
|
<div class="content-right">
|
||||||
@@ -73,6 +75,7 @@ export default {
|
|||||||
visible: false,
|
visible: false,
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
|
loading: false, // iframe的加载状态
|
||||||
// 父表的当前行数据
|
// 父表的当前行数据
|
||||||
data: {},
|
data: {},
|
||||||
// 当前表的当前行数据
|
// 当前表的当前行数据
|
||||||
@@ -107,6 +110,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// iframe加载完成
|
||||||
|
loadIframe () {
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
add (data) {
|
add (data) {
|
||||||
this.type = 'add'
|
this.type = 'add'
|
||||||
this.data = Object.assign({}, data)
|
this.data = Object.assign({}, data)
|
||||||
@@ -163,9 +170,11 @@ export default {
|
|||||||
// word文件仍使用KKFile进行预览
|
// word文件仍使用KKFile进行预览
|
||||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||||
this.iframeSrc = url
|
this.iframeSrc = url
|
||||||
|
this.loading = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
|
this.loading = false
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.model = {}
|
this.model = {}
|
||||||
this.index = -1
|
this.index = -1
|
||||||
@@ -209,11 +218,18 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
.content-left {
|
.content-left {
|
||||||
|
position: relative;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
iframe {
|
iframe {
|
||||||
height: calc(100% - 20px) !important;
|
height: calc(100% - 20px) !important;
|
||||||
}
|
}
|
||||||
|
.iframe-loading {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.content-right {
|
.content-right {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
|
|||||||
Reference in New Issue
Block a user