From 9a789db8a71c973b36c04af988b0d0965c53aa15 Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Wed, 3 Jul 2024 21:31:05 +0800
Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8D=E5=88=86=E6=91=8A?=
=?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BC=A0=E5=8F=82=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/AttachmentUpload.vue | 25 ++++++++++------------
src/views/expense-management/share/add.vue | 19 +++++++++++-----
2 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/src/components/AttachmentUpload.vue b/src/components/AttachmentUpload.vue
index 3a317b4..70bb806 100644
--- a/src/components/AttachmentUpload.vue
+++ b/src/components/AttachmentUpload.vue
@@ -223,21 +223,20 @@ const isSingleFile = ref(false)
const allFileList = ref([])
const deleteFileVal = ref({})
const singleFileList = ref([])
-if (props.formData.fileList !== null && props.formData.fileList?.length > 0) {
- allFileList.value = props.formData.fileList
-}
-
+// if (props.formData.fileList !== null && props.formData.fileList?.length > 0) {
+// allFileList.value = props.formData.fileList
+// }
watch(() => props.showSingleTable, (newVal) => {
props.showSingleTable = newVal
}, {deep: true})
-// watch(() => props.formData.fileList, (newVal) => {
-// console.log('newVal-fileList', newVal)
-// if (props.preview) {
-// // newVal?.forEach(item => {
-// // allFileList.value.push(item)
-// // })
-// }
-// }, {deep: true})
+watch(() => props.formData.fileList, (newVal) => {
+ console.log('newVal-fileList', newVal)
+ if (props.preview) {
+ newVal?.forEach(item => {
+ allFileList.value.push(item)
+ })
+ }
+}, {immediate: true})
// watch(() => props.otherFileList, (newVal) => {
// props.otherFileList=newVal
// if (props.preview) {
@@ -280,8 +279,6 @@ const handleDelete = (row, type) => {
singleFileList.value.splice(singleFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
isSingleFile.value = false
} else {
- console.log('allFileList.value',allFileList.value,row)
- console.log('allFileList.value.findIndex((item) => item.id === row.fileId)',allFileList.value.findIndex((item) => item.id === row.fileId))
allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
}
}
diff --git a/src/views/expense-management/share/add.vue b/src/views/expense-management/share/add.vue
index 1e868fe..d74d6b5 100644
--- a/src/views/expense-management/share/add.vue
+++ b/src/views/expense-management/share/add.vue
@@ -115,7 +115,7 @@