| | |
| | | > |
| | | <el-card> |
| | | <div v-html="condition.ywCondition"></div> |
| | | <el-link type="primary" |
| | | v-for="item in condition.ywProofMaterials != null ? condition.ywProofMaterials.split(',') : condition.ywProofMaterials" |
| | | :underline="false" :key="item.id" @click="handleDownload(item)" |
| | | >{{ item.substring(item.lastIndexOf('/') + 1) }} |
| | | </el-link> |
| | | <div v-for="item in condition.ywProofMaterials != null ? condition.ywProofMaterials.split(',') : condition.ywProofMaterials" |
| | | :key="item.id"> |
| | | <el-image |
| | | v-if="isImageFile(item)" |
| | | :src="getPreview(item)" |
| | | :preview-src-list="[getPreview(item)]" |
| | | fit="cover" |
| | | style="width: 100px; height: 100px; margin: 5px;" |
| | | > |
| | | </el-image> |
| | | <el-link |
| | | v-else |
| | | type="primary" |
| | | :underline="false" |
| | | @click="handleDownload(item)" |
| | | > |
| | | {{ getFileName(item) }} |
| | | </el-link> |
| | | </div> |
| | | </el-card> |
| | | </el-timeline-item> |
| | | </el-timeline> |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getPreview(url) { |
| | | // 使用全局配置的图片前缀 |
| | | return this.$img + url; |
| | | }, |
| | | isImageFile(url) { |
| | | const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp']; |
| | | return imageExtensions.some(ext => |
| | | url.toLowerCase().endsWith(ext) |
| | | ); |
| | | }, |
| | | getFileName(url) { |
| | | return url.substring(url.lastIndexOf('/') + 1); |
| | | }, |
| | | /** 下载按钮操作 */ |
| | | handleDownload(data) { |
| | | this.$download.resource(data) |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |