mirror of https://gitee.com/cf-fz/WebCAD.git
parent
974136b833
commit
a508c4acbe
@ -0,0 +1,32 @@
|
||||
import { Command } from "../Editor/CommandMachine";
|
||||
import { FileServer } from "../DatabaseServices/FileServer";
|
||||
import { app } from "../ApplicationServices/Application";
|
||||
import { IsDev } from "../Common/Deving";
|
||||
export class ReOpen implements Command
|
||||
{
|
||||
async exec()
|
||||
{
|
||||
if (!IsDev() && !app.Saved)
|
||||
{
|
||||
let res = await app.Editor.GetKeyWords({
|
||||
Msg: "当前图纸未保存,是否放弃当前图纸继续新建?",
|
||||
KeyWordList: [
|
||||
{ key: "Y", msg: "是" },
|
||||
{ key: "N", msg: "否" },
|
||||
],
|
||||
Default: "N"
|
||||
});
|
||||
if (res.StringResult !== "Y")
|
||||
return;
|
||||
}
|
||||
|
||||
let fileServer = FileServer.GetInstance() as FileServer;
|
||||
if (fileServer.m_CurFileId)
|
||||
{
|
||||
let id = fileServer.m_CurFileId;
|
||||
app.CreateDocument();
|
||||
fileServer.m_CurFileId = undefined;
|
||||
fileServer.OpenFile(id);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue