!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 (!app.Saved && !confirm("您当前图纸还未保存,是否放弃保存?"))
return;
if (!app.Saved)
{
let status = await AppConfirm.show({
message: "您当前图纸还未保存,是否放弃保存?"
});
if (!status)
return false;
}
try
{
let info = await this.GetFileInfo(fid);

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

Loading…
Cancel
Save