!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; let editorTemp = brs[0].Template.Object as TemplateWineRackRecord;
const store = WineRackStore.GetInstance() as WineRackStore; const store = WineRackStore.GetInstance() as WineRackStore;
store.editorTemplate = editorTemp; store.EditorTemplate = editorTemp;
store.UpdateOption({ option: editorTemp.Option }); store.UpdateOption({ option: editorTemp.Option });
app.Editor.ModalManage.RenderModal(WineRackModal, { store }); app.Editor.ModalManage.RenderModal(WineRackModal, { store });
} }

@ -108,7 +108,7 @@ export class UserConfig extends React.Component<IConfigProps, UserConfigState>{
curName = confNames[0]; curName = confNames[0];
this.props.store.configName = curName; 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); this.updateBoardOption(curName);
} }
if (type === BoardModalType.TempDes) if (type === BoardModalType.TempDes)

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

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

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

Loading…
Cancel
Save