上传name

This commit is contained in:
陈红丽 2024-07-24 14:40:40 +08:00
parent a06cb42a7a
commit a72be8adda
3 changed files with 8 additions and 8 deletions

View File

@ -135,7 +135,7 @@ const actionFile=async (fileChild:any)=>{
const res =await upload(formData)
console.log(res)
emit('update:imageUrl',res.fileUrl);
emit('changeFileName',res.fileName)
emit('changeFileName',res.originalName)
// el-form
formItemContext?.prop && formContext?.validateField([formItemContext.prop as string]);
} catch (error) {

View File

@ -118,17 +118,17 @@ const handleHttpUpload = async (options: UploadRequestOptions) => {
if (editIndex !== '') {
list.splice(editIndex, 1, {
url: res.fileUrl,
name: res.fileName,
name: res.originalName,
filePath: res.fileUrl,
fileName: res.fileName
fileName: res.originalName
})
editIndex = ''
} else {
list.push({
url: res.fileUrl,
name: res.fileName,
name: res.originalName,
filePath: res.fileUrl,
fileName: res.fileName
fileName: res.originalName
})
}
emit('upload', list,props.zIndex)

View File

@ -120,13 +120,13 @@ const handleHttpUpload = async (options: UploadRequestOptions) => {
let list=JSON.parse(JSON.stringify(props.fileList))
list.push({
url: res.fileUrl,
name: res.fileName,
name: res.originalName,
filePath: res.fileUrl,
fileName: res.fileName,
fileName: res.originalName,
})
emit('upload', list,props.zIndex)
}else{
emit("upload", res.fileUrl,res.fileName,props.zIndex);
emit("upload", res.fileUrl,res.originalName,props.zIndex);
}
} catch (error) {
ElNotification({