From 8aeab18853edff73542a52f15be75012b1fd4ca5 Mon Sep 17 00:00:00 2001 From: Harry Yang Date: Wed, 4 Jan 2023 19:30:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=AE=97=E9=87=87=E8=B4=AD=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E4=B8=AD=EF=BC=8C=E6=98=AF=E5=90=A6=E5=9E=AB?= =?UTF-8?q?=E8=B5=84=E7=9A=84=E5=AD=97=E6=AE=B5=E4=B8=8B=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E4=B8=BA=E6=98=AF=E6=88=96=E5=90=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/admin/business/process-detail.ftl | 10 +++++++--- .../resources/templates/admin/business/process-new.ftl | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/resources/templates/admin/business/process-detail.ftl b/src/main/resources/templates/admin/business/process-detail.ftl index c7fb3ee..ff04455 100644 --- a/src/main/resources/templates/admin/business/process-detail.ftl +++ b/src/main/resources/templates/admin/business/process-detail.ftl @@ -118,7 +118,7 @@ - + {{attachment.name}} @@ -344,7 +344,9 @@ const mapAttachment = attachment => { if (hasText(attachment)) { try { - return JSON.parse(attachment) + return JSON.parse(attachment).map(item => ({ + ...item, isImage: isImage(item.name) + })) } catch (e) { return [] } @@ -368,7 +370,9 @@ })) this.procurementDetails = procurementDetails - this.attachments = attachments + this.attachments = attachments.map(item => ({ + ...item, isImage: isImage(item.name) + })) }) .catch(({ response }) => { if (response) { diff --git a/src/main/resources/templates/admin/business/process-new.ftl b/src/main/resources/templates/admin/business/process-new.ftl index 8a7eb4f..9946f81 100644 --- a/src/main/resources/templates/admin/business/process-new.ftl +++ b/src/main/resources/templates/admin/business/process-new.ftl @@ -125,7 +125,7 @@ - +