!485 临时解决编辑线上模板无法退出编辑状态问题

pull/485/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 12b3f8d86a
commit 067367d2b7

@ -44,13 +44,14 @@ export class TempEditor
* Viewer.Scene
*
*/
static End()
static async End()
{
this.EditorIng = false;
app.Viewer.Scene = this.viewerScene;
app.Viewer.Scene.add(app.Viewer.GripScene);
app.Editor.SelectCtrl.Cancel();
await app.Editor.ModalManage.EndExecingCmd();
let showLog = HostApplicationServices.ShowHistoryLog;
HostApplicationServices.ShowHistoryLog = false;
app.Database.hm.lockIndex = -1;

@ -13,6 +13,7 @@ import { UserConfig } from '../Board/UserConfig';
import TempalteActionList from './TemplateActionList';
import TemplateParamList from './TemplateParamList';
import { TemplateSaveDir } from './TemplateSaveDir';
import { AppToaster } from '../Toaster';
export interface ITemplateEditorProps
{
@ -22,6 +23,7 @@ export interface ITemplateEditorProps
@observer
export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
private normalExit = false; //是否正常退出
private _container: HTMLDivElement;
componentDidMount()
{
@ -36,6 +38,18 @@ export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
});
this.props.store.currentParamIndex = undefined;
}
async componentWillUnmount()
{
//TODO:临时解决无法退出编辑状态
if (!this.normalExit && this.props.tid)
{
AppToaster.show({
message: "暂无法支持编辑共同显示多个模态框,退出编辑状态",
timeout: 1500
});
await TempEditor.End();
}
}
public render()
{
const template = this.props.store.Template;
@ -114,6 +128,7 @@ export class TemplateEditor extends React.Component<ITemplateEditorProps, any> {
}
private handleClose = () =>
{
this.normalExit = true;
if (this.props.tid)
{
TempEditor.End();

@ -60,13 +60,13 @@ export class BoardEdgesEditor
this._editoring = true;
}
EndEditor(cancel = false)
async EndEditor(cancel = false)
{
if (!this._editoring)
return;
app.Viewer.CameraCtrl.ReadFile(this._cameraFiler);
this.ParseData();
TempEditor.End();
await TempEditor.End();
if (!cancel)
this.WriteData();

Loading…
Cancel
Save