feat:文件组件上传调整
This commit is contained in:
parent
a709cc5094
commit
d07542d480
|
|
@ -204,7 +204,7 @@ const handleUpload = (res) => {
|
|||
clearInterval(timmer.value);
|
||||
timmer.value = null;
|
||||
if (res.data) {
|
||||
res.data.url = import.meta.env.VITE_UPLOAD_IMG_URL + res.data.filepath;
|
||||
res.data.url = res.data.filepath;
|
||||
res.data.fileType = getFileType(res.data.url);
|
||||
fileList.value.push(res.data);
|
||||
emits("onUpdate", fileList.value);
|
||||
|
|
@ -222,9 +222,9 @@ const handleRemove = (val: any) => {
|
|||
arr.forEach((item: any, index: any) => {
|
||||
if (item == val) {
|
||||
arr.splice(index, 1);
|
||||
emits("onUpdate", arr);
|
||||
}
|
||||
});
|
||||
emits("onUpdate", arr);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -290,10 +290,9 @@ const getFileType = (fileName) => {
|
|||
const setFiles = () => {
|
||||
fileList.value = [];
|
||||
props.listPic.forEach((item: any) => {
|
||||
item.url = import.meta.env.VITE_UPLOAD_IMG_URL + item.filepath;
|
||||
item.url = item.filepath;
|
||||
item.fileType = getFileType(item.url);
|
||||
fileList.value.push(item);
|
||||
emits("onUpdate", fileList.value);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user