| | |
| | | |
| | | <script> |
| | | import request from '@/utils/request' |
| | | import { resolveAttachmentUrl } from '@/utils/attachment' |
| | | import filePreview from '@/components/Preview/filePreview.vue' |
| | | |
| | | /** |
| | |
| | | this.previewVisible = true |
| | | }, |
| | | downloadFile(row) { |
| | | this.$download.saveAs(this.fullUrl(row.fileUrl), row.fileName) |
| | | return this.$download.attachment(row, row.fileName) |
| | | }, |
| | | removeFile(row) { |
| | | this.$confirm('是否删除该附件?', '提示', { type: 'warning' }).then(() => { |
| | |
| | | }, |
| | | // 静态地址拼接,与后端上传统一路由保持一致:图片在 /img,其它都在 /word |
| | | fullUrl(fileUrl) { |
| | | const base = /\.(jpg|jpeg|png|gif)$/i.test(fileUrl) ? '/img/' : '/word/' |
| | | return this.javaApi + base + fileUrl |
| | | return resolveAttachmentUrl(fileUrl) |
| | | } |
| | | } |
| | | } |