From 1f3c7e186a10b8bb3467e275fe600b46a35831e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E8=8B=A5=E5=AF=92?= <13470150+qian-ruohan@user.noreply.gitee.com> Date: Mon, 15 Apr 2024 07:41:40 +0000 Subject: [PATCH] =?UTF-8?q?!2574=20=E4=BC=98=E5=8C=96:=E5=A1=AB=E5=86=99?= =?UTF-8?q?=E6=8B=86=E5=8D=95=E5=B0=BA=E5=AF=B8=E4=B8=8D=E5=AE=8C=E6=95=B4?= =?UTF-8?q?(=E6=9C=AA=E5=AE=8C=E6=95=B4=E5=A1=AB=E5=86=99=E9=AB=98?= =?UTF-8?q?=E5=AE=BD=E5=8E=9A=E4=B8=89=E9=A1=B9)=E7=BB=99=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/Erp/ErpCommands.ts | 20 +++++++++++++++++++ src/UI/Components/Board/CommonBoardOption.tsx | 18 ++++++++++++++--- src/UI/Components/Common/Confirm.tsx | 6 ++++-- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/Add-on/Erp/ErpCommands.ts b/src/Add-on/Erp/ErpCommands.ts index a00e7abff..8c2e65b1e 100644 --- a/src/Add-on/Erp/ErpCommands.ts +++ b/src/Add-on/Erp/ErpCommands.ts @@ -1,6 +1,7 @@ import { Intent } from "@blueprintjs/core"; import { runInAction } from "mobx"; import { app } from "../../ApplicationServices/Application"; +import { HostApplicationServices } from "../../ApplicationServices/HostApplicationServices"; import { CheckInterfereTool } from "../../Common/InterfereUtil"; import { Sleep } from "../../Common/Sleep"; import { DuplicateRecordCloning } from "../../Common/Status"; @@ -149,6 +150,7 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes) let intSelfBoards = new Set(); let minBoardCount = 0; + let chaidanCount = 0; const boardList = GetSelectionBoards(selction.selectEntityList, selction.selectRelativeHardware); const interference = await InterferenceCheck(boardList); @@ -168,6 +170,12 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes) for (let br of boardList) { let b = br.__OriginalEnt__ ?? br; + const [L, W, H] = [br.BoardProcessOption.spliteHeight, br.BoardProcessOption.spliteWidth, br.BoardProcessOption.spliteThickness]; + const chaidanOptions = !(!L && !W && !H) && !(L && W && H); + if (!HostApplicationServices.chaidanOption.partialSplitValueCanTakesEffect && chaidanOptions) + { + chaidanCount++; + } if (!intSelfBoards.has(b)) { if (BoardIsShort(b)) @@ -184,6 +192,18 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes) } } } + if (chaidanCount) + { + let res = await AppConfirm.show({ + intent: Intent.WARNING, + message: `有${chaidanCount}个板件拆单尺寸填写不完整`, + ignore: true, + }); + if (res) + { + return; + } + } if (minBoardCount) { diff --git a/src/UI/Components/Board/CommonBoardOption.tsx b/src/UI/Components/Board/CommonBoardOption.tsx index 11f7a1543..ac1bb7d9e 100644 --- a/src/UI/Components/Board/CommonBoardOption.tsx +++ b/src/UI/Components/Board/CommonBoardOption.tsx @@ -6,6 +6,7 @@ import { ArcBoardOptions } from '../../../Add-on/ArcBoard/ArcBoardFeeding'; import { FaceDirection } from '../../../Add-on/DrawDrilling/DrillType'; import { IBoardRectHoleType, ParseBoardRectHoleType, SetBrHighHoleTypeFromRectHoleType } from '../../../Add-on/DrawDrilling/HoleUtils'; import { app } from '../../../ApplicationServices/Application'; +import { HostApplicationServices } from '../../../ApplicationServices/HostApplicationServices'; import { CheckObjectType, CheckoutValid } from '../../../Common/CheckoutVaildValue'; import { DataAdapter } from '../../../Common/DataAdapter'; import { safeEval } from '../../../Common/eval'; @@ -228,9 +229,10 @@ export function AddCommonBoardProps(Com: React.ComponentType } const [L, W, H] = [this._ConfigOption.height, this._ConfigOption.width, this._ConfigOption.thickness]; - if (safeEval(this._ProcessOption.spliteHeight, { L, W, H }, 'L') <= 1 || - safeEval(this._ProcessOption.spliteWidth, { L, W, H }, "W") <= 1 || - safeEval(this._ProcessOption.spliteThickness, { L, W, H }, "H") <= 1) + const safeEvalL = safeEval(this._ProcessOption.spliteHeight, { L, W, H }, 'L'); + const safeEvalW = safeEval(this._ProcessOption.spliteWidth, { L, W, H }, 'W'); + const safeEvalH = safeEval(this._ProcessOption.spliteThickness, { L, W, H }, 'H'); + if (safeEvalL <= 1 || safeEvalW <= 1 || safeEvalH <= 1) { AppToaster.show({ message: "拆单尺寸错误!值不能小等于1", @@ -240,6 +242,16 @@ export function AddCommonBoardProps(Com: React.ComponentType return; } + const chaidanOptions = !(!safeEvalL && !safeEvalW && !safeEvalH) && !(safeEvalL && safeEvalW && safeEvalH); + if (!HostApplicationServices.chaidanOption.partialSplitValueCanTakesEffect && chaidanOptions) + { + AppToaster.show({ + message: "拆单尺寸填写不完整", + timeout: 3000, + intent: Intent.WARNING, + }, "拆单尺寸填写错误"); + return; + } CommandWrap(() => { let board = this.CurrentBoard; diff --git a/src/UI/Components/Common/Confirm.tsx b/src/UI/Components/Common/Confirm.tsx index 4f16e4ba4..7518e92cd 100644 --- a/src/UI/Components/Common/Confirm.tsx +++ b/src/UI/Components/Common/Confirm.tsx @@ -32,6 +32,7 @@ class Confirm hasCancel?: boolean; confirmButtonText?: string; intent?: Intent; + ignore?: boolean; }): Promise { return new Promise((res: (ok: boolean) => void) => @@ -39,6 +40,7 @@ class Confirm ReactDOM.render ( this.close()} @@ -60,9 +62,9 @@ interface ICommonConfirmProps res: Function; close: Function; hasCancel: boolean; - confirmButtonText?: string; intent?: Intent; + ignore?: boolean; } /** @@ -100,7 +102,7 @@ export class CommonConfirm extends React.Component isOpen={true} confirmButtonText={this.props.confirmButtonText ?? "确认"} canEscapeKeyCancel={true} - cancelButtonText={this.props.hasCancel ? "取消" : ""} + cancelButtonText={this.props.hasCancel ? (this.props.ignore ? "忽略" : "取消") : ""} intent={this.props.intent ?? Intent.SUCCESS} onConfirm={this.confirm} onCancel={this.cancel}