Merge branch 'master' of http://61.139.16.27:26684/maojiacai/ba_web
This commit is contained in:
@ -96,23 +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,8 +160,6 @@ const handlerSuccess = (res, file) => {
|
||||
// file.url = `/mosty-base/minio/image/download/` + res.data;
|
||||
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)
|
||||
@ -203,7 +199,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