更新
This commit is contained in:
parent
20e27bf146
commit
7f10f4d7de
@ -103,11 +103,14 @@
|
|||||||
|
|
||||||
<el-dialog title="文件预览" :visible.sync="isShowFile" width="70%" append-to-body>
|
<el-dialog title="文件预览" :visible.sync="isShowFile" width="70%" append-to-body>
|
||||||
<div class="preview-container">
|
<div class="preview-container">
|
||||||
|
<audio v-if="isAudioType" class="preview-iframe" controls>
|
||||||
|
<source :src="imageUrl + selectFile.filePath"/>
|
||||||
|
</audio>
|
||||||
<!-- 左侧预览区域 -->
|
<!-- 左侧预览区域 -->
|
||||||
<iframe
|
<iframe
|
||||||
:src="fileUrl"
|
:src="fileUrl"
|
||||||
frameborder="0"
|
frameborder="0"
|
||||||
class="preview-iframe" v-if="!isImage && selectFile.fileType != 'txt'"
|
class="preview-iframe" v-if="!isImage && selectFile.fileType != 'txt' && !isAudioType"
|
||||||
>
|
>
|
||||||
</iframe>
|
</iframe>
|
||||||
<image-preview class="preview-iframe" :src="imageUrl + selectFile.filePath" v-if="isImage"></image-preview>
|
<image-preview class="preview-iframe" :src="imageUrl + selectFile.filePath" v-if="isImage"></image-preview>
|
||||||
@ -120,7 +123,6 @@
|
|||||||
</iframe>
|
</iframe>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 右侧文件列表 -->
|
<!-- 右侧文件列表 -->
|
||||||
<div class="file-list">
|
<div class="file-list">
|
||||||
<el-table
|
<el-table
|
||||||
@ -332,6 +334,16 @@ export default {
|
|||||||
isImage: false
|
isImage: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
isAudioType() {
|
||||||
|
const audioExtensions = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac'];
|
||||||
|
const fileExtension = this.selectFile.fileType;
|
||||||
|
return audioExtensions.includes(fileExtension);
|
||||||
|
|
||||||
|
// 或者如果已有 fileType 字段(根据 MIME type 判断):
|
||||||
|
// return this.fileType.startsWith('audio/');
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.listByPermission()
|
this.listByPermission()
|
||||||
|
Loading…
Reference in New Issue
Block a user