From 25d5b20b65e3913787eebb1bc49b4299fdc82252 Mon Sep 17 00:00:00 2001
From: dj <1042039504@qq.com>
Date: Wed, 9 Apr 2025 00:13:51 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=99=84=E4=BB=B6?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=92=8C=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DetailComponent/ProjectAttachment.vue | 29 +++++++++++--------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/components/DetailComponent/ProjectAttachment.vue b/src/components/DetailComponent/ProjectAttachment.vue
index 3efa1ee..d834566 100644
--- a/src/components/DetailComponent/ProjectAttachment.vue
+++ b/src/components/DetailComponent/ProjectAttachment.vue
@@ -32,7 +32,8 @@
- 编辑
+ 编辑
handleDownload(row)}>下载
{
uploadState.value ?
- deleteSingleFile(row)}/>:''
+ deleteSingleFile(row)}/> : ''
}
)
@@ -241,9 +242,9 @@ const handleTabClick = (item) => {
isEdit.value = false
}
if (item.props.name != 'plus') {
- if(item.props.name == 'all'){
+ if (item.props.name == 'all') {
changeFileList('all')
- }else{
+ } else {
changeFileList(getTagName(item.props.name))
}
// if (item.props.name == 'all') {
@@ -269,10 +270,9 @@ const compositeParam = (item) => {
}
}
const getFile = (val) => {
- // console.log('上传文件', val)
+ console.log('上传文件', val)
let fileObj = compositeParam(val)
fileList.value.push(fileObj)
- otherAttachmentList.value.push(fileObj)
handleSubmit(fileList.value)
}
@@ -283,12 +283,17 @@ const handleSubmit = async (list) => {
targetState: "30"
}
let res = await uploadFileList(params)
- if(res.code !== 1000){
+ if (res.code !== 1000) {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
+ fileList.value=[]
+ }else{
+ list.forEach(item => {
+ otherAttachmentList.value.push(item)
+ })
}
getTagsOption()
}
@@ -303,18 +308,18 @@ const clickToPreview = (row) => {
filePreviewShow.value = true
})
}
-const changeFileList=(tag)=>{
+const changeFileList = (tag) => {
let params = {}
- if(tag=='all'){
+ if (tag == 'all') {
params = {
targetId: route.query.projectId,
targetState: "30",
}
- }else{
+ } else {
params = {
targetId: route.query.projectId,
targetState: "30",
- tag:tag
+ tag: tag
}
}
showAttachmentTable.value = false