|
|
|
@ -43,20 +43,34 @@ export class Save implements Command
|
|
|
|
|
|
|
|
|
|
export class New implements Command
|
|
|
|
|
{
|
|
|
|
|
NoHistory = true;
|
|
|
|
|
async exec()
|
|
|
|
|
{
|
|
|
|
|
let server = FileServer.GetInstance() as FileServer;
|
|
|
|
|
if (server.m_CurFileId)
|
|
|
|
|
|
|
|
|
|
if (server.m_CurFileId === undefined) //TODO: 或者 如果图纸未保存则提醒保存
|
|
|
|
|
{
|
|
|
|
|
server.m_CurFileId = undefined;
|
|
|
|
|
app.CreateDocument();
|
|
|
|
|
RightPanelStore.GetInstance().lightStore.InitScene();
|
|
|
|
|
let res = await app.Editor.GetKeyWords({
|
|
|
|
|
Msg: "当前图纸未保存,是否放弃当前图纸继续新建?",
|
|
|
|
|
KeyWordList: [
|
|
|
|
|
{ key: "Y", msg: "是" },
|
|
|
|
|
{ key: "N", msg: "否" },
|
|
|
|
|
],
|
|
|
|
|
Default: "N"
|
|
|
|
|
});
|
|
|
|
|
if (res.StringResult !== "Y")
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server.m_CurFileId = undefined;
|
|
|
|
|
app.CreateDocument();
|
|
|
|
|
RightPanelStore.GetInstance().lightStore.InitScene();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class SaveAs implements Command
|
|
|
|
|
{
|
|
|
|
|
NoHistory = true;
|
|
|
|
|
async exec()
|
|
|
|
|
{
|
|
|
|
|
let fileData = app.FileOut().Data;
|
|
|
|
@ -66,6 +80,7 @@ export class SaveAs implements Command
|
|
|
|
|
|
|
|
|
|
export class SaveAsBinary implements Command
|
|
|
|
|
{
|
|
|
|
|
NoHistory = true;
|
|
|
|
|
async exec()
|
|
|
|
|
{
|
|
|
|
|
let fileData = app.FileOut2().Data;
|
|
|
|
|