This commit is contained in:
lcw
2025-08-16 16:54:03 +08:00
parent 71487ac647
commit 42f5e37f65
69 changed files with 5913 additions and 978 deletions

View File

@ -5,7 +5,9 @@
:on-exceed="handleExceed" :on-success="handlerSuccess" :before-upload="beforeImgUpload">
<template #default>
<el-button v-if="props.showBtn" size="small" type="primary">上传文件</el-button>
<el-icon v-else><Plus /></el-icon>
<el-icon v-else>
<Plus />
</el-icon>
</template>
<template #file="{ file }" v-if="!props.showBtn">
<div v-if="props.isImg">
@ -15,7 +17,9 @@
<el-icon> <zoom-in /></el-icon>
</span>
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file, fileList)">
<el-icon><Delete /></el-icon>
<el-icon>
<Delete />
</el-icon>
</span>
</span>
</div>
@ -26,10 +30,14 @@
</div>
<span class="el-upload-list__item-actions">
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
<el-icon><Download /></el-icon>
<el-icon>
<Download />
</el-icon>
</span>
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file, fileList)">
<el-icon><Delete /></el-icon>
<el-icon>
<Delete />
</el-icon>
</span>
</span>
</div>
@ -158,7 +166,9 @@ watch(
let arr = val ? val : [];
if (arr && arr.length > 0) {
if (!props.sfUrl) {
fileList.value = arr.map((el) => {
console.log(arr, "图片");
if (Array.isArray(arr)) {
fileList.value = arr.map((el) => {
if (Object.prototype.toString.call(el) === "[object Object]") {
return {
url: `/mosty-api/mosty-base/minio/image/download/` + el,
@ -168,6 +178,20 @@ watch(
return { url: `/mosty-api/mosty-base/minio/image/download/` + el };
}
});
} else {
const fjListData=arr.split(',')
fileList.value = fjListData.map((el) => {
if (Object.prototype.toString.call(el) === "[object Object]") {
return {
url: `/mosty-api/mosty-base/minio/image/download/` + el,
name: el.name
};
} else {
return { url: `/mosty-api/mosty-base/minio/image/download/` + el };
}
});
}
} else {
fileList.value = arr.map((el) => {
if (Object.prototype.toString.call(el) === "[object Object]") {
@ -285,4 +309,4 @@ const propsModelValue = ref();
-webkit-line-clamp: 2;
}
}
</style>
</style>