diff --git a/src/components/AttachmentUpload.vue b/src/components/AttachmentUpload.vue
index 68101c4..70bb806 100644
--- a/src/components/AttachmentUpload.vue
+++ b/src/components/AttachmentUpload.vue
@@ -82,6 +82,10 @@ const props = defineProps({
labelPosition: {
type: String,
default: ''
+ },
+ tag: {
+ type: String,
+ default: ''
}
})
const emit = defineEmits(["getAttachment", "getOtherFile"])
@@ -219,35 +223,36 @@ 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)
+ console.log('newVal-fileList', newVal)
if (props.preview) {
newVal?.forEach(item => {
allFileList.value.push(item)
})
}
-}, {deep: true})
-watch(() => props.otherFileList, (newVal) => {
- // console.log('newotherFileList', newVal)
- if (props.preview) {
- if (props.formData.fileList === null || props.formData.fileList?.length === 0) {
- allFileList.value = newVal
- } else {
- newVal?.forEach(item => {
- allFileList.value.push(item)
- })
- }
- } else {
- allFileList.value = newVal
- }
-}, {deep: true})
-
+}, {immediate: true})
+// watch(() => props.otherFileList, (newVal) => {
+// props.otherFileList=newVal
+ // if (props.preview) {
+ // console.log('newotherFileList', newVal,props.preview,props.formData.fileList)
+ // if (props.formData.fileList === null || props.formData.fileList?.length === 0) {
+ // allFileList.value = newVal
+ // } else {
+ // console.log('props.otherFileList',props.otherFileList)
+ // // props.otherFileList?.forEach(item => {
+ // // allFileList.value.push(item)
+ // // })
+ // }
+ // } else {
+ // allFileList.value = newVal
+ // }
+// }, {deep: true})
watch(() => props.showTable, (newVal) => {
props.showTable = newVal
}, {deep: true})
@@ -271,26 +276,42 @@ const handleDelete = (row, type) => {
})
if (res.code === 1000) {
if (type === 'single') {
- singleFileList.value.splice(singleFileList.value.findIndex((item) => item.id === row.fileId), 1);
+ singleFileList.value.splice(singleFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
isSingleFile.value = false
} else {
- allFileList.value.splice(allFileList.value.findIndex((item) => item.id === row.fileId), 1);
+ allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
}
}
});
}
const handleSingleDelete = (row) => {
- console.log('row',row)
+ // console.log('row',row)
// fileUploadRef.value.handleRemove(deleteFileVal.value.id)
handleDelete(row, 'single')
}
const getAttachment = (val) => {
- console.log('getAttachment', val)
+ // console.log('getAttachment', val)
isSingleFile.value = true
// deleteFileVal.value=val
emit('getAttachment', val)
}
+const compositeParam = (item) => {
+ return {
+ fileId: item.id,
+ size: item.size,
+ originalFileName: item.originalFilename,
+ fileType: item.fileType,
+ url: item.url,
+ newFile: true,
+ tag:props.tag
+ }
+}
const getOtherFile = (val) => {
+ if (props.preview) {
+ allFileList.value.push(compositeParam(val))
+ } else {
+ allFileList.value = props.otherFileList
+ }
emit('getOtherFile', val)
}
const deleteAttachment = (val) => {
diff --git a/src/components/DetailComponent/ProjectApply.vue b/src/components/DetailComponent/ProjectApply.vue
index 7622c89..1e912d3 100644
--- a/src/components/DetailComponent/ProjectApply.vue
+++ b/src/components/DetailComponent/ProjectApply.vue
@@ -16,7 +16,7 @@