!1758 修复:门板铰链配置输入框部分问题

pull/1755/MERGE
林三 3 years ago committed by ChenX
parent 21a50a6f2e
commit 833e1956f7

@ -460,6 +460,7 @@ export namespace CheckoutValid
case "leftDoorSeal":
case "rightDoorSeal":
case "hingeCount":
case "count":
if (v.includes(','))
return "表达式不能有逗号";
if (isNaN(val))

@ -20,6 +20,26 @@ const SelectStyle: React.CSSProperties = {
@observer
export class HingeRules extends React.Component<IHingeRulesProps> {
private onOpening(store: DoorStore)
{
}
private onClosing(store: DoorStore)
{
let error = store.CheckRule((store.uiRule));
if (error)
{
store.uiRule.count = store.currentRule.count.toString();
store.uiRule.down = store.currentRule.down.toString();
store.uiRule.endDist = store.currentRule.endDist.toString();
store.uiRule.startDist = store.currentRule.startDist.toString();
store.uiRule.up = store.currentRule.up.toString();
}
}
public render()
{
const { store, uiOption } = this.props;
@ -44,6 +64,8 @@ export class HingeRules extends React.Component<IHingeRulesProps> {
/>
<PopoverContent
targetTitle="配置"
onOpening={() => this.onOpening(store)}
onClosing={() => this.onClosing(store)}
>
<Card className="hinge-rules">
<H5></H5>

@ -1,5 +1,5 @@
import { Button, IconName, Intent, MaybeElement, Popover, Position } from '@blueprintjs/core';
import * as React from 'react';
import { Popover, Position, Button, Intent, Classes, Card, IconName, MaybeElement } from '@blueprintjs/core';
import { KeyBoard } from '../../../Common/KeyEnum';
interface IPopOverContentProps
@ -12,6 +12,8 @@ interface IPopOverContentProps
style?: React.CSSProperties;
className?: string;
intent?: Intent;
onClosing?: () => void;
onOpening?: () => void;
}
export class PopoverContent extends React.Component<IPopOverContentProps> {
@ -28,12 +30,16 @@ export class PopoverContent extends React.Component<IPopOverContentProps> {
disabled={this.props.disabled}
onOpening={e =>
{
if (this.props.onOpening)
this.props.onOpening();
e.tabIndex = -1;
e.focus();
e.addEventListener("keydown", this.handleKeyDown);
}}
onClosing={e =>
{
if (this.props.onClosing)
this.props.onClosing();
e.removeEventListener('keydown', this.handleKeyDown);
if (this.props.closeFocusElement)
this.props.closeFocusElement.focus();
@ -60,6 +66,7 @@ export class PopoverContent extends React.Component<IPopOverContentProps> {
{
if (this.cancelBtn)
this.cancelBtn.click();
e.preventDefault();
}
else if (e.keyCode === KeyBoard.Escape)
{

@ -1,14 +1,15 @@
import { Intent } from "@blueprintjs/core";
import { observable, toJS } from "mobx";
import { DoorOpenDir, IDoorConfigOption, IDoorInfo } from "../DoorInterface";
import { DoorDrawerStore } from "./DoorDrawerStore";
import { CheckObjectType, CheckoutValid } from "../../../Common/CheckoutVaildValue";
import { DataAdapter } from "../../../Common/DataAdapter";
import { DefaultDoorOption } from "../../../Editor/DefaultConfig";
import { IConfigOption } from "../../Components/Board/UserConfig";
import { FixErrorDataConfig } from "../BoardStore";
import { IUiOption } from "../BoardInterface";
import { DataAdapter } from "../../../Common/DataAdapter";
import { AppConfirm } from "../../Components/Common/Confirm";
import { AppToaster } from "../../Components/Toaster";
import { Intent } from "@blueprintjs/core";
import { IUiOption } from "../BoardInterface";
import { FixErrorDataConfig } from "../BoardStore";
import { DoorOpenDir, IDoorConfigOption, IDoorInfo } from "../DoorInterface";
import { DoorDrawerStore } from "./DoorDrawerStore";
export const openDirTitle = {}; //门板开门类型对应
openDirTitle[DoorOpenDir.Left] = "左";
@ -250,4 +251,8 @@ export class DoorStore extends DoorDrawerStore
}
}
}
CheckRule(ruleOption)
{
return CheckoutValid.HasInvailValue(ruleOption, CheckObjectType.Do);
}
}

Loading…
Cancel
Save