🎨 update
This commit is contained in:
@@ -152,18 +152,19 @@ const {uploading, send: submitFile, abort} = useRequest(uploadFile, {
|
||||
* @param file
|
||||
*/
|
||||
async function customUploadRequest(file: any) {
|
||||
const formData = new FormData();
|
||||
|
||||
const compressedFile = await imageCompression(file.file, upload.options);
|
||||
// 生成缩略图
|
||||
const {binaryData, width, height, size} = await generateThumbnail(compressedFile);
|
||||
upload.predictResult.thumb_w = width;
|
||||
upload.predictResult.thumb_h = height;
|
||||
upload.predictResult.thumb_size = size;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", file.file);
|
||||
if (binaryData) {
|
||||
formData.append("thumbnail", binaryData);
|
||||
}
|
||||
|
||||
|
||||
formData.append("file", file.file);
|
||||
formData.append("data", JSON.stringify({
|
||||
provider: upload.storageSelected?.[0],
|
||||
bucket: upload.storageSelected?.[1],
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<Spin size="middle" :spinning="imageStore.imageListLoading" indicator="spin-dot" tip="loading..." :rotate="true">
|
||||
<div style="width:100%;height:100%;" v-if="props.imageList">
|
||||
<div style="width:100%;height:100%;"
|
||||
v-if="props.imageList && upload.storageSelected?.[0] && upload.storageSelected?.[1]">
|
||||
<div v-for="(itemList, indexList) in props.imageList" :key="indexList" class="group-container"
|
||||
:class="{ 'has-selected': hasSelected(itemList) }">
|
||||
<div class="date-header">
|
||||
@@ -27,10 +28,11 @@
|
||||
:alt="item.file_name"
|
||||
:key="index"
|
||||
:height="200"
|
||||
:fallback="cover_image"
|
||||
style="height: 200px;max-width: 800px;object-fit: cover;"
|
||||
:preview="{
|
||||
src: item.url,
|
||||
}"
|
||||
}"
|
||||
loading="lazy">
|
||||
<template #previewMask>
|
||||
</template>
|
||||
@@ -62,7 +64,7 @@ import useStore from "@/store";
|
||||
import complete from '@/assets/svgs/complete.svg';
|
||||
import stop from '@/assets/svgs/stop.svg';
|
||||
import greyComplete from '@/assets/svgs/grey-complete.svg';
|
||||
|
||||
import cover_image from "@/assets/svgs/cover_image.svg";
|
||||
const props = defineProps({
|
||||
imageList: {
|
||||
type: Array as () => any[],
|
||||
@@ -71,7 +73,7 @@ const props = defineProps({
|
||||
});
|
||||
const iconSize = ref(23);
|
||||
const imageStore = useStore().image;
|
||||
|
||||
const upload = useStore().upload;
|
||||
|
||||
const toggleGroup = (group: any) => {
|
||||
const currentIds = group.list.map((item: any) => item.id);
|
||||
|
Reference in New Issue
Block a user