!2609 功能:收口条绘制功能,要求可以自定义板件名称。

pull/2707/head
彭泽 5 months ago committed by ChenX
parent 074186dcea
commit 838ffc5941

@ -160,20 +160,18 @@ export class DrawClosingStrip implements Command
} }
else else
{ {
br = Board.CreateBoard(width, size.x, thickness, br = Board.CreateBoard(width, size.x, thickness, BoardType.Behind);
BoardType.Behind);
br.BoardProcessOption = store.BoardProcessOption; br.BoardProcessOption = store.BoardProcessOption;
br.BoardProcessOption.lines = LinesType.Reverse; br.BoardProcessOption.lines = LinesType.Reverse;
pos.set(min.x, min.y + thickness + frontShrink, max.z); pos.set(min.x, min.y + thickness + frontShrink, max.z);
if (opt.isDrawFuZhu) if (opt.isDrawFuZhu)
{ {
br2 = Board.CreateBoard(size.x, opt.fzWidth, opt.fzThickness, br2 = Board.CreateBoard(size.x, opt.fzWidth, opt.fzThickness, BoardType.Layer);
BoardType.Layer);
br2.Position = new Vector3(max.x, min.y + frontShrink + thickness, max.z); br2.Position = new Vector3(max.x, min.y + frontShrink + thickness, max.z);
br2.Name = "上收口条"; br2.Name = "上收口条";
} }
} }
br.Name = "上收口条"; br.Name = store.m_Option.brName;
} }
else else
{ {
@ -190,6 +188,7 @@ export class DrawClosingStrip implements Command
if (opt.boardRelative === BrRelativePos.Left) if (opt.boardRelative === BrRelativePos.Left)
{ {
br.BoardProcessOption = store.BoardProcessOption;
if (opt.striptype === StripType.H) if (opt.striptype === StripType.H)
{ {
pos.set(min.x - width, min.y + thickness + frontShrink, min.z); pos.set(min.x - width, min.y + thickness + frontShrink, min.z);
@ -203,10 +202,11 @@ export class DrawClosingStrip implements Command
{ {
pos.copy(min.clone().add(new Vector3(-thickness, frontShrink))); pos.copy(min.clone().add(new Vector3(-thickness, frontShrink)));
} }
br.Name = "左收口条"; br.Name = store.m_Option.brName;
} }
else else
{ {
br.BoardProcessOption = store.BoardProcessOption;
if (opt.striptype === StripType.H) if (opt.striptype === StripType.H)
{ {
pos.set(max.x, min.y + thickness + frontShrink, min.z); pos.set(max.x, min.y + thickness + frontShrink, min.z);
@ -220,7 +220,7 @@ export class DrawClosingStrip implements Command
{ {
pos.copy(min.clone().add(new Vector3(0, frontShrink))).setX(max.x); pos.copy(min.clone().add(new Vector3(0, frontShrink))).setX(max.x);
} }
br.Name = "右收口条"; br.Name = store.m_Option.brName;
} }
br.BoardProcessOption = store.BoardProcessOption; br.BoardProcessOption = store.BoardProcessOption;
} }

@ -303,9 +303,9 @@ export const DefaultSingleBoardOption: SingleBoardOption = {
Object.freeze(DefaultSingleBoardOption); Object.freeze(DefaultSingleBoardOption);
export const DefaultClosingStripOption: ClosingStripOption = { export const DefaultClosingStripOption: ClosingStripOption = {
version: 3, version: 4,
type: BoardType.Vertical, type: BoardType.Vertical,
name: "收口条", name: "收口条", //辅助条占用
striptype: StripType.H, striptype: StripType.H,
boardRelative: BrRelativePos.Left, boardRelative: BrRelativePos.Left,
width: 54, width: 54,
@ -314,7 +314,8 @@ export const DefaultClosingStripOption: ClosingStripOption = {
isDrawFuZhu: true, isDrawFuZhu: true,
fzWidth: 80, fzWidth: 80,
fzThickness: 18, fzThickness: 18,
addSKTCabinetName: true addSKTCabinetName: true,
brName: "左收口",
}; };
Object.freeze(DefaultClosingStripOption); Object.freeze(DefaultClosingStripOption);
@ -701,10 +702,11 @@ export const DefaultToplineMetalsOption: IToplineOption = {
Object.freeze(DefaultToplineMetalsOption); Object.freeze(DefaultToplineMetalsOption);
export const DefaultBoardProcessOption: BoardProcessOption = { export const DefaultBoardProcessOption: BoardProcessOption = {
version: 4, version: 3,
roomName: "", roomName: "",
cabinetName: "", cabinetName: "",
boardName: "", boardName: "",
brName: "",
material: "", material: "",
color: "", color: "",
lines: LinesType.Positive, lines: LinesType.Positive,

@ -4,6 +4,7 @@ import * as React from 'react';
import * as xaop from 'xaop'; import * as xaop from 'xaop';
import { DrillType } from '../../../Add-on/DrawDrilling/DrillType'; import { DrillType } from '../../../Add-on/DrawDrilling/DrillType';
import { app } from '../../../ApplicationServices/Application'; import { app } from '../../../ApplicationServices/Application';
import { CheckObjectType } from '../../../Common/CheckoutVaildValue';
import { KeyBoard } from '../../../Common/KeyEnum'; import { KeyBoard } from '../../../Common/KeyEnum';
import { userConfig } from '../../../Editor/UserConfig'; import { userConfig } from '../../../Editor/UserConfig';
import { BehindBoardStore, BoardStore, ClosingStripStore, LayerBoardStore, SideBoardStore, SingleBoardStore, TopBottomBoardStore, VerticalBoardStore } from '../../Store/BoardStore'; import { BehindBoardStore, BoardStore, ClosingStripStore, LayerBoardStore, SideBoardStore, SingleBoardStore, TopBottomBoardStore, VerticalBoardStore } from '../../Store/BoardStore';
@ -12,7 +13,7 @@ import { AnyObject } from "../../Store/OptionInterface/IOptionInterface";
import { ModalState } from '../Modal/ModalInterface'; import { ModalState } from '../Modal/ModalInterface';
import { CommonModal } from './../Modal/ModalContainer'; import { CommonModal } from './../Modal/ModalContainer';
import { BehindBoardModal } from './BehindBoardModal'; import { BehindBoardModal } from './BehindBoardModal';
import { AutoCutCheckbox, Notes } from './BoardCommon'; import { AutoCutCheckbox, Notes, SetBoardDataItem } from './BoardCommon';
import { BoardModalType } from './BoardModalType'; import { BoardModalType } from './BoardModalType';
import { BoardProcessModal } from './BoardProcessModal'; import { BoardProcessModal } from './BoardProcessModal';
import { ClosingStripModal } from './ClosingStripModal'; import { ClosingStripModal } from './ClosingStripModal';
@ -175,6 +176,18 @@ export class BoardModal extends React.Component<BoardModalProps, {}>
}} }}
/> />
} }
{
this.props.type === BoardModalType.Skt &&
<div className='board-info'>
<SetBoardDataItem
type={CheckObjectType.BR}
optKey="brName"
option={store.m_Option}
title="板名"
placeHolder="输入板名"
/>
</div>
}
<BoardProcessModal type={this.props.type} opt={store.m_BoardProcessOption} topBottomOption={(store as TopBottomBoardStore).bottomBoardOption} drillOption={store.rectDrillOption} uiOpt={store.UIBoardProcessOption} /> <BoardProcessModal type={this.props.type} opt={store.m_BoardProcessOption} topBottomOption={(store as TopBottomBoardStore).bottomBoardOption} drillOption={store.rectDrillOption} uiOpt={store.UIBoardProcessOption} />
</div> </div>
<div className={Classes.CARD}> <div className={Classes.CARD}>

@ -43,7 +43,8 @@ interface BoardProcessProps
isEdgeRemarks?: boolean; isEdgeRemarks?: boolean;
} }
@observer @observer
export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>
{
private showShops = observable.box(false); private showShops = observable.box(false);
private showAlert = observable.box(false); private showAlert = observable.box(false);
@observable private tags: string[] = []; @observable private tags: string[] = [];
@ -102,16 +103,18 @@ export class BoardProcessModal extends React.Component<BoardProcessProps, {}>{
store.boardEdgeRemarksStore.isNotUpdateStore = false; store.boardEdgeRemarksStore.isNotUpdateStore = false;
}, 0); }, 0);
} }
private renderEl = () => private renderEl = () =>
{ {
const el = const el =
<><SetBoardDataItem <>
type={CheckObjectType.BR} <SetBoardDataItem
optKey="roomName" type={CheckObjectType.BR}
option={this.props.opt} optKey="roomName"
title="房间名" option={this.props.opt}
placeHolder="输入房间名" title="房间名"
/> placeHolder="输入房间名"
/>
<SetBoardDataItem <SetBoardDataItem
type={CheckObjectType.BR} type={CheckObjectType.BR}
optKey="cabinetName" optKey="cabinetName"

@ -61,6 +61,7 @@ export const ClosingStripModal =
} }
store.ChangeCabinetName(); store.ChangeCabinetName();
store.ChangeBrName();
}} }}
selectedValue={opt.boardRelative} selectedValue={opt.boardRelative}
> >

