This commit is contained in:
2025-09-26 17:48:29 +08:00
parent c83d17beac
commit bc4d67e7dd

View File

@ -96,22 +96,21 @@ const fileList = ref([]);
watch(() => props.modelValue,(val) => { watch(() => props.modelValue,(val) => {
let arr = val ? (Array.isArray(val) ? val :[val]): []; let arr = val ? (Array.isArray(val) ? val :[val]): [];
console.log(val,'=========999');
if(arr.length == 0 ) return fileList.value = []; if(arr.length == 0 ) return fileList.value = [];
fileList.value = arr.map((el) => { fileList.value = arr.map((el) => {
if (Object.prototype.toString.call(el) === "[object Object]") { if (Object.prototype.toString.call(el) === "[object Object]") {
return props.isAll ? { url: `/mosty-base/minio/image/download/` + el.id, name: el.name } : { url:el,name:el.name}; return props.isAll ? { url: `/bagl/mosty-base/minio/image/download/` + el.id, name: el.name ,id : el } : { url:el,name:el.name , id : el};
} else { } else {
return { url: `/mosty-base/minio/image/download/` + el }; return { url: `/bagl/mosty-base/minio/image/download/` + el,id : el };
} }
}); });
},{ immediate: true,deep:true }); },{ immediate: true,deep:true });
const actionUrl = computed(() => { const actionUrl = computed(() => {
if (props.isAll) { if (props.isAll) {
return "/mosty-base/minio/image/upload/id"; return "/bagl/mosty-base/minio/image/upload/id";
} else { } else {
return props.isImg ? "/mosty-base/minio/image/upload/id": "/mosty-base/minio/file/upload"; return props.isImg ? "/bagl/mosty-base/minio/image/upload/id": "/bagl/mosty-base/minio/file/upload";
} }
}); });
@ -162,7 +161,6 @@ const handlerSuccess = (res, file) => {
file.id = res.data; file.id = res.data;
fileList.value.push(file); fileList.value.push(file);
console.log(fileList.value,'=========999'); console.log(fileList.value,'=========999');
let arr = [] let arr = []
if(props.isImg){ if(props.isImg){
arr = fileList.value.map((el) => el.id) arr = fileList.value.map((el) => el.id)
@ -202,7 +200,6 @@ const beforeRemove = (file) => {
let index = fileList.value.findIndex(function (item) { let index = fileList.value.findIndex(function (item) {
return item.id === file.id; return item.id === file.id;
}); });
props.modelValue.splice(index, 1); props.modelValue.splice(index, 1);
emits("update:modelValue", props.modelValue); emits("update:modelValue", props.modelValue);
} }