From f325d523a0fe9f442d720b01a45e3d00f049433b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 15 Oct 2024 13:51:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=BB=84=E6=94=AF=E6=8C=81=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../picture-group/PictureGroupUploadAttr.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/custom-component/picture-group/PictureGroupUploadAttr.vue b/core/core-frontend/src/custom-component/picture-group/PictureGroupUploadAttr.vue index 8c903e7a65..8fd4e7fa17 100644 --- a/core/core-frontend/src/custom-component/picture-group/PictureGroupUploadAttr.vue +++ b/core/core-frontend/src/custom-component/picture-group/PictureGroupUploadAttr.vue @@ -49,16 +49,22 @@ const handlePictureCardPreview = file => { dialogVisible.value = true } -const handleRemove = (_, fileList) => { +const handleRemove = (file, fileListArry) => { uploadDisabled.value = false - element.value.propValue['urlList'] = [] - fileList.value = [] + let file_static_part = file.url.split('static-resource/')[1] + let index = element.value.propValue['urlList'].findIndex( + item => item.url.split('static-resource/')[1] === file_static_part + ) + if (index !== -1) { + element.value.propValue['urlList'].splice(index, 1) + useEmitt().emitter.emit('calcData-' + element.value.id) + } snapshotStore.recordSnapshotCache() } async function upload(file) { uploadFileResult(file.file, fileUrl => { snapshotStore.recordSnapshotCache() - element.value.propValue.urlList.push({ name: file.file.name, url: fileUrl }) + element.value.propValue.urlList.unshift({ name: file.file.name, url: fileUrl }) useEmitt().emitter.emit('calcData-' + element.value.id) }) } @@ -123,6 +129,7 @@ onBeforeUnmount(() => { :on-remove="handleRemove" :before-upload="beforeUploadCheck" :http-request="upload" + multiple :file-list="fileList" >