@ -8,28 +8,28 @@
} }
/*板件属性尺寸拾取*/ /*板件属性尺寸拾取*/
.br-size{ .br-size {
.bp3-label{ .bp3-label {
display: flex; display: flex;
margin-bottom: 0; margin-bottom: 0;
&>div{ &>div {
display: flex; display: flex;
:last-child{ :last-child {
margin-top: 0; margin-top: 0;
width: 60px; width: 60px;
}
} }
}
.bp3-button { .bp3-button {
min-height: 10px; min-height: 10px;
width: 45px; width: 45px;
height: 17px; height: 17px;
margin-left: 5px; margin-left: 5px;
}
} }
} }
}
.board-info>.bp3-label input { .board-info>.bp3-label input {
width: @infoSelectWidth; width: @infoSelectWidth;
@ -71,18 +71,18 @@
/* 板件模型设置 */ /* 板件模型设置 */
#commonModal .boardModel { #commonModal .boardModel {
display : inline-block; display: inline-block;
width : 35px; width: 35px;
height : 50px; height: 50px;
border : 1px solid #000; border: 1px solid #000;
vertical-align: middle; vertical-align: middle;
margin : 10px; margin: 10px;
} }
#commonModal .boardSize .bp3-label, #commonModal .boardSize .bp3-label,
#commonModal .behind-board .board-info .boardSize .bp3-input { #commonModal .behind-board .board-info .boardSize .bp3-input {
display: inline-block; display: inline-block;
margin : 0 5px; margin: 0 5px;
} }
#commonModal { #commonModal {
@ -110,10 +110,10 @@
} }
#commonModal .boardSize .bp3-label>.bp3-input { #commonModal .boardSize .bp3-label>.bp3-input {
display : block; display: block;
padding : 0; padding: 0;
padding-left: 5px; padding-left: 5px;
line-height : 15px; line-height: 15px;
} }
// #commonModal .input-select>input, // #commonModal .input-select>input,
@ -127,34 +127,40 @@
/* 板材信息 */ /* 板材信息 */
#commonModal { #commonModal {
.bp3-input,
.lr-br .bp3-input {
width: @inputWidth;
}
.boardSize .bp3-input { .bp3-input,
width: 3rem; .lr-br .bp3-input {
} width: @inputWidth;
}
.boardSize .bp3-input {
width: 3rem;
}
.board-info .bp3-input {
width: 9rem;
}
} }
/* 板长宽厚尺寸拾取,板件拾取*/ /* 板长宽厚尺寸拾取,板件拾取*/
#commonModal { #commonModal {
.br-lkg{ .br-lkg {
display: flex; display: flex;
&>div{ &>div {
.bp3-label{ .bp3-label {
display: flex; display: flex;
margin-bottom: 0; margin-bottom: 0;
&>div{ &>div {
display: flex; display: flex;
:last-child{ :last-child {
margin-top: 0; margin-top: 0;
} }
} }
.bp3-button { .bp3-button {
min-height: 10px; min-height: 10px;
width: 30px; width: 30px;
height: 17px; height: 17px;
@ -164,25 +170,25 @@
} }
} }
&>button{ &>button {
width: 2rem; width: 2rem;
height: 75px; height: 75px;
} }
} }
.interval{ .interval {
display: flex; display: flex;
&>div{ &>div {
display: flex; display: flex;
margin-bottom: 5px; margin-bottom: 5px;
:last-child{ :last-child {
margin-top: 0; margin-top: 0;
} }
} }
.bp3-button { .bp3-button {
min-height: 10px; min-height: 10px;
width: 30px; width: 30px;
height: 17px; height: 17px;
@ -191,21 +197,22 @@
} }
} }
} }
/* 尺寸拾取*/ /* 尺寸拾取*/
#modal .pick-br{ #modal .pick-br {
.bp3-label{ .bp3-label {
display: flex; display: flex;
&>div{ &>div {
display: flex; display: flex;
margin-bottom: 0; margin-bottom: 0;
:last-child{ :last-child {
margin-top: 0; margin-top: 0;
} }
} }
.bp3-button { .bp3-button {
min-height: 10px; min-height: 10px;
width: 30px; width: 30px;
height: 17px; height: 17px;
@ -225,7 +232,7 @@
} }
#commonModal .hole>label { #commonModal .hole>label {
display : inline-block; display: inline-block;
margin-right: 1rem; margin-right: 1rem;
} }
@ -239,7 +246,7 @@
} }
#commonModal .notes>div>label { #commonModal .notes>div>label {
height : @noteInputHeight; height: @noteInputHeight;
line-height: @noteInputHeight; line-height: @noteInputHeight;
} }
@ -260,7 +267,7 @@
//选择材质 //选择材质
#commonModal .bp3-dialog-body .board-info { #commonModal .bp3-dialog-body .board-info {
.br-mat { .br-mat {
position : relative; position: relative;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
input { input {
@ -288,17 +295,17 @@
} }
#commonModal .edge-sealing span>button { #commonModal .edge-sealing span>button {
height : 14px; height: 14px;
font-size : 12px; font-size: 12px;
width : 6rem; width: 6rem;
padding-top : 0px; padding-top: 0px;
padding-bottom: 0px; padding-bottom: 0px;
min-height : 14px; min-height: 14px;
} }
#commonModal .edge-sealing { #commonModal .edge-sealing {
display : flex; display: flex;
margin-top : 10px; margin-top: 10px;
align-items: center; align-items: center;
ul { ul {
@ -337,26 +344,26 @@
} }
#commonModal .invalidDrill { #commonModal .invalidDrill {
.bp3-dialog-body{ .bp3-dialog-body {
padding : 25px; padding: 25px;
max-height: 250px; max-height: 250px;
overflow : auto; overflow: auto;
} }
.bp3-dialog-footer{ .bp3-dialog-footer {
padding: 0px 11px 14px 0; padding: 0px 11px 14px 0;
} }
} }
#commonModal .boardColorMaterialMap{ #commonModal .boardColorMaterialMap {
font-size: 13px; font-size: 13px;
min-width: 350px; min-width: 350px;
.bp3-dialog-body{ .bp3-dialog-body {
background-color: white; background-color: white;
} }
.bp3-dialog-footer{ .bp3-dialog-footer {
padding: 2px 20px; padding: 2px 20px;
} }
} }

