fix: some
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled

This commit is contained in:
luo
2026-09-20 10:10:50 +08:00
parent e37d4902ca
commit 085a83d4e4
19 changed files with 744 additions and 424 deletions

View File

@@ -1,5 +1,33 @@
<template>
<ElDialog v-model="visible" title="凭证查看" width="560px" @closed="handleClose">
<div v-if="inline" class="voucher-preview voucher-preview--inline">
<div v-if="loading" class="voucher-preview__loading">加载中...</div>
<div v-else-if="files.length" class="voucher-preview__list">
<div v-for="file in files" :key="file.key" class="voucher-preview__item">
<ElImage
v-if="file.isImage"
class="voucher-preview__image"
:src="file.url"
:preview-src-list="imageUrls"
:initial-index="getImageIndex(file.url)"
fit="cover"
preview-teleported
/>
<div v-else class="voucher-preview__file">
<ElIcon><component :is="getFileIcon(file)" /></ElIcon>
<span class="voucher-preview__file-type">{{ file.fileType }}</span>
</div>
<div class="voucher-preview__meta">
<div class="voucher-preview__name" :title="file.name">{{
getDisplayName(file.name)
}}</div>
<ElButton link type="primary" @click="openFile(file)">查看/下载</ElButton>
</div>
</div>
</div>
<ElEmpty v-else description="暂无凭证" />
</div>
<ElDialog v-else v-model="visible" title="凭证查看" width="560px" @closed="handleClose">
<div v-if="loading" class="voucher-preview__loading">加载中...</div>
<div v-else-if="files.length" class="voucher-preview__list">
<div v-for="file in files" :key="file.key" class="voucher-preview__item">
@@ -48,6 +76,7 @@
interface Props {
fileKey?: string | string[]
fileKeys?: string[]
inline?: boolean
}
interface VoucherFile {
@@ -59,7 +88,9 @@
fileType: string
}
const props = defineProps<Props>()
const props = withDefaults(defineProps<Props>(), {
inline: false
})
const emit = defineEmits<{
close: []
@@ -165,7 +196,7 @@
return
}
visible.value = true
visible.value = !props.inline
loading.value = true
files.value = []