更新数据

This commit is contained in:
2025-07-19 17:08:53 +08:00
parent 72a2e174c1
commit fbd2431f63
10 changed files with 199 additions and 44 deletions

View File

@ -19,9 +19,7 @@
:before-upload="beforeImgUpload"
>
<template #default>
<el-button v-if="props.showBtn" size="small" type="primary"
>上传文件</el-button
>
<el-button v-if="props.showBtn" size="small" type="primary">上传文件</el-button>
<el-icon v-else> <Plus /> </el-icon>
</template>
<template #file="{ file }" v-if="!props.showBtn">
@ -108,13 +106,11 @@ const props = defineProps({
showBtn: {
type: Boolean,
default: false
}
},
});
const actionUrl = computed(() =>
props.isImg
? "/mosty-api/mosty-base/minio/image/upload/id"
: "/mosty-api/mosty-base/minio/file/upload"
props.isImg ? "/mosty-api/mosty-base/minio/image/upload/id" : "/mosty-api/mosty-base/minio/file/upload"
);
const emits = defineEmits(["update:modelValue", "handleChange"]);
@ -183,11 +179,11 @@ watch(
if (arr && arr.length > 0) {
if (!props.sfUrl) {
fileList.value = arr.map((el) => {
return { url: `/mosty-api/mosty-base/minio/image/download/` + el };
return { url: `/mosty-api/mosty-base/minio/image/download/` + el,name:'生活时尚' };
});
} else {
fileList.value = arr.map((el) => {
return { url: el };
return { url: el ,name:'生活时尚'};
});
}
}
@ -197,13 +193,12 @@ watch(
const handlerSuccess = (res, file) => {
console.log(file,'===========00');
// file.url = `/mosty-api/mosty-base/minio/image/download/` + res.data;
// fileList.value.push(file);
// let arr = props.modelValue ? props.modelValue : [];
// arr.push(res.data);
// emits("update:modelValue", arr);
// emits("handleChange", props.modelValue);
file.url = `/mosty-api/mosty-base/minio/image/download/` + res.data;
fileList.value.push(file);
let arr = props.modelValue ? props.modelValue : [];
arr.push(res.data);
emits("update:modelValue", arr);
emits("handleChange", props.modelValue);
};
const handleExceed = (files, fileList) => {