@ -784,6 +784,7 @@ export class ClosingStripStore extends BoardStore<ClosingStripOption>
super(); super();
this.m_BoardProcessOption[EBoardKeyList.DrillType] = DrillType.None; this.m_BoardProcessOption[EBoardKeyList.DrillType] = DrillType.None;
} }
ChangeCabinetName(cof?: IConfigOption) ChangeCabinetName(cof?: IConfigOption)
{ {
let [option, processData] = cof ? [cof.option, cof.processData] : [this.m_Option, this.m_BoardProcessOption]; let [option, processData] = cof ? [cof.option, cof.processData] : [this.m_Option, this.m_BoardProcessOption];
@ -813,11 +814,32 @@ export class ClosingStripStore extends BoardStore<ClosingStripOption>
} }
} }
} }
ChangeBrName(cof?: IConfigOption)
{
let option = cof ? cof.option : this.m_Option;
let title = "左";
switch (option.boardRelative)
{
case BrRelativePos.Right:
title = "右";
break;
case BrRelativePos.Top:
title = "上";
default:
break;
}
// 收口条名称
let brName = title + "收口";
option.brName = brName;
}
InitOption() InitOption()
{ {
Object.assign(this.m_Option, DefaultClosingStripOption); Object.assign(this.m_Option, DefaultClosingStripOption);
super.InitOption(); super.InitOption();
} }
UpdateOption(cof: IConfigOption<ClosingStripOption>) UpdateOption(cof: IConfigOption<ClosingStripOption>)
{ {
if (cof.option.version < 2) if (cof.option.version < 2)
@ -832,6 +854,11 @@ export class ClosingStripStore extends BoardStore<ClosingStripOption>
cof.option.addSKTCabinetName = true; cof.option.addSKTCabinetName = true;
cof.option.version = 3; cof.option.version = 3;
} }
if (cof.option.version < 4)
{
cof.option.version = 4;
this.ChangeBrName(cof);
}
this.ChangeCabinetName(cof); this.ChangeCabinetName(cof);
super.UpdateOption(cof); super.UpdateOption(cof);
} }

@ -9,6 +9,7 @@ export interface BoardProcessOption extends IBaseOption
{ {
[EBoardKeyList.RoomName]?: string; [EBoardKeyList.RoomName]?: string;
[EBoardKeyList.CabinetName]?: string; //柜名 [EBoardKeyList.CabinetName]?: string; //柜名
[EBoardKeyList.BrName]?: string; //板名
[EBoardKeyList.BrMat]?: string; //板材名 [EBoardKeyList.BrMat]?: string; //板材名
[EBoardKeyList.Mat]?: string; //材料 [EBoardKeyList.Mat]?: string; //材料
[EBoardKeyList.Color]?: string; [EBoardKeyList.Color]?: string;

@ -16,4 +16,5 @@ export interface ClosingStripOption extends BoardConfigOption
fzWidth: number; fzWidth: number;
fzThickness: number; fzThickness: number;
addSKTCabinetName: boolean; //柜名加收口名称 addSKTCabinetName: boolean; //柜名加收口名称
brName: string;//收口条板名 name被辅助条占用
} }

Loading…
Cancel
Save