|
@@ -10,6 +10,7 @@
|
|
|
v-model="caseFile.dictId"
|
|
|
placeholder="请选择分组"
|
|
|
size="large"
|
|
|
+ @change="change"
|
|
|
:fit-input-width="true"
|
|
|
style="width: 240px"
|
|
|
>
|
|
@@ -35,17 +36,17 @@
|
|
|
:multiple="false"
|
|
|
drag
|
|
|
:limit="1"
|
|
|
- :disabled="!!file"
|
|
|
- :before-upload="upload"
|
|
|
- :file-list="fileList"
|
|
|
+ :disabled="!caseFile.dictId || (!!file)"
|
|
|
+ :before-upload="isAnimation?upload5:upload"
|
|
|
+ :file-list="isAnimation?fileList5:fileList"
|
|
|
:http-request="()=>{}"
|
|
|
:on-success="handleSuccess"
|
|
|
- :on-preview="previewFile"
|
|
|
- :accept="accept"
|
|
|
- :before-remove="removeFile"
|
|
|
+ :on-preview="isAnimation?previewFile5:previewFile"
|
|
|
+ :accept="isAnimation?accept5:accept"
|
|
|
+ :before-remove="isAnimation?removeFile5:removeFile"
|
|
|
>
|
|
|
<div type="primary" :disabled="!!file">
|
|
|
- <div>点击或拖拽文件上传 {{ size }}</div>
|
|
|
+ <div>点击或拖拽文件上传 {{ isAnimation?size5:size }}</div>
|
|
|
<div class="">以内的{{ formatDesc }}</div>
|
|
|
</div>
|
|
|
<template v-slot:file="{ file }: { file: UploadFile }">
|
|
@@ -85,6 +86,7 @@ const props = defineProps<{
|
|
|
fileType: number;
|
|
|
}>();
|
|
|
|
|
|
+const isAnimation = ref(false)
|
|
|
const caseFile = ref({
|
|
|
caseId: props.caseId,
|
|
|
filesTypeId: props.fileType,
|
|
@@ -100,18 +102,31 @@ onMounted(async () => {
|
|
|
});
|
|
|
|
|
|
const { size, fileList, upload, removeFile, previewFile, file, accept } = useUpload({
|
|
|
- maxSize: 2000 * 1024 * 1024,
|
|
|
- formats: [".jpg", ".png", ".jpeg", ".mp4", ".wav", ".mp3", ".shp"],
|
|
|
+ maxSize: isAnimation.value?5 * 1024 * 1024: 2000 * 1024 * 1024,
|
|
|
+ formats: isAnimation.value?[".zip",".glb"]:[".jpg", ".png", ".jpeg", ".mp4", ".wav", ".mp3", ".shp"],
|
|
|
});
|
|
|
|
|
|
+const { size:size5, fileList:fileLists, upload:upload5, removeFile:removeFile5, previewFile:previewFile5, file:file5, accept:accept5 } = useUpload({
|
|
|
+ maxSize: 5 * 1024 * 1024,
|
|
|
+ formats: [".zip",".glb"],
|
|
|
+});
|
|
|
const formatDesc = computed(() =>
|
|
|
- 'jpg、png、jpeg、mp4、wav、mp3、shp上传'
|
|
|
+{
|
|
|
+ return isAnimation.value?'zip、glp上传':'jpg、png、jpeg、mp4、wav、mp3、shp上传'
|
|
|
+}
|
|
|
);
|
|
|
|
|
|
// 上传请求
|
|
|
const handleSuccess = (option) => {
|
|
|
console.log(option);
|
|
|
}
|
|
|
+const change = (vale) => {
|
|
|
+ removeFile()
|
|
|
+ removeFile5()
|
|
|
+ let item = options.value.find(ele => ele.id == vale) || {}
|
|
|
+ isAnimation.value = item.useType == 'animation'
|
|
|
+console.log('change', vale, item)
|
|
|
+}
|
|
|
|
|
|
const handleAdd = async () => {
|
|
|
await addCaseScenes();
|