!558 优化排钻类型显示 fixes #I13JM3

pull/558/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent dc805c6d9b
commit 2b898356a4

@ -11,6 +11,7 @@ import { RightTabId } from '../RightPanel/RightPanel';
import { ToasterInput } from '../Toaster';
import { GetEntity } from '../../../Common/Utils';
import { safeEval } from '../../../Common/eval';
import { EBoardKeyList } from '../../../Common/BoardKeyList';
type OptionType = BoardOption | DrillingOption;
@ -482,10 +483,10 @@ export class DrillTypeSelectCom extends React.Component<IDrillTypeSelect, { isDa
{
options.unshift(DrillType.More);
}
if (!options.includes(this.props.opt.drillType))
if (!options.includes(this.props.opt.drillType) || this.props.opt.highDrill.some(t => !options.includes(t)))
{
if (this.props.br)
options.unshift("无效配置");
options.unshift(DrillType.Invail);
}
return options;
}
@ -529,11 +530,13 @@ export class DrillTypeSelectCom extends React.Component<IDrillTypeSelect, { isDa
UNSAFE_componentWillMount()
{
const options = this.Options;
if (!options.includes(this.props.opt.drillType))
if (options[0] === DrillType.Invail || !options.includes(this.props.opt.drillType))
{
if (this.props.br)
{
this.props.opt[EBoardKeyList.DrillType] = DrillType.Invail;
this.setState({ isDanger: true });
}
else
this.props.opt.drillType = options[0];
}

@ -19,6 +19,7 @@ export enum DrillType
Yes = "排",
None = "不排",
More = "**多种**",
Invail = "无效配置",
}
//偏心轮类型
export enum FaceDirection

Loading…
Cancel
Save