|
@@ -46,7 +46,7 @@
|
|
|
:before-remove="isAnimation?removeFile5:removeFile"
|
|
|
>
|
|
|
<div type="primary" :disabled="!!file">
|
|
|
- <div>点击或拖拽文件上传 {{ isAnimation?size5:size }}</div>
|
|
|
+ <div>点击或拖拽文件上传 {{ isAnimation?'2GB':'5MB' }}</div>
|
|
|
<div class="">以内的{{ formatDesc }}</div>
|
|
|
</div>
|
|
|
<template v-slot:file="{ file }: { file: UploadFile }">
|
|
@@ -107,12 +107,12 @@ const { size, fileList, upload, removeFile, previewFile, file, accept } = useUpl
|
|
|
});
|
|
|
|
|
|
const { size:size5, fileList:fileLists, upload:upload5, removeFile:removeFile5, previewFile:previewFile5, file:file5, accept:accept5 } = useUpload({
|
|
|
- maxSize: 5 * 1024 * 1024,
|
|
|
+ maxSize: 2000 * 1024 * 1024,
|
|
|
formats: [".zip",".glb"],
|
|
|
});
|
|
|
const formatDesc = computed(() =>
|
|
|
{
|
|
|
- return isAnimation.value?'zip、glp上传':'jpg、png、jpeg、mp4、wav、mp3、shp上传'
|
|
|
+ return isAnimation.value?'zip、glb上传':'jpg、png、jpeg、mp4、wav、mp3、shp上传'
|
|
|
}
|
|
|
);
|
|
|
|
|
@@ -135,11 +135,14 @@ watchEffect(() => {
|
|
|
if (file.value?.name) {
|
|
|
caseFile.value.filesTitle = file.value?.name.substring(0, 50);
|
|
|
}
|
|
|
+ if (file5.value?.name) {
|
|
|
+ caseFile.value.filesTitle = file5.value?.name.substring(0, 50);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
defineExpose<QuiskExpose>({
|
|
|
async submit() {
|
|
|
- if (!file.value) {
|
|
|
+ if ((!file.value && !isAnimation.value) || (!file5.value && isAnimation.value)) {
|
|
|
ElMessage.error("请上传附件");
|
|
|
throw "请上传附件";
|
|
|
} else if (!caseFile.value.filesTitle.trim()) {
|