From f3766cee3127228b4b61bbf6fa974493208190e7 Mon Sep 17 00:00:00 2001 From: danshihao Date: Tue, 19 Mar 2024 15:10:31 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=BC=80=E7=A5=A8=E9=82=AE=E5=AF=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF-=E6=9F=A5=E7=9C=8B=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PreviewFileModal.vue | 47 ++++++++++++++++++++++ src/components/ProjectDetailModal.vue | 14 +++---- src/components/jero/PreviewFile.vue | 58 +++++++++++++++++++++++++-- 3 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 src/components/PreviewFileModal.vue diff --git a/src/components/PreviewFileModal.vue b/src/components/PreviewFileModal.vue new file mode 100644 index 0000000..634c55f --- /dev/null +++ b/src/components/PreviewFileModal.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/src/components/ProjectDetailModal.vue b/src/components/ProjectDetailModal.vue index 1296a16..f046ba1 100644 --- a/src/components/ProjectDetailModal.vue +++ b/src/components/ProjectDetailModal.vue @@ -332,6 +332,8 @@ + + @@ -342,7 +344,7 @@ import PreviewFile from './jero/PreviewFile' import { ProjectTypeEnums } from '@/enums/commonEnums' import Vue from 'vue' import {ACCESS_TOKEN} from '@/store/mutation-types' -import {getFileInfo} from '@api/api' +import PreviewFileModal from '@comp/PreviewFileModal' const Base64 = require('js-base64').Base64 // import pick from 'lodash.pick' // import {getAction} from "@api/manage"; @@ -447,6 +449,7 @@ export default { } }, components: { + PreviewFileModal, JEllipsis, PreviewFile }, @@ -528,14 +531,7 @@ export default { this.$message.warning('暂无发票') return } - // 多个文件取第一个 - const id = record.invoiceFileId.split(',')[0] - getFileInfo({ id }).then(res => { - if (res.success) { - // 预览文件 - this.handlePreview(res.result) - } - }) + this.$refs.previewFileModal.open(record.invoiceFileId) }, // 预览 handlePreview(file) { diff --git a/src/components/jero/PreviewFile.vue b/src/components/jero/PreviewFile.vue index 1da4217..e735401 100644 --- a/src/components/jero/PreviewFile.vue +++ b/src/components/jero/PreviewFile.vue @@ -1,10 +1,20 @@