From 1bc3c73f8ae1809e69c6ea62367416b971b75293 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Thu, 26 Jun 2025 14:24:24 +0800 Subject: [PATCH] 排版 --- src/components/Common/Typesetting/typesetting.js | 18 +++++++++++------- src/components/QuickQuote/index.jsx | 25 +++++++++++++------------ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index d73cf80..528195f 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -468,12 +468,14 @@ const Typesetting = props => { // 生成里层 div 的数组 const innerDivs = []; // 如果第一列 - if (rows === 0) { - const maxWidth = Number(slaveDataDetail?.dMaxWidth) - if (maxWidth > innerHeight) { - rows = 1 - } - } + // if (rows === 0) { + // const maxWidth = Number(slaveDataDetail?.dMaxWidth) + // if (maxWidth > innerHeight) { + // rows = 1 + // } + // } + console.log(cols,rows,'rows'); + for (let col = 0; col < cols; col++) { for (let row = 0; row < rows; row++) { const leftPosition = col * innerWidthCombined; @@ -540,6 +542,7 @@ const Typesetting = props => { // 判断列是否是单独的 const newMaterialLength = propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) - dYBJJ; // 原纸长 const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; + console.log("🚀 ~ newMaterialWidth:",propsData,propsDataTop,propsDataHeight, newMaterialWidth,newMaterialLength) // 计算开数 const dSinglePQty = isVertical @@ -631,7 +634,8 @@ const Typesetting = props => { Number(slaveDataDetail?.dMaxLength) >= Number(slaveRowData?.dMachineLength) && Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); - const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; + const isShow =slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; +console.log( slaveDataDetail?.dMaxLength,slaveDataDetail?.dMaxWidth,slaveRowData?.dMachineLength,slaveRowData?.dMachineWidth,isMax,isShow,'isMax'); if (isCustomized && !isShow) { if (isMobile) return; diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 50c5ecd..1d24c1c 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -1761,23 +1761,24 @@ const BoxComponent = props => { dHorizontalType: dHorizontalType, // 判断 dPortraitType: dPortraitType, }; - let juantongConfig = { + let juantongConfig = {}; + + if (selectedNode.sTypeKey === "juantong") { + console.log(selectedNode.sTypeKey,'sTypeKey'); - } - if (selectedNode.sTypeKey === 'juantong') { - const {dYBJJ,dXBJJ,dZBLB} = slaveData[index] + const { dYBJJ, dXBJJ, dZBLB } = slaveData[index]; juantongConfig = { - dColGap:dYBJJ, - dRowGap:dXBJJ, - iCol:dPortraitType, - iRow:dHorizontalType, - dCutEdge:dZBLB - } + dColGap: dYBJJ, + dRowGap: dXBJJ, + iCol: dPortraitType, + iRow: dHorizontalType, + dCutEdge: dZBLB, + }; } const newSlaveData = { + ...updatedProduct, ...juantongConfig, - ...updatedProduct - } + }; // 更新状态 props.setState(prevState => ({ ...prevState, -- libgit2 0.22.2