!1798 修复:模板铰链配置界面关闭错误问题

pull/1808/MERGE
林三 3 years ago committed by ChenX
parent 8a8c97986c
commit 42505d243c

@ -444,6 +444,8 @@ export namespace CheckoutValid
return "数值不能为空,并且必须为数字";
return "";
case "doorThickness":
case "startDist":
case "endDist":
if (isNaN(val))
return "数值不能为空且必须为数字";
if (!(val > 0))

@ -22,13 +22,12 @@ const SelectStyle: React.CSSProperties = {
@observer
export class HingeRules extends React.Component<IHingeRulesProps> {
private onOpening(store: DoorStore)
private onOpening(store: DoorStore | HingeStore)
{
}
private onClosing(store: DoorStore)
private onClosing(store: DoorStore | HingeStore)
{
let error = store.CheckRule((store.uiRule));
if (error)
@ -41,6 +40,11 @@ export class HingeRules extends React.Component<IHingeRulesProps> {
}
}
componentWillUnmount()
{
this.onClosing(this.props.store);
}
public render()
{
const { store, uiOption } = this.props;
@ -65,7 +69,7 @@ export class HingeRules extends React.Component<IHingeRulesProps> {
/>
<PopoverContent
targetTitle="配置"
onOpening={() => this.onOpening(store)}
//onOpening={() => this.onOpening(store)}
onClosing={() => this.onClosing(store)}
>
<Card className="hinge-rules">

@ -251,7 +251,7 @@ export class DoorStore extends DoorDrawerStore
}
}
}
CheckRule(ruleOption)
CheckRule(ruleOption: IUiOption<IHingeRule>)
{
return CheckoutValid.HasInvailValue(ruleOption, CheckObjectType.Do);
}

@ -1,5 +1,6 @@
import { Intent } from "@blueprintjs/core";
import { observable, toJS } from "mobx";
import { CheckObjectType, CheckoutValid } from "../../../Common/CheckoutVaildValue";
import { DataAdapter } from "../../../Common/DataAdapter";
import { DefaultHingeOption } from "../../../Editor/DefaultConfig";
import { IConfigOption } from "../../Components/Board/UserConfig";
@ -125,4 +126,8 @@ export class HingeStore extends BoardStore
}
}
}
CheckRule(ruleOption: IUiOption<IHingeRule>)
{
return CheckoutValid.HasInvailValue(ruleOption, CheckObjectType.Do);
}
}

Loading…
Cancel
Save