吴羡
4 天以前 89fd9ab312c0aef9fcab89fbbaee4add5baa7c57
src/components/Attachment/lims-attachment.vue
@@ -60,6 +60,7 @@
<script>
import request from '@/utils/request'
import { resolveAttachmentUrl } from '@/utils/attachment'
import filePreview from '@/components/Preview/filePreview.vue'
/**
@@ -298,7 +299,7 @@
      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(() => {
@@ -314,8 +315,7 @@
    },
    // 静态地址拼接,与后端上传统一路由保持一致:图片在 /img,其它都在 /word
    fullUrl(fileUrl) {
      const base = /\.(jpg|jpeg|png|gif)$/i.test(fileUrl) ? '/img/' : '/word/'
      return this.javaApi + base + fileUrl
      return resolveAttachmentUrl(fileUrl)
    }
  }
}