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

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

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

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

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

Loading…
Cancel
Save