mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-08 14:44:58 +08:00
fix: upload组件resolve问题
This commit is contained in:
parent
2154f9c3e7
commit
1ce91dee0a
@ -97,9 +97,9 @@ const { uploadUrl, httpRequest } = useUpload()
|
||||
// 自定义上传
|
||||
const handleRequest = async (f: UploadRequestOptions) => {
|
||||
if (!!props.categoryPath) {
|
||||
httpRequest(f, { categoryPath: props.categoryPath })
|
||||
return httpRequest(f, { categoryPath: props.categoryPath })
|
||||
} else {
|
||||
httpRequest(f)
|
||||
return httpRequest(f)
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,6 +136,8 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
|
||||
// 文件上传成功
|
||||
const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => {
|
||||
message.success('上传成功')
|
||||
console.log(fileList.value,res);
|
||||
|
||||
// 删除自身
|
||||
const index = fileList.value.findIndex((item) => item.response?.data === res.data)
|
||||
fileList.value.splice(index, 1)
|
||||
@ -186,6 +188,7 @@ watch(
|
||||
// 发送文件链接列表更新
|
||||
const emitUpdateModelValue = () => {
|
||||
const result = fileList.value.map(({ name, url }) => ({ name, url }))
|
||||
console.log(result);
|
||||
|
||||
emit('update:modelValue', result)
|
||||
}
|
||||
|
@ -105,9 +105,9 @@ const { uploadUrl, httpRequest } = useUpload()
|
||||
// 自定义上传
|
||||
const handleRequest = async (f: UploadRequestOptions) => {
|
||||
if (!!props.categoryPath) {
|
||||
httpRequest(f, { categoryPath: props.categoryPath })
|
||||
return httpRequest(f, { categoryPath: props.categoryPath })
|
||||
} else {
|
||||
httpRequest(f)
|
||||
return httpRequest(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,9 +91,9 @@ const uploadList = ref<UploadUserFile[]>([])
|
||||
// 自定义上传
|
||||
const handleRequest = async (f: UploadRequestOptions) => {
|
||||
if (!!props.categoryPath) {
|
||||
httpRequest(f, { categoryPath: props.categoryPath })
|
||||
return httpRequest(f, { categoryPath: props.categoryPath })
|
||||
} else {
|
||||
httpRequest(f)
|
||||
return httpRequest(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user