Files
admin-web/src/modules/trucking/components/TruckAttachmentDialog.vue
T
2026-08-08 14:13:32 +08:00

21 lines
1.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import type { TruckAttachmentReference } from '../types'
const props = defineProps<{ modelValue: boolean; attachments: TruckAttachmentReference[] }>()
const emit = defineEmits<{ 'update:modelValue': [boolean] }>()
</script>
<template>
<el-dialog :model-value="props.modelValue" title="附件引用" width="min(640px, 94vw)" @update:model-value="emit('update:modelValue', $event)">
<el-alert type="info" :closable="false" title="仅展示后端返回的真实文件引用;当前接口未提供上传或删除动作。" />
<el-empty v-if="attachments.length === 0" description="暂无真实附件引用" :image-size="72" />
<div v-for="item in attachments" :key="item.fileId" class="attachment-row">
<div><strong>{{ item.fileName }}</strong><small>文件 ID:{{ item.fileId }}</small></div>
<code v-if="item.objectKey">{{ item.objectKey }}</code>
</div>
<template #footer><el-button type="primary" @click="emit('update:modelValue', false)">关闭</el-button></template>
</el-dialog>
</template>
<style scoped>
.attachment-row { display:flex; justify-content:space-between; gap:12px; margin:14px 0; padding:12px; border:1px solid var(--el-border-color-lighter); border-radius:6px; overflow-wrap:anywhere; }.attachment-row small { display:block; margin-top:4px; color:var(--el-text-color-secondary); }.attachment-row code { color:var(--el-text-color-secondary); font-size:12px; }
@media (max-width: 560px) { .attachment-row { flex-direction:column; } }
</style>