fix: 优化 MapConverterModal 组件中的代码格式,简化输出文件名的处理逻辑
This commit is contained in:
parent
53332fca93
commit
5967f0b45c
@ -88,7 +88,7 @@
|
|||||||
import { InboxOutlined } from '@ant-design/icons-vue';
|
import { InboxOutlined } from '@ant-design/icons-vue';
|
||||||
import http from '@core/http';
|
import http from '@core/http';
|
||||||
import { message, type UploadChangeParam } from 'ant-design-vue';
|
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';
|
type ConversionType = 'scene' | 'iray' | 'scene-to-smap';
|
||||||
|
|
||||||
@ -345,9 +345,7 @@ const handleConvert = async () => {
|
|||||||
const blob = new Blob([smapContent], { type: 'application/json' });
|
const blob = new Blob([smapContent], { type: 'application/json' });
|
||||||
revokeDownloadUrl();
|
revokeDownloadUrl();
|
||||||
downloadUrl.value = URL.createObjectURL(blob);
|
downloadUrl.value = URL.createObjectURL(blob);
|
||||||
const outputFile = data.data?.output_file
|
const outputFile = data.data?.output_file ? data.data.output_file.split(/[/\\]/).pop() : undefined;
|
||||||
? data.data.output_file.split(/[/\\]/).pop()
|
|
||||||
: undefined;
|
|
||||||
downloadFilename.value = outputFile || 'updated.smap';
|
downloadFilename.value = outputFile || 'updated.smap';
|
||||||
message.success('转换成功,已生成 SMAP 文件。');
|
message.success('转换成功,已生成 SMAP 文件。');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user