From 45708850f4046377a4af30645d2e9af9f6b2afb3 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Sat, 28 Jan 2023 13:50:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=9A=E7=9F=A5=E6=A8=A1=E6=9D=BF,?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=99=84=E4=BB=B6=E4=BF=A1=E6=81=AF=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Template/Detail/components/Attachments.vue | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/views/notice/Template/Detail/components/Attachments.vue b/src/views/notice/Template/Detail/components/Attachments.vue index 48d6f0ff..25dafe88 100644 --- a/src/views/notice/Template/Detail/components/Attachments.vue +++ b/src/views/notice/Template/Detail/components/Attachments.vue @@ -92,6 +92,10 @@ const handleChange = (info: UploadChangeParam, id: string | undefined) => { const targetFileIdx = fileList.value.findIndex((f) => f.id === id); fileList.value[targetFileIdx].name = info.file.name; fileList.value[targetFileIdx].location = info.file.response?.result; + emit( + 'update:attachments', + fileList.value.map(({ name, location }) => ({ name, location })), + ); } }; @@ -103,10 +107,6 @@ const handleDelete = (id: string | undefined) => { const idx = fileList.value.findIndex((f) => f.id === id); fileList.value.splice(idx, 1); - emit( - 'update:attachments', - fileList.value.map(({ name, location }) => ({ name, location })), - ); }; /** @@ -118,11 +118,6 @@ const handleAdd = () => { name: '', location: '', }); - - emit( - 'update:attachments', - fileList.value.map(({ name, location }) => ({ name, location })), - ); }; /**