From 838ffc5941700d91c9232512bc1e5453703bd0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=B3=BD?= <3365712788@qq.com> Date: Tue, 23 Apr 2024 05:58:56 +0000 Subject: [PATCH] =?UTF-8?q?!2609=20=E5=8A=9F=E8=83=BD:=E6=94=B6=E5=8F=A3?= =?UTF-8?q?=E6=9D=A1=E7=BB=98=E5=88=B6=E5=8A=9F=E8=83=BD=EF=BC=8C=E8=A6=81?= =?UTF-8?q?=E6=B1=82=E5=8F=AF=E4=BB=A5=E8=87=AA=E5=AE=9A=E4=B9=89=E6=9D=BF?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/DrawBoard/DrawClosingStrip.ts | 14 +- src/Editor/DefaultConfig.ts | 10 +- src/UI/Components/Board/BoardModal.tsx | 15 +- src/UI/Components/Board/BoardProcessModal.tsx | 19 ++- src/UI/Components/Board/ClosingStripModal.tsx | 1 + .../Modal/ModalStyle/BoardModal.less | 137 +++++++++--------- src/UI/Store/BoardStore.ts | 27 ++++ .../OptionInterface/BoardProcessOption.ts | 1 + .../OptionInterface/ClosingStripOption.ts | 1 + 9 files changed, 140 insertions(+), 85 deletions(-) diff --git a/src/Add-on/DrawBoard/DrawClosingStrip.ts b/src/Add-on/DrawBoard/DrawClosingStrip.ts index 56f751508..ec5970084 100644 --- a/src/Add-on/DrawBoard/DrawClosingStrip.ts +++ b/src/Add-on/DrawBoard/DrawClosingStrip.ts @@ -160,20 +160,18 @@ export class DrawClosingStrip implements Command } else { - br = Board.CreateBoard(width, size.x, thickness, - BoardType.Behind); + br = Board.CreateBoard(width, size.x, thickness, BoardType.Behind); br.BoardProcessOption = store.BoardProcessOption; br.BoardProcessOption.lines = LinesType.Reverse; pos.set(min.x, min.y + thickness + frontShrink, max.z); if (opt.isDrawFuZhu) { - br2 = Board.CreateBoard(size.x, opt.fzWidth, opt.fzThickness, - BoardType.Layer); + br2 = Board.CreateBoard(size.x, opt.fzWidth, opt.fzThickness, BoardType.Layer); br2.Position = new Vector3(max.x, min.y + frontShrink + thickness, max.z); br2.Name = "上收口条"; } } - br.Name = "上收口条"; + br.Name = store.m_Option.brName; } else { @@ -190,6 +188,7 @@ export class DrawClosingStrip implements Command if (opt.boardRelative === BrRelativePos.Left) { + br.BoardProcessOption = store.BoardProcessOption; if (opt.striptype === StripType.H) { 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))); } - br.Name = "左收口条"; + br.Name = store.m_Option.brName; } else { + br.BoardProcessOption = store.BoardProcessOption; if (opt.striptype === StripType.H) { 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); } - br.Name = "右收口条"; + br.Name = store.m_Option.brName; } br.BoardProcessOption = store.BoardProcessOption; } diff --git a/src/Editor/DefaultConfig.ts b/src/Editor/DefaultConfig.ts index f306847ce..37cc72a80 100644 --- a/src/Editor/DefaultConfig.ts +++ b/src/Editor/DefaultConfig.ts @@ -303,9 +303,9 @@ export const DefaultSingleBoardOption: SingleBoardOption = { Object.freeze(DefaultSingleBoardOption); export const DefaultClosingStripOption: ClosingStripOption = { - version: 3, + version: 4, type: BoardType.Vertical, - name: "收口条", + name: "收口条", //辅助条占用 striptype: StripType.H, boardRelative: BrRelativePos.Left, width: 54, @@ -314,7 +314,8 @@ export const DefaultClosingStripOption: ClosingStripOption = { isDrawFuZhu: true, fzWidth: 80, fzThickness: 18, - addSKTCabinetName: true + addSKTCabinetName: true, + brName: "左收口", }; Object.freeze(DefaultClosingStripOption); @@ -701,10 +702,11 @@ export const DefaultToplineMetalsOption: IToplineOption = { Object.freeze(DefaultToplineMetalsOption); export const DefaultBoardProcessOption: BoardProcessOption = { - version: 4, + version: 3, roomName: "", cabinetName: "", boardName: "", + brName: "", material: "", color: "", lines: LinesType.Positive, diff --git a/src/UI/Components/Board/BoardModal.tsx b/src/UI/Components/Board/BoardModal.tsx index d4651497a..b7ab9b39e 100644 --- a/src/UI/Components/Board/BoardModal.tsx +++ b/src/UI/Components/Board/BoardModal.tsx @@ -4,6 +4,7 @@ import * as React from 'react'; import * as xaop from 'xaop'; import { DrillType } from '../../../Add-on/DrawDrilling/DrillType'; import { app } from '../../../ApplicationServices/Application'; +import { CheckObjectType } from '../../../Common/CheckoutVaildValue'; import { KeyBoard } from '../../../Common/KeyEnum'; import { userConfig } from '../../../Editor/UserConfig'; 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 { CommonModal } from './../Modal/ModalContainer'; import { BehindBoardModal } from './BehindBoardModal'; -import { AutoCutCheckbox, Notes } from './BoardCommon'; +import { AutoCutCheckbox, Notes, SetBoardDataItem } from './BoardCommon'; import { BoardModalType } from './BoardModalType'; import { BoardProcessModal } from './BoardProcessModal'; import { ClosingStripModal } from './ClosingStripModal'; @@ -175,6 +176,18 @@ export class BoardModal extends React.Component }} /> } + { + this.props.type === BoardModalType.Skt && +
+ +
+ }
diff --git a/src/UI/Components/Board/BoardProcessModal.tsx b/src/UI/Components/Board/BoardProcessModal.tsx index bbc16c9a2..f3fdca18f 100644 --- a/src/UI/Components/Board/BoardProcessModal.tsx +++ b/src/UI/Components/Board/BoardProcessModal.tsx @@ -43,7 +43,8 @@ interface BoardProcessProps isEdgeRemarks?: boolean; } @observer -export class BoardProcessModal extends React.Component{ +export class BoardProcessModal extends React.Component +{ private showShops = observable.box(false); private showAlert = observable.box(false); @observable private tags: string[] = []; @@ -102,16 +103,18 @@ export class BoardProcessModal extends React.Component{ store.boardEdgeRemarksStore.isNotUpdateStore = false; }, 0); } + private renderEl = () => { const el = - <> + <> + diff --git a/src/UI/Components/Modal/ModalStyle/BoardModal.less b/src/UI/Components/Modal/ModalStyle/BoardModal.less index d8157ea86..475018bea 100644 --- a/src/UI/Components/Modal/ModalStyle/BoardModal.less +++ b/src/UI/Components/Modal/ModalStyle/BoardModal.less @@ -8,28 +8,28 @@ } /*板件属性尺寸拾取*/ - .br-size{ - .bp3-label{ - display: flex; - margin-bottom: 0; + .br-size { + .bp3-label { + display: flex; + margin-bottom: 0; - &>div{ - display: flex; + &>div { + display: flex; - :last-child{ - margin-top: 0; - width: 60px; - } + :last-child { + margin-top: 0; + width: 60px; } + } - .bp3-button { - min-height: 10px; - width: 45px; - height: 17px; - margin-left: 5px; - } + .bp3-button { + min-height: 10px; + width: 45px; + height: 17px; + margin-left: 5px; } } + } .board-info>.bp3-label input { width: @infoSelectWidth; @@ -71,18 +71,18 @@ /* 板件模型设置 */ #commonModal .boardModel { - display : inline-block; - width : 35px; - height : 50px; - border : 1px solid #000; + display: inline-block; + width: 35px; + height: 50px; + border: 1px solid #000; vertical-align: middle; - margin : 10px; + margin: 10px; } #commonModal .boardSize .bp3-label, #commonModal .behind-board .board-info .boardSize .bp3-input { display: inline-block; - margin : 0 5px; + margin: 0 5px; } #commonModal { @@ -110,10 +110,10 @@ } #commonModal .boardSize .bp3-label>.bp3-input { - display : block; - padding : 0; + display: block; + padding: 0; padding-left: 5px; - line-height : 15px; + line-height: 15px; } // #commonModal .input-select>input, @@ -127,34 +127,40 @@ /* 板材信息 */ #commonModal { - .bp3-input, - .lr-br .bp3-input { - width: @inputWidth; - } - .boardSize .bp3-input { - width: 3rem; - } + .bp3-input, + .lr-br .bp3-input { + width: @inputWidth; + } + + .boardSize .bp3-input { + width: 3rem; + } + + .board-info .bp3-input { + width: 9rem; + } } + /* 板长宽厚尺寸拾取,板件拾取*/ #commonModal { - .br-lkg{ + .br-lkg { display: flex; - &>div{ - .bp3-label{ + &>div { + .bp3-label { display: flex; margin-bottom: 0; - &>div{ + &>div { display: flex; - :last-child{ + :last-child { margin-top: 0; } } - .bp3-button { + .bp3-button { min-height: 10px; width: 30px; height: 17px; @@ -164,25 +170,25 @@ } } - &>button{ + &>button { width: 2rem; height: 75px; } } - .interval{ + .interval { display: flex; - &>div{ + &>div { display: flex; margin-bottom: 5px; - :last-child{ + :last-child { margin-top: 0; } } - .bp3-button { + .bp3-button { min-height: 10px; width: 30px; height: 17px; @@ -191,21 +197,22 @@ } } } + /* 尺寸拾取*/ -#modal .pick-br{ - .bp3-label{ +#modal .pick-br { + .bp3-label { display: flex; - &>div{ + &>div { display: flex; margin-bottom: 0; - :last-child{ + :last-child { margin-top: 0; } } - .bp3-button { + .bp3-button { min-height: 10px; width: 30px; height: 17px; @@ -225,7 +232,7 @@ } #commonModal .hole>label { - display : inline-block; + display: inline-block; margin-right: 1rem; } @@ -239,7 +246,7 @@ } #commonModal .notes>div>label { - height : @noteInputHeight; + height: @noteInputHeight; line-height: @noteInputHeight; } @@ -260,7 +267,7 @@ //选择材质 #commonModal .bp3-dialog-body .board-info { .br-mat { - position : relative; + position: relative; margin-bottom: 0.5rem; input { @@ -288,17 +295,17 @@ } #commonModal .edge-sealing span>button { - height : 14px; - font-size : 12px; - width : 6rem; - padding-top : 0px; + height: 14px; + font-size: 12px; + width: 6rem; + padding-top: 0px; padding-bottom: 0px; - min-height : 14px; + min-height: 14px; } #commonModal .edge-sealing { - display : flex; - margin-top : 10px; + display: flex; + margin-top: 10px; align-items: center; ul { @@ -337,26 +344,26 @@ } #commonModal .invalidDrill { - .bp3-dialog-body{ - padding : 25px; + .bp3-dialog-body { + padding: 25px; max-height: 250px; - overflow : auto; + overflow: auto; } - .bp3-dialog-footer{ + .bp3-dialog-footer { padding: 0px 11px 14px 0; } } -#commonModal .boardColorMaterialMap{ +#commonModal .boardColorMaterialMap { font-size: 13px; min-width: 350px; - .bp3-dialog-body{ + .bp3-dialog-body { background-color: white; } - .bp3-dialog-footer{ + .bp3-dialog-footer { padding: 2px 20px; } } diff --git a/src/UI/Store/BoardStore.ts b/src/UI/Store/BoardStore.ts index edb014b57..1ea8b5933 100644 --- a/src/UI/Store/BoardStore.ts +++ b/src/UI/Store/BoardStore.ts @@ -784,6 +784,7 @@ export class ClosingStripStore extends BoardStore super(); this.m_BoardProcessOption[EBoardKeyList.DrillType] = DrillType.None; } + ChangeCabinetName(cof?: IConfigOption) { let [option, processData] = cof ? [cof.option, cof.processData] : [this.m_Option, this.m_BoardProcessOption]; @@ -813,11 +814,32 @@ export class ClosingStripStore extends BoardStore } } } + + 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() { Object.assign(this.m_Option, DefaultClosingStripOption); super.InitOption(); } + UpdateOption(cof: IConfigOption) { if (cof.option.version < 2) @@ -832,6 +854,11 @@ export class ClosingStripStore extends BoardStore cof.option.addSKTCabinetName = true; cof.option.version = 3; } + if (cof.option.version < 4) + { + cof.option.version = 4; + this.ChangeBrName(cof); + } this.ChangeCabinetName(cof); super.UpdateOption(cof); } diff --git a/src/UI/Store/OptionInterface/BoardProcessOption.ts b/src/UI/Store/OptionInterface/BoardProcessOption.ts index d2a1bc3a9..0905933cb 100644 --- a/src/UI/Store/OptionInterface/BoardProcessOption.ts +++ b/src/UI/Store/OptionInterface/BoardProcessOption.ts @@ -9,6 +9,7 @@ export interface BoardProcessOption extends IBaseOption { [EBoardKeyList.RoomName]?: string; [EBoardKeyList.CabinetName]?: string; //柜名 + [EBoardKeyList.BrName]?: string; //板名 [EBoardKeyList.BrMat]?: string; //板材名 [EBoardKeyList.Mat]?: string; //材料 [EBoardKeyList.Color]?: string; diff --git a/src/UI/Store/OptionInterface/ClosingStripOption.ts b/src/UI/Store/OptionInterface/ClosingStripOption.ts index bc71f7112..7bb2460fc 100644 --- a/src/UI/Store/OptionInterface/ClosingStripOption.ts +++ b/src/UI/Store/OptionInterface/ClosingStripOption.ts @@ -16,4 +16,5 @@ export interface ClosingStripOption extends BoardConfigOption fzWidth: number; fzThickness: number; addSKTCabinetName: boolean; //柜名加收口名称 + brName: string;//收口条板名 name被辅助条占用 }