|
|
@@ -7,13 +7,6 @@
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
|
<div class="upload-container">
|
|
|
- <!-- <div class="group-select">
|
|
|
- <span style="margin-right: 10px"><span class="required">*</span>资源包类型</span>
|
|
|
- <el-radio-group v-model="sourceType">
|
|
|
- <el-radio value="orig">原始数据</el-radio>
|
|
|
- <el-radio value="offline">离线包</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </div> -->
|
|
|
<div class="upload-area" style="display: flex;">
|
|
|
<p class="upload-title"><span class="required">*</span>文件</p>
|
|
|
<el-upload
|
|
|
@@ -33,6 +26,10 @@
|
|
|
</div>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
+ <div class="group-select">
|
|
|
+ <span style="margin-right: 10px; opacity: 0;">资源包类型</span>
|
|
|
+ <el-checkbox v-model="genGs">生成3DGS数据</el-checkbox>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<template #footer>
|
|
|
@@ -59,7 +56,8 @@ const props = defineProps({
|
|
|
|
|
|
const selectedGroup = ref('');
|
|
|
const sourceType = ref('orig');
|
|
|
-const filePath = ref(null);
|
|
|
+const genGs = ref(false);
|
|
|
+const filePath = ref('');
|
|
|
const emit = defineEmits(['update:visible', 'refresh']);
|
|
|
const acceptType = computed(() => {
|
|
|
if (selectedGroup.value == 1) {
|
|
|
@@ -87,14 +85,14 @@ const handleChange = async (file, files) => {
|
|
|
}else{
|
|
|
files.status = 'fail'
|
|
|
fileList.value = [];
|
|
|
- filePath.value = null;
|
|
|
+ filePath.value = '';
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
ElMessage.error(file.message || `不支持的文件类型`);
|
|
|
files.status = 'fail'
|
|
|
fileList.value = [];
|
|
|
- filePath.value = null;
|
|
|
+ filePath.value = '';
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -113,7 +111,7 @@ const handleFileChange = (file, files) => {
|
|
|
}
|
|
|
} else {
|
|
|
fileList.value = [];
|
|
|
- filePath.value = null;
|
|
|
+ filePath.value = '';
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -150,6 +148,8 @@ const handleFileRemove = (file, fileList) => {
|
|
|
const handleClose = () => {
|
|
|
dialogVisible.value = false;
|
|
|
selectedGroup.value = '';
|
|
|
+ genGs.value = false;
|
|
|
+ filePath.value = '';
|
|
|
fileList.value = [];
|
|
|
};
|
|
|
|
|
|
@@ -169,15 +169,15 @@ const handleUpload = async () => {
|
|
|
formData.append('file', file.raw);
|
|
|
});
|
|
|
|
|
|
- await uploadScene({sourceType: sourceType.value, filePath: filePath.value});
|
|
|
+ await uploadScene({sourceType: sourceType.value, filePath: filePath.value, genGs: genGs.value?1:0, formData });
|
|
|
|
|
|
ElMessage.success('上传成功');
|
|
|
- handleClose();
|
|
|
emit('refresh');
|
|
|
+ handleClose();
|
|
|
} catch (error) {
|
|
|
console.error('上传失败:', error);
|
|
|
fileList.value = [];
|
|
|
- filePath.value = null;
|
|
|
+ filePath.value = '';
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -210,7 +210,7 @@ const handleUpload = async () => {
|
|
|
}
|
|
|
|
|
|
.upload-area {
|
|
|
- margin-bottom: 20px;
|
|
|
+ //margin-bottom: 20px;
|
|
|
.upload-box{
|
|
|
width: calc(100% - 100px);
|
|
|
}
|