|
|
|
@ -1,22 +1,27 @@
|
|
|
|
|
import { Button, Checkbox, Classes, Radio, RadioGroup,Icon } from '@blueprintjs/core';
|
|
|
|
|
import { Button, Checkbox, Classes, HTMLSelect, Icon, Radio, RadioGroup } from '@blueprintjs/core';
|
|
|
|
|
import { observable } from 'mobx';
|
|
|
|
|
|
|
|
|
|
import { inject, observer } from 'mobx-react';
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import * as xaop from 'xaop';
|
|
|
|
|
import { app } from '../../../ApplicationServices/Application';
|
|
|
|
|
import { DataAdapter } from '../../../Common/DataAdapter';
|
|
|
|
|
import { KeyBoard } from '../../../Common/KeyEnum';
|
|
|
|
|
import { commandMachine } from '../../../Editor/CommandMachine';
|
|
|
|
|
import { DrillStore } from '../../Store/DrillStore';
|
|
|
|
|
import { ModalState } from '../Modal/ModalsManage';
|
|
|
|
|
import { ItemName, SetBoardDataItem } from './BoardCommon';
|
|
|
|
|
import { BoardModalType } from './BoardModal';
|
|
|
|
|
import { DrillType, SpacingType } from './drillInterface';
|
|
|
|
|
import { DrillRulesComponent } from './DrillRules';
|
|
|
|
|
import { UserConfig } from './UserConfig';
|
|
|
|
|
import { commandMachine } from '../../../Editor/CommandMachine';
|
|
|
|
|
import { ModalState } from '../Modal/ModalsManage';
|
|
|
|
|
import { KeyBoard } from '../../../Common/KeyEnum';
|
|
|
|
|
import * as xaop from 'xaop';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@inject('store')
|
|
|
|
|
@observer
|
|
|
|
|
export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
@observable private showData;
|
|
|
|
|
|
|
|
|
|
private posPars = [["originDist", "起始距离"], ["retDist", "剩余距离"]];
|
|
|
|
|
private holePars = [
|
|
|
|
|
["wbHoleRad", "大孔半径"], ["wbHoleDepth", "大孔深度"],
|
|
|
|
@ -28,7 +33,11 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
["ljgRad", "连接杆半径"], ["ljgLength", "连接杆长度"],
|
|
|
|
|
["ymjRad", "预埋件半径"], ["ymjDepth", "预埋件深度"]
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
constructor(props)
|
|
|
|
|
{
|
|
|
|
|
super(props);
|
|
|
|
|
this.showData = DataAdapter.ConvertUIData(this.props.store.m_BoardOption);
|
|
|
|
|
}
|
|
|
|
|
registerEvent()
|
|
|
|
|
{
|
|
|
|
|
let store = this.props.store;
|
|
|
|
@ -75,15 +84,19 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
{
|
|
|
|
|
store.type = e.currentTarget.value as DrillType;
|
|
|
|
|
if (store.type === DrillType.Three){
|
|
|
|
|
store. m_BoardOption.name = "三合一";
|
|
|
|
|
store. m_BoardOption.pxlRad="7.5";
|
|
|
|
|
store. m_BoardOption.ljgLength="34";
|
|
|
|
|
store.m_BoardOption.name = "三合一";
|
|
|
|
|
store.m_BoardOption.pxlRad=7.5;
|
|
|
|
|
store.m_BoardOption.ljgLength=34;
|
|
|
|
|
this.showData["pxlRad"]="7.5";
|
|
|
|
|
this.showData["ljgLength"]="34";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
store. m_BoardOption.name = "二合一";
|
|
|
|
|
store. m_BoardOption.pxlRad = "10";
|
|
|
|
|
store. m_BoardOption.ljgLength = "10";
|
|
|
|
|
store.m_BoardOption.name = "二合一";
|
|
|
|
|
store.m_BoardOption.pxlRad = 10;
|
|
|
|
|
store.m_BoardOption.ljgLength = 10;
|
|
|
|
|
this.showData["pxlRad"] = "10";
|
|
|
|
|
this.showData["ljgLength"] = "10";
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
@ -104,11 +117,12 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
<ItemName title="拆单名" opt={store. m_BoardOption} className="small-name"/>
|
|
|
|
|
<SetBoardDataItem
|
|
|
|
|
optKey="count"
|
|
|
|
|
option={store. m_BoardOption}
|
|
|
|
|
option={store.m_BoardOption}
|
|
|
|
|
uiOption={this.showData}
|
|
|
|
|
title="数量"
|
|
|
|
|
onChange={()=>{
|
|
|
|
|
if (parseFloat(store. m_BoardOption.count) <= 2 && store. m_BoardOption.haveDist){
|
|
|
|
|
store. m_BoardOption.haveDist=false
|
|
|
|
|
if (parseFloat(this.showData["count"]) <= 2 && this.showData["haveDist"]){
|
|
|
|
|
store.m_BoardOption.haveDist=false;
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
@ -119,7 +133,8 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
<SetBoardDataItem
|
|
|
|
|
key={k}
|
|
|
|
|
optKey={k}
|
|
|
|
|
option={store. m_BoardOption}
|
|
|
|
|
option={store.m_BoardOption}
|
|
|
|
|
uiOption={this.showData}
|
|
|
|
|
title={v}
|
|
|
|
|
isDisabled={
|
|
|
|
|
(k === "retDist" && store. m_BoardOption.isEqualProportion)
|
|
|
|
@ -136,7 +151,8 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
selectedValue={store. m_BoardOption.spacing}
|
|
|
|
|
onChange={e =>
|
|
|
|
|
{
|
|
|
|
|
store. m_BoardOption.spacing = e.currentTarget.value as SpacingType;
|
|
|
|
|
this.showData.spacing = e.currentTarget.value;
|
|
|
|
|
store.m_BoardOption.spacing = e.currentTarget.value as SpacingType;
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Radio label="间距等分" disabled={store. m_BoardOption.isEqualProportion ||store. m_BoardOption.isFromBack} value={SpacingType.EqualDist} />
|
|
|
|
@ -169,10 +185,10 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
<div>
|
|
|
|
|
<Checkbox
|
|
|
|
|
disabled={
|
|
|
|
|
store. m_BoardOption.isForceDiv
|
|
|
|
|
|| !store. m_BoardOption.count
|
|
|
|
|
|| parseFloat(store. m_BoardOption.count) <= 2
|
|
|
|
|
|| store. m_BoardOption.spacing===SpacingType.EqualDist
|
|
|
|
|
store.m_BoardOption.isForceDiv
|
|
|
|
|
|| !store.m_BoardOption.count
|
|
|
|
|
|| parseFloat(this.showData.count) <= 2
|
|
|
|
|
|| store.m_BoardOption.spacing===SpacingType.EqualDist
|
|
|
|
|
}
|
|
|
|
|
checked={store. m_BoardOption.haveDist}
|
|
|
|
|
inline={true}
|
|
|
|
@ -180,12 +196,15 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
onChange={() => store. m_BoardOption.haveDist = !store. m_BoardOption.haveDist}
|
|
|
|
|
/>
|
|
|
|
|
<input
|
|
|
|
|
disabled={store. m_BoardOption.isForceDiv || !store. m_BoardOption.count || parseFloat(store. m_BoardOption.count) <= 2}
|
|
|
|
|
disabled={store.m_BoardOption.isForceDiv
|
|
|
|
|
|| this.showData.count===""
|
|
|
|
|
|| parseFloat(this.showData.count) <= 2}
|
|
|
|
|
className="bp3-input dist-input"
|
|
|
|
|
value={store. m_BoardOption.dist2To1Dist}
|
|
|
|
|
value={this.showData.dist2To1Dist}
|
|
|
|
|
onChange={e =>
|
|
|
|
|
{
|
|
|
|
|
store. m_BoardOption.dist2To1Dist = e.target.value;
|
|
|
|
|
this.showData.dist2To1Dist = e.target.value;
|
|
|
|
|
store.m_BoardOption.dist2To1Dist = parseFloat(e.target.value);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
@ -196,10 +215,11 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
className="bp3-input"
|
|
|
|
|
value={store. m_BoardOption.pxlOffset}
|
|
|
|
|
value={this.showData.pxlOffset}
|
|
|
|
|
onChange={e =>
|
|
|
|
|
{
|
|
|
|
|
store. m_BoardOption.pxlOffset = e.target.value;
|
|
|
|
|
store.m_BoardOption.pxlOffset = parseFloat(e.target.value);
|
|
|
|
|
this.showData.pxlOffset = e.target.value;
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
@ -207,10 +227,11 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
<span>排钻碰撞偏移距离:</span>
|
|
|
|
|
<input
|
|
|
|
|
className="bp3-input"
|
|
|
|
|
value={store. m_BoardOption.collsionDist}
|
|
|
|
|
value={this.showData.collsionDist}
|
|
|
|
|
onChange={e =>
|
|
|
|
|
{
|
|
|
|
|
store. m_BoardOption.collsionDist = e.target.value;
|
|
|
|
|
store.m_BoardOption.collsionDist = parseFloat(e.target.value);
|
|
|
|
|
this.showData.collsionDist = e.target.value;
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
@ -273,14 +294,17 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<Checkbox checked={true} inline={true} label="使用模板" />
|
|
|
|
|
<div className="bp3-select bp3-inline .modifier">
|
|
|
|
|
<select>
|
|
|
|
|
<option value="0">模板1</option>
|
|
|
|
|
<option value="1">模板1</option>
|
|
|
|
|
<option value="1">模板1</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<Checkbox checked={false} inline={true} label="使用模板" />
|
|
|
|
|
<HTMLSelect
|
|
|
|
|
options={
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
label:"模板",
|
|
|
|
|
value:""
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<h5 className={Classes.HEADING}>木销参数</h5>
|
|
|
|
|
<Checkbox
|
|
|
|
@ -307,10 +331,14 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
<div className="small-input flexWrap flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<span>当板厚小于</span>
|
|
|
|
|
<input type="text" className="bp3-input" value={store. m_BoardOption.notGangDist} onChange={e =>
|
|
|
|
|
{
|
|
|
|
|
store. m_BoardOption.notGangDist = e.target.value;
|
|
|
|
|
}} />
|
|
|
|
|
<input
|
|
|
|
|
className="bp3-input"
|
|
|
|
|
value={this.showData.notGangDist}
|
|
|
|
|
onChange={e =>
|
|
|
|
|
{
|
|
|
|
|
this.showData.notGangDist = e.target.value;
|
|
|
|
|
store.m_BoardOption.notGangDist = parseFloat(e.target.value);
|
|
|
|
|
}} />
|
|
|
|
|
<span>不排钻</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -318,7 +346,7 @@ export class DrillModal extends React.Component<{ store?: DrillStore }, {}> {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="bp3-card small-input flex flex-col">
|
|
|
|
|
<DrillRulesComponent store={store} />
|
|
|
|
|
<DrillRulesComponent store={store} data={this.showData} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|