2026-08-08 13:32:27 +08:00
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import type { TruckAttachmentReference } from '../types'
|
2026-08-08 14:13:32 +08:00
|
|
|
|
const props = defineProps<{ modelValue: boolean; attachments: TruckAttachmentReference[] }>()
|
|
|
|
|
|
const emit = defineEmits<{ 'update:modelValue': [boolean] }>()
|
2026-08-08 13:32:27 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<el-dialog :model-value="props.modelValue" title="附件引用" width="min(640px, 94vw)" @update:model-value="emit('update:modelValue', $event)">
|
2026-08-08 14:13:32 +08:00
|
|
|
|
<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>
|
2026-08-08 13:32:27 +08:00
|
|
|
|
</div>
|
2026-08-08 14:13:32 +08:00
|
|
|
|
<template #footer><el-button type="primary" @click="emit('update:modelValue', false)">关闭</el-button></template>
|
2026-08-08 13:32:27 +08:00
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<style scoped>
|
2026-08-08 14:13:32 +08:00
|
|
|
|
.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; } }
|
2026-08-08 13:32:27 +08:00
|
|
|
|
</style>
|