!1066 优化:取消放弃保存时进入绘图界面

pull/1066/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 02c00eab96
commit cbdcaafca5

@ -70,8 +70,15 @@ export class FileServer extends Singleton
{ {
if (this.m_CurFileId !== fid) if (this.m_CurFileId !== fid)
{ {
if (!app.Saved && !confirm("您当前图纸还未保存,是否放弃保存?")) if (!app.Saved)
return; {
let status = await AppConfirm.show({
message: "您当前图纸还未保存,是否放弃保存?"
});
if (!status)
return false;
}
try try
{ {
let info = await this.GetFileInfo(fid); let info = await this.GetFileInfo(fid);

@ -16,18 +16,16 @@ export class ContentComponent extends React.Component<{ store?: TopPanelStore; }
//添加新文件 //添加新文件
handleAddNewFile = async () => handleAddNewFile = async () =>
{ {
let res = await (FileServer.GetInstance() as FileServer).AddNewFile(); await (FileServer.GetInstance() as FileServer).AddNewFile();
if (res) this.props.store.openMain = false;
{ this.props.store.editoring = true;
this.props.store.openMain = false;
this.props.store.editoring = true;
}
}; };
handleOpenFile = async (fid: string) => handleOpenFile = async (fid: string) =>
{ {
await (FileServer.GetInstance() as FileServer).OpenFile(fid);
this.props.store.openMain = false; this.props.store.openMain = false;
this.props.store.editoring = true; this.props.store.editoring = true;
(FileServer.GetInstance() as FileServer).OpenFile(fid);
}; };
async componentDidMount() async componentDidMount()
{ {

Loading…
Cancel
Save