File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
app/src/pages/_fixed_panel Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { StageExportPng } from "../../core/service/dataGenerateService/stageExpo
77import { Camera } from "../../core/stage/Camera" ;
88import { Dialog } from "../../components/dialog" ;
99import { Download , RefreshCcw } from "lucide-react" ;
10+ import { Stage } from "../../core/stage/Stage" ;
11+ import { PathString } from "../../utils/pathString" ;
1012
1113/**
1214 * 导出png的面板
@@ -29,7 +31,14 @@ export default function ExportPNGPanel() {
2931 if ( image ) {
3032 const a = document . createElement ( "a" ) ;
3133 a . href = image . src ;
32- a . download = `${ 123456 } .png` ;
34+
35+ let fileName = "file" ;
36+ if ( Stage . path . isDraft ( ) ) {
37+ fileName = "草稿" ;
38+ } else {
39+ fileName = PathString . getFileNameFromPath ( Stage . path . getFilePath ( ) ) ;
40+ }
41+ a . download = `${ fileName } .png` ;
3342 a . click ( ) ;
3443 } else {
3544 Dialog . show ( {
@@ -49,7 +58,10 @@ export default function ExportPNGPanel() {
4958 ) }
5059 >
5160 < h2 > 导出png图片</ h2 >
52- < div className = "bg-panel-bg flex h-96 w-full items-center justify-center rounded-md" id = "export-png-image-box" >
61+ < div
62+ className = "bg-panel-bg flex h-96 w-full items-center justify-center overflow-auto rounded-md"
63+ id = "export-png-image-box"
64+ >
5365 < span > 暂时没有渲染结果,请先点击渲染图片</ span >
5466 </ div >
5567 < div className = "flex w-full items-center" >
You can’t perform that action at this time.
0 commit comments