!2794 新增:板件属性增加图纸拾取材料功能

pull/2887/MERGE
钱若寒 3 months ago committed by 黄诗津
parent 6e515738d2
commit 2bd7d6f5ff

@ -82,7 +82,7 @@ export class Rec2BrModal extends React.Component<{ store: Rec2BrStore; }, {}>
this.removeFuncs.length = 0; this.removeFuncs.length = 0;
} }
//拾取 距离 板件 模板 //拾取 距离 板件 模板
private getOption = async (state: GetOptionState) => private getOption = async (state: GetOptionState, isMaterial?: Boolean) =>
{ {
app.Editor.ModalManage.ToggleShow(); app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.Clear(); app.Editor.MaskManage.Clear();
@ -96,10 +96,22 @@ export class Rec2BrModal extends React.Component<{ store: Rec2BrStore; }, {}>
if (enRes1.Status === PromptStatus.OK) if (enRes1.Status === PromptStatus.OK)
{ {
const data = (enRes1.Entity as Board).BoardProcessOption; const data = (enRes1.Entity as Board).BoardProcessOption;
this.props.store.m_Option.roomName = data[EBoardKeyList.RoomName]; if (isMaterial)
this.props.store.UIOption.roomName = data[EBoardKeyList.RoomName]; {
this.props.store.m_Option.cabinetName = data[EBoardKeyList.CabinetName]; this.props.store.m_Option.boardMatName = data[EBoardKeyList.BrMat];
this.props.store.UIOption.cabinetName = data[EBoardKeyList.CabinetName]; this.props.store.UIOption.boardMatName = data[EBoardKeyList.BrMat];
this.props.store.m_Option.color = data[EBoardKeyList.Color];
this.props.store.UIOption.color = data[EBoardKeyList.Color];
this.props.store.m_Option.material = data[EBoardKeyList.Mat];
this.props.store.UIOption.material = data[EBoardKeyList.Mat];
}
else
{
this.props.store.m_Option.roomName = data[EBoardKeyList.RoomName];
this.props.store.UIOption.roomName = data[EBoardKeyList.RoomName];
this.props.store.m_Option.cabinetName = data[EBoardKeyList.CabinetName];
this.props.store.UIOption.cabinetName = data[EBoardKeyList.CabinetName];
}
} }
break; break;
case GetOptionState.GetDistance: case GetOptionState.GetDistance:

@ -1,4 +1,4 @@
import { Card, Classes, H5, HTMLSelect } from "@blueprintjs/core"; import { Button, Card, Classes, H5, HTMLSelect } from "@blueprintjs/core";
import { observable } from 'mobx'; import { observable } from 'mobx';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
@ -14,11 +14,12 @@ import { Rec2BrStore } from './Rec2BrStore';
export interface IR2BProcessComponentProps export interface IR2BProcessComponentProps
{ {
store: Rec2BrStore; store: Rec2BrStore;
getOption: (state: GetOptionState) => void; getOption: (state: GetOptionState, isMaterial?: Boolean) => void;
} }
@observer @observer
export class R2BProcessComponent extends React.Component<IR2BProcessComponentProps> { export class R2BProcessComponent extends React.Component<IR2BProcessComponentProps>
{
private showShops = observable.box(false); private showShops = observable.box(false);
private matPars = [ private matPars = [
@ -45,6 +46,8 @@ export class R2BProcessComponent extends React.Component<IR2BProcessComponentPro
className="bp3-button bp3-intent-success" className="bp3-button bp3-intent-success"
onClick={() => this.showShops.set(true)} onClick={() => this.showShops.set(true)}
></button> ></button>
<Button style={{ width: "2rem", height: "80px" }} text="拾取" intent="success"
onClick={() => this.props.getOption(GetOptionState.GetBoard, true)} />
{ {
this.showShops.get() && <GoodsListDiv this.showShops.get() && <GoodsListDiv
open={this.showShops} open={this.showShops}

@ -833,12 +833,11 @@ export class DrillTypeSelectCom extends React.Component<IDrillTypeSelect, { isDa
const options = this.Options; const options = this.Options;
const select = <HTMLSelect const select = <HTMLSelect
className="select-drillType" className="select-drillType modal-pick"
value={this.props.opt.drillType} value={this.props.opt.drillType}
disabled={isHeightDrillLock} disabled={isHeightDrillLock}
style={{ style={{
padding: "0 5px", padding: "0 5px",
width: this.props.br && this.props.isShowHigh && "100%",
outline: this.state.isDanger && "1px red solid", outline: this.state.isDanger && "1px red solid",
}} }}
options={options} options={options}

@ -109,6 +109,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
const el = const el =
<> <>
<SetBoardDataItem <SetBoardDataItem
className='modal-pick'
type={CheckObjectType.BR} type={CheckObjectType.BR}
optKey="roomName" optKey="roomName"
option={this.props.opt} option={this.props.opt}
@ -116,6 +117,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
placeHolder="输入房间名" placeHolder="输入房间名"
/> />
<SetBoardDataItem <SetBoardDataItem
className='modal-pick'
type={CheckObjectType.BR} type={CheckObjectType.BR}
optKey="cabinetName" optKey="cabinetName"
option={this.props.opt} option={this.props.opt}
@ -317,6 +319,26 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
} }
return options; return options;
} }
private getBoardValue = async () =>
{
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.Clear();
let enRes = await app.Editor.GetEntity({
Msg: "选择板件",
Filter: { filterTypes: [Board] }
});
if (enRes.Status === PromptStatus.OK)
{
const data = (enRes.Entity as Board).BoardProcessOption;
this.props.opt[EBoardKeyList.BrMat] = data[EBoardKeyList.BrMat];
this.props.opt[EBoardKeyList.Mat] = data[EBoardKeyList.Mat];
this.props.opt[EBoardKeyList.Color] = data[EBoardKeyList.Color];
}
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.ShowMask();
};
async UNSAFE_componentWillMount() async UNSAFE_componentWillMount()
{ {
@ -346,6 +368,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
} }
<div className="flex br-mat"> <div className="flex br-mat">
<SetBoardDataBlock <SetBoardDataBlock
className='modal-pick'
type={CheckObjectType.BR} type={CheckObjectType.BR}
pars={this.matPars} pars={this.matPars}
option={this.props.opt} option={this.props.opt}
@ -356,6 +379,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
style={{ width: "2rem" }} style={{ width: "2rem" }}
onClick={() => this.showShops.set(true)} onClick={() => this.showShops.set(true)}
></button> ></button>
<Button style={{ width: "2rem" }} text="拾取" intent="success" onClick={() => this.getBoardValue()} />
{ {
this.showShops.get() && <GoodsListDiv this.showShops.get() && <GoodsListDiv
open={this.showShops} open={this.showShops}
@ -367,6 +391,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<label className="bp3-label bp3-inline .modifier"> <label className="bp3-label bp3-inline .modifier">
<span>:</span> <span>:</span>
<HTMLSelect <HTMLSelect
className='modal-pick'
value={this.props.opt.lines.toString()} value={this.props.opt.lines.toString()}
options={LineTypeSelectOption} options={LineTypeSelectOption}
onChange={e => onChange={e =>
@ -378,7 +403,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}> <label className="bp3-label bp3-inline .modifier" style={{ display: "flex" }}>
<span>:</span> <span>:</span>
<div className="flex" style={{ display: "inline-flex", width: "83%" }}> <div className="flex" style={{ display: "inline-flex", width: "83%" }}>
<input className="bp3-input br-process-input" title="双击查看详细内容" value={tagValue} readOnly style={{ flex: 1 }} onDoubleClick={this.onProcessInputDbClick} /> <input className="bp3-input br-process-input modal-pick" title="双击查看详细内容" value={tagValue} readOnly style={{ flex: 1 }} onDoubleClick={this.onProcessInputDbClick} />
<Button <Button
text="更多" text="更多"
intent="success" intent="success"
@ -442,6 +467,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<label className="bp3-label bp3-inline .modifier"> <label className="bp3-label bp3-inline .modifier">
<span>:</span> <span>:</span>
<HTMLSelect <HTMLSelect
className='modal-pick'
value={this.props.topBottomOption?.bigHoleDir != undefined ? this.props.topBottomOption.bigHoleDir.toString() : this.props.opt.bigHoleDir.toString()} value={this.props.topBottomOption?.bigHoleDir != undefined ? this.props.topBottomOption.bigHoleDir.toString() : this.props.opt.bigHoleDir.toString()}
options={ options={
this.getOptions(this.props.type) this.getOptions(this.props.type)
@ -455,7 +481,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
}} }}
/> />
</label> </label>
<label className="bp3-label bp3-inline .modifier" style={{ width: 175 }}> <label className="bp3-label bp3-inline .modifier" style={{ width: 180 }}>
<span>:</span> <span>:</span>
<DrillTypeSelectCom <DrillTypeSelectCom
opt={this.props.opt} opt={this.props.opt}
@ -468,6 +494,7 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
<label className="bp3-label bp3-inline .modifier"> <label className="bp3-label bp3-inline .modifier">
<span>:</span> <span>:</span>
<HTMLSelect <HTMLSelect
className='modal-pick'
value={this.props.opt.composingFace.toString()} value={this.props.opt.composingFace.toString()}
options={ComposingFaceSelectOption} options={ComposingFaceSelectOption}
onChange={e => onChange={e =>

@ -45,6 +45,15 @@
.br-set input { .br-set input {
margin-left: 5px; margin-left: 5px;
} }
.modal-pick.br-set input {
width: 11rem;
}
.modal-pick select,
.br-set input {
width: 11rem;
}
} }
} }
@ -144,6 +153,10 @@
.closing-input .bp3-input { .closing-input .bp3-input {
width: 8rem; width: 8rem;
} }
.board-info .modal-pick.bp3-input {
width: 11rem;
}
} }
/* 板长宽厚尺寸拾取,板件拾取*/ /* 板长宽厚尺寸拾取,板件拾取*/
@ -283,6 +296,10 @@
input { input {
width: 6.5rem; width: 6.5rem;
} }
.modal-pick input {
width: 6rem;
}
} }
.br-mat>div>div:last-child { .br-mat>div>div:last-child {

@ -79,6 +79,10 @@
width: 15rem; width: 15rem;
} }
#boardPropsCom .board-info .modal-pick .br-set input {
width: 12.5rem;
}
#boardPropsCom { #boardPropsCom {
.boardSize { .boardSize {
min-width: 151px; min-width: 151px;

Loading…
Cancel
Save