fix: 修复附件上传和展示问题

This commit is contained in:
dj
2025-04-09 00:13:51 +08:00
parent 2f43919132
commit 25d5b20b65

View File

@@ -32,7 +32,8 @@
<!-- <el-button color="#DED0B2" @click="handleUpload">上传附件</el-button>--> <!-- <el-button color="#DED0B2" @click="handleUpload">上传附件</el-button>-->
<file-upload v-if="!isLineBtn&&uploadState" @getFile="getFile"/> <file-upload v-if="!isLineBtn&&uploadState" @getFile="getFile"/>
<el-button color="#DED0B2" @click="handleEditTag" v-if="activeName!='all'&&activeName!='plus'&&uploadState" style="margin-left: 10px;">编辑 <el-button color="#DED0B2" @click="handleEditTag" v-if="activeName!='all'&&activeName!='plus'&&uploadState"
style="margin-left: 10px;">编辑
</el-button> </el-button>
</div> </div>
<fvTable style="width: 100%;min-height:311px;max-height: 311px" v-if="showAttachmentTable" height="311" <fvTable style="width: 100%;min-height:311px;max-height: 311px" v-if="showAttachmentTable" height="311"
@@ -269,10 +270,9 @@ const compositeParam = (item) => {
} }
} }
const getFile = (val) => { const getFile = (val) => {
// console.log('上传文件', val) console.log('上传文件', val)
let fileObj = compositeParam(val) let fileObj = compositeParam(val)
fileList.value.push(fileObj) fileList.value.push(fileObj)
otherAttachmentList.value.push(fileObj)
handleSubmit(fileList.value) handleSubmit(fileList.value)
} }
@@ -289,6 +289,11 @@ const handleSubmit = async (list) => {
message: res.msg, message: res.msg,
type: 'error' type: 'error'
}) })
fileList.value=[]
}else{
list.forEach(item => {
otherAttachmentList.value.push(item)
})
} }
getTagsOption() getTagsOption()
} }