更新
This commit is contained in:
@ -96,22 +96,21 @@ const fileList = ref([]);
|
||||
|
||||
watch(() => props.modelValue,(val) => {
|
||||
let arr = val ? (Array.isArray(val) ? val :[val]): [];
|
||||
console.log(val,'=========999');
|
||||
if(arr.length == 0 ) return fileList.value = [];
|
||||
fileList.value = arr.map((el) => {
|
||||
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 {
|
||||
return { url: `/mosty-base/minio/image/download/` + el };
|
||||
return { url: `/bagl/mosty-base/minio/image/download/` + el,id : el };
|
||||
}
|
||||
});
|
||||
},{ immediate: true,deep:true });
|
||||
|
||||
const actionUrl = computed(() => {
|
||||
if (props.isAll) {
|
||||
return "/mosty-base/minio/image/upload/id";
|
||||
return "/bagl/mosty-base/minio/image/upload/id";
|
||||
} 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;
|
||||
fileList.value.push(file);
|
||||
console.log(fileList.value,'=========999');
|
||||
|
||||
let arr = []
|
||||
if(props.isImg){
|
||||
arr = fileList.value.map((el) => el.id)
|
||||
@ -202,7 +200,6 @@ const beforeRemove = (file) => {
|
||||
let index = fileList.value.findIndex(function (item) {
|
||||
return item.id === file.id;
|
||||
});
|
||||
|
||||
props.modelValue.splice(index, 1);
|
||||
emits("update:modelValue", props.modelValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user