fix: 优化 MapConverterModal 组件中的代码格式,简化输出文件名的处理逻辑

This commit is contained in:
xudan 2025-10-14 15:36:04 +08:00
parent 53332fca93
commit 5967f0b45c

View File

@ -88,7 +88,7 @@
import { InboxOutlined } from '@ant-design/icons-vue';
import http from '@core/http';
import { message, type UploadChangeParam } from 'ant-design-vue';
import { computed, reactive, ref, watch, type Ref } from 'vue';
import { computed, reactive, type Ref, ref, watch } from 'vue';
type ConversionType = 'scene' | 'iray' | 'scene-to-smap';
@ -345,9 +345,7 @@ const handleConvert = async () => {
const blob = new Blob([smapContent], { type: 'application/json' });
revokeDownloadUrl();
downloadUrl.value = URL.createObjectURL(blob);
const outputFile = data.data?.output_file
? data.data.output_file.split(/[/\\]/).pop()
: undefined;
const outputFile = data.data?.output_file ? data.data.output_file.split(/[/\\]/).pop() : undefined;
downloadFilename.value = outputFile || 'updated.smap';
message.success('转换成功,已生成 SMAP 文件。');
}