上传name
This commit is contained in:
parent
a06cb42a7a
commit
a72be8adda
@ -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) {
|
||||||
|
@ -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)
|
||||||
|
@ -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({
|
||||||
|
Loading…
Reference in New Issue
Block a user