<!-- src/views/case/assessment/components/AttachmentPreview.vue -->
|
<template>
|
<el-dialog
|
title="附件预览"
|
:visible="visible"
|
width="70%"
|
@close="$emit('close')"
|
>
|
<el-table :data="attachmentList">
|
<el-table-column label="文件名" prop="fileName" />
|
<el-table-column label="类型" prop="fileType" width="100" />
|
<el-table-column label="大小" width="100">
|
<template slot-scope="scope">
|
{{ (scope.row.fileSize / 1024 / 1024).toFixed(2) }} MB
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" width="150">
|
<template slot-scope="scope">
|
<el-button type="text" @click="handlePreview(scope.row)">预览</el-button>
|
<el-button type="text" @click="handleDownload(scope.row)">下载</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-dialog>
|
</template>
|
|
<script>
|
export default {
|
name: "AttachmentPreview",
|
props: {
|
visible: Boolean,
|
attachmentList: {
|
type: Array,
|
default: () => []
|
}
|
},
|
methods: {
|
handlePreview(file) {
|
this.$message.info(`预览文件: ${file.fileName}`);
|
},
|
handleDownload(file) {
|
this.$message.success(`开始下载: ${file.fileName}`);
|
}
|
}
|
}
|
</script>
|