调整预览历史图错误问题 管理端备货单添加删除

This commit is contained in:
浅念
2025-11-04 11:06:00 +08:00
parent 58a6732f1b
commit 6ae4fd872d
5 changed files with 78 additions and 212 deletions
+8 -3
View File
@@ -37,7 +37,7 @@
<!-- <el-button size="small" type="primary" :href="currentFile?.url" target="_blank"
>在新标签打开</el-button
> -->
<el-button size="small" @click="downloadCurrent">下载</el-button>
<!-- <el-button size="small" @click="downloadCurrent">下载</el-button> -->
<el-button size="small" type="danger" @click="handleClose">关闭</el-button>
</div>
</div>
@@ -131,6 +131,7 @@
// --- Props ---
interface FileItem {
file_name: any
name?: string
url: string
mime?: string // 可选,优先使用
@@ -253,8 +254,12 @@
const fileType = computed(() => {
const f = currentFile.value
if (!f) return 'unknown'
const mime = (f.mime || mimeFromName(f.name) || '').toLowerCase()
const ext = getExtension(f.name)
let names = f.name
if (names == '') {
names = f.file_name
}
const mime = (f.mime || mimeFromName(names) || '').toLowerCase()
const ext = getExtension(names)
if (mime.startsWith('image/') || ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'].includes(ext))
return 'image'