From ba89a64f02ee2db9c9f3e5bfe257a0c9f5f736b9 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Tue, 1 Jul 2025 10:58:33 +0800 Subject: [PATCH] 处理bug --- src/components/Common/Typesetting/typesetting.js | 8 ++++---- src/components/QuickQuote/index.jsx | 42 +++++++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index 37737ba..ac49419 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -87,8 +87,8 @@ const Typesetting = props => { // 如果需要自定义排版数 // 确认是竖向排列还是横向排列 - const L = masterData?.dLength; - const W = masterData?.dWidth ; + const L = masterData?.dLength || 0; + const W = masterData?.dWidth || 0 ; const H = masterData?.dWidth || 0; const D = masterData?.dHeight || 0; @@ -222,8 +222,8 @@ const Typesetting = props => { const reference = sSGroupOffset === "首盒"; // 第三列参考 // 计算内层盒子尺寸 加上间距 - let jInnerHeight = innerHeight; - let jInnerWidth = innerWidth; + let jInnerHeight = innerHeight + dXBJJ * 2; + let jInnerWidth = innerWidth + dYBJJ * 2; let dSvgBoxWidth = innerWidth; let dSvgBoxHeight = innerHeight; if (iFAngle === 90 || iFAngle === 270 || iSAngle === 90 || iSAngle === 270) { diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 5b224c7..e33ca3a 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -190,8 +190,7 @@ const QuickQuoteEvent = props => { if (name === "master") { const { showName: sTreeNodeName } = selectedNode; - const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); - const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); + const masterDataNew = { ...masterData, ...changeValue }; masterDataNew.handleType = masterDataNew.handleType || "update"; masterDataNew.sId = masterDataNew.sId || commonUtils.createSid(); @@ -204,14 +203,27 @@ const QuickQuoteEvent = props => { } if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { - const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({ - ...item, - iColValue: item.iColValue || 6, - })); - slaveData[iIndex] = { - ...slaveData[iIndex], - upAbleConfigsExtra: sColumnNameConfig, - }; + if (props.currentBoxModel) { + const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", ""); + const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({ + ...item, + iColValue: item.iColValue || 6, + })); + slaveData[iIndex] = { + ...slaveData[iIndex], + upAbleConfigsExtra: sColumnNameConfig, + }; + } else { + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[0].sColumnNameConfig, []).map(item => ({ + ...item, + iColValue: item.iColValue || 6, + })); + slaveData[0] = { + ...slaveData[0], + upAbleConfigsExtra: sColumnNameConfig, + }; + } } setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); } else if (name.includes("slave")) { @@ -1928,7 +1940,7 @@ const BoxComponent = props => { (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || (Number(sStripType) === 1 && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) ) { - const slaveNewData = slaveRowData.upAbleConfigsExtra; + const slaveNewData = slaveRowData.upAbleConfigsExtra || JSON.parse(slaveRowData.sColumnNameConfig); const tables = [ { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, @@ -1966,10 +1978,10 @@ const BoxComponent = props => { }; // 确认是竖向排列还是横向排列 - const L = masterData?.dLength; - const W = masterData?.dWidth; - const H = masterData?.dWidth; - const D = masterData?.dHeight; + const L = masterData?.dLength || 0; + const W = masterData?.dWidth || 0; + const H = masterData?.dWidth || 0; + const D = masterData?.dHeight || 0; const variables = { L, W, -- libgit2 0.22.2