commit
This commit is contained in:
@@ -43,14 +43,16 @@
|
||||
</el-col>
|
||||
<el-col :span="19" class="preview-content-col">
|
||||
<div class="preview-content-wrapper">
|
||||
<div class="preview-main-content">
|
||||
<div class="preview-main-content" v-loading="officeLoading" element-loading-text="拼命加载中">
|
||||
<el-image
|
||||
v-if="file?.suffix === 'jpg' || file?.suffix === 'png' || file?.suffix === 'jpeg' || file?.suffix === 'gif'"
|
||||
:src="file.downloadPath"
|
||||
:fit="'cover'"
|
||||
@click.stop="$commonUtil.previewFile(file)"
|
||||
@load="officeLoading = false"
|
||||
@error="officeLoading = false"
|
||||
></el-image>
|
||||
<div v-else v-loading="officeLoading" element-loading-text="拼命加载中" style="height: 100%">
|
||||
<div v-else style="height: 100%">
|
||||
<iframe v-if="['doc', 'docx', 'xls', 'xlsx'].includes(file?.suffix)"
|
||||
frameborder="0"
|
||||
width="100%"
|
||||
@@ -137,10 +139,13 @@ module.exports = {
|
||||
this.file = this.fileList[this.defaultActive]
|
||||
},
|
||||
menuSelect(index) {
|
||||
index = Number(index)
|
||||
this.defaultActive = Number(this.defaultActive)
|
||||
if(index !== this.defaultActive) {
|
||||
this.officeLoading = true
|
||||
}
|
||||
this.defaultActive = index
|
||||
this.file = this.fileList[index]
|
||||
this.officeLoading = true
|
||||
},
|
||||
onPreView(item, index) {
|
||||
this.file = item
|
||||
|
||||
Reference in New Issue
Block a user