diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index 463eaaa..bbb3021 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -220,13 +220,11 @@ const Typesetting = props => { jInnerWidth = innerWidth; } - const innerHeightCombined = (isVertical - ? jInnerHeight * 2 + dSWidthOffset + dFWidthOffset - : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset)) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 + const innerHeightCombined = + (isVertical ? jInnerHeight * 2 + dSWidthOffset + dFWidthOffset : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset)) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 - const innerWidthCombined = (isVertical - ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) - : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset) + dYBJJ; + const innerWidthCombined = + (isVertical ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset) + dYBJJ; const style = { width: `${outerWidth}px`, @@ -269,8 +267,9 @@ const Typesetting = props => { const commonWidthCheck = remainingWidth > jInnerWidth + dYBJJ; const isCustomized = bAdvancedSetting; let remaining = isVertical ? commonHeightCheck : commonWidthCheck; - console.log(dSLengthOffset,'次盒横向偏移量'); - + console.log(dSLengthOffset, "次盒横向偏移量"); + console.log(dSWidthOffset, "次盒纵向偏移量"); + // 判断 // const remaining = false; const isOdd = num => { @@ -336,7 +335,7 @@ const Typesetting = props => {
{
{ if (cols > 0) { for (let col = 0; col < cols; col++) { const leftPosition = col * innerWidthCombined; - const topPosition = 0 * (innerHeightCombined ); + const topPosition = 0 * innerHeightCombined; innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } } if (rows > 0) { for (let row = 0; row < rows; row++) { const leftPosition = 0 * innerWidthCombined; - const topPosition = row * (innerHeightCombined); + const topPosition = row * innerHeightCombined; innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } } @@ -521,40 +520,40 @@ const Typesetting = props => { for (let col = 0; col < cols; col++) { for (let row = 0; row < rows; row++) { const leftPosition = col * innerWidthCombined; - const topPosition = row * (innerHeightCombined); + const topPosition = row * innerHeightCombined; innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } - // 如果可以放下首盒 - } - if (remaining) { - if (isVertical) { + // 如果可以放下首盒\ + if (remaining && isVertical) { let leftPosition = 0; let topPosition = 0; if (reference) { // 是否首盒 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距 - leftPosition = cols - 1 * innerWidthCombined + dFLengthOffset; - topPosition = rows * (innerHeightCombined ) + dFWidthOffset; + leftPosition = col * innerWidthCombined + dFLengthOffset; + topPosition = rows * innerHeightCombined + dFWidthOffset; } else { - leftPosition = cols - 1 * innerWidthCombined; - topPosition = rows * (innerHeightCombined); + leftPosition = col * innerWidthCombined; + topPosition = rows * innerHeightCombined; } - innerDivs.push(createBoxOne(cols - 1, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); - } else { - // 只会在横向排的时候 - for (let index = 0; index < rows; index++) { - // 先默认为首盒参考 - let topPosition = 0; - let leftPosition = 0; - if (reference) { - topPosition = index * (innerHeightCombined + boxWidthOffset) ; - leftPosition = cols * (innerWidthCombined + boxLengthOffset) ; - } else { - topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset) ; - leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset) + dYBJJ; - } - innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); + innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition + dXBJJ, iFAngle, DisableMateriallIcon)); + } + } + if (remaining && !isVertical) { + for (let index = 0; index < rows; index++) { + // 先默认为首盒参考 + let topPosition = 0; + let leftPosition = 0; + if (reference) { + topPosition = index * (innerHeightCombined + boxWidthOffset); + leftPosition = cols * (innerWidthCombined + boxLengthOffset); + } else { + topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset); + + leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset+dYBJJ) ; + } + innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } } } @@ -575,10 +574,9 @@ const Typesetting = props => { const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); // 判断列是否是单独的 - console.log(cols,rows,'rows'); - + const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长 - const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (rows >= 1 ? dXBJJ : 0)).toFixed(2); + const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0)).toFixed(2); // 计算开数 let dSinglePQty = isVertical diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index c89f349..21c40a2 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -245,8 +245,8 @@ const QuickQuoteEvent = props => { value: sParamDefault, sParam: sParam, [`sParams${index}`]: sParamDefault, - sParamKey: `sParam${iOrder}`, - sParamKeyNew: sFieldName || `sParam${iOrder}`, + sParamKey: `sParam${index}`, + sParamKeyNew: sFieldName || `sParam${index}`, }; }) .filter(item => item !== "");