!1077 修复:编辑模块问题

pull/1077/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 690dd8625f
commit 4c3c7727ce

@ -26,7 +26,7 @@ export class EditorWineRack implements Command
let editorTemp = brs[0].Template.Object as TemplateWineRackRecord;
const store = WineRackStore.GetInstance() as WineRackStore;
store.editorTemplate = editorTemp;
store.EditorTemplate = editorTemp;
store.UpdateOption({ option: editorTemp.Option });
app.Editor.ModalManage.RenderModal(WineRackModal, { store });
}

@ -108,7 +108,7 @@ export class UserConfig extends React.Component<IConfigProps, UserConfigState>{
curName = confNames[0];
this.props.store.configName = curName;
if (type !== BoardModalType.TempDes && (!userConfig.keepConfig || !this._userConfigStore.readConfigs.has(type)))
if (type !== BoardModalType.TempDes && !this.props.store.EditorTemplate && (!userConfig.keepConfig || !this._userConfigStore.readConfigs.has(type)))
this.updateBoardOption(curName);
}
if (type === BoardModalType.TempDes)

@ -42,15 +42,15 @@ export class WineRackModal extends React.Component<{ store?: WineRackStore; }, {
}
app.Editor.ModalManage.Destory();
if (this.props.store.editorTemplate)
if (this.props.store.EditorTemplate)
{
await CommandWrap(async () =>
{
let temp = this.props.store.editorTemplate;
let temp = this.props.store.EditorTemplate;
temp.Option = opt;
await temp.UpdateTemplateTree();
app.Editor.UpdateScreen();
this.props.store.editorTemplate = undefined;
this.props.store.EditorTemplate = undefined;
}, "编辑酒格");
}
else
@ -131,7 +131,7 @@ export class WineRackModal extends React.Component<{ store?: WineRackStore; }, {
icon={IconNames.REGRESSION_CHART}
close={() =>
{
this.props.store.editorTemplate = undefined;
this.props.store.EditorTemplate = undefined;
app.Editor.ModalManage.Destory();
}}
bodyClass="door"
@ -140,7 +140,7 @@ export class WineRackModal extends React.Component<{ store?: WineRackStore; }, {
footerChildren={
<>
<Button
text={this.props.store.editorTemplate === undefined ? "绘制" : "更新"}
text={this.props.store.EditorTemplate === undefined ? "绘制" : "更新"}
intent={Intent.SUCCESS}
onClick={this.handleExec}
/>
@ -149,7 +149,7 @@ export class WineRackModal extends React.Component<{ store?: WineRackStore; }, {
intent={Intent.DANGER}
onClick={() =>
{
this.props.store.editorTemplate = undefined;
this.props.store.EditorTemplate = undefined;
app.Editor.ModalManage.Destory();
}}
/>

@ -27,6 +27,7 @@ export interface IConfigStore
SaveConfig: () => IConfigOption;
UpdateOption: Function;
HasInvailValue?: () => boolean;
EditorTemplate?: TemplateRecord;
}
export class BoardStore extends Singleton implements IConfigStore

@ -9,7 +9,7 @@ import { IWineRackOption } from "./WineRackInterface";
export class WineRackStore extends BoardStore
{
editorTemplate: TemplateWineRackRecord;
EditorTemplate: TemplateWineRackRecord;
@observable m_Option: IWineRackOption = Object.assign({}, DefaultWineRackConfig);
HasInvailValue()
{

Loading…
Cancel
Save