上传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) const res =await upload(formData)
console.log(res) console.log(res)
emit('update:imageUrl',res.fileUrl); emit('update:imageUrl',res.fileUrl);
emit('changeFileName',res.fileName) emit('changeFileName',res.originalName)
// el-form // el-form
formItemContext?.prop && formContext?.validateField([formItemContext.prop as string]); formItemContext?.prop && formContext?.validateField([formItemContext.prop as string]);
} catch (error) { } catch (error) {

View File

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

View File

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