Commit f54583f30bb783944e530202ee6bc0813eefc4ce

Authored by 陈鑫涛
1 parent b9a3604b

排版

src/components/Common/Typesetting/typesetting.js
@@ -224,10 +224,11 @@ const Typesetting = props => { @@ -224,10 +224,11 @@ const Typesetting = props => {
224 : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 224 : Math.max(jInnerHeight + dFWidthOffset, jInnerHeight + dSWidthOffset) + dXBJJ; // 计算内层盒子高度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量
225 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量 225 // 计算内层盒子宽度 从上向下排列 取首盒加偏移量和次盒加偏移量最大的值 从左往右排列 盒子尺寸 * 2 加上首盒偏移量和次盒偏移量
226 const innerWidthCombined = isVertical 226 const innerWidthCombined = isVertical
227 - ? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) + dYBJJ 227 +? Math.max(jInnerWidth + dFLengthOffset, jInnerWidth + dSLengthOffset) + dYBJJ
228 : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset + dYBJJ; 228 : jInnerWidth * 2 + dSLengthOffset + dFLengthOffset + dYBJJ;
229 229
230 - console.log(innerWidthCombined,innerHeightCombined,jInnerWidth,jInnerHeight,'innerHeightCombined'); 230 + console.log(innerWidthCombined,dFLengthOffset,dSLengthOffset,jInnerWidth,'innerHeightCombined');
  231 + console.log(innerHeightCombined,dFWidthOffset,dSWidthOffset,innerHeightCombined,'innerHeightCombined');
231 232
232 const style = { 233 const style = {
233 width: `${outerWidth}px`, 234 width: `${outerWidth}px`,
@@ -517,14 +518,14 @@ const Typesetting = props => { @@ -517,14 +518,14 @@ const Typesetting = props => {
517 if (cols === 0 || rows === 0) { 518 if (cols === 0 || rows === 0) {
518 if (cols > 0) { 519 if (cols > 0) {
519 for (let col = 0; col < cols; col++) { 520 for (let col = 0; col < cols; col++) {
520 - const leftPosition = col * (innerWidthCombined + dYBJJ); 521 + const leftPosition = col * (innerWidthCombined);
521 const topPosition = 0 * (innerHeightCombined + dXBJJ); 522 const topPosition = 0 * (innerHeightCombined + dXBJJ);
522 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 523 innerDivs.push(createBoxOne(col, 0, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
523 } 524 }
524 } 525 }
525 if (rows > 0) { 526 if (rows > 0) {
526 for (let row = 0; row < rows; row++) { 527 for (let row = 0; row < rows; row++) {
527 - const leftPosition = 0 * (innerWidthCombined + dYBJJ); 528 + const leftPosition = 0 * (innerWidthCombined);
528 const topPosition = row * (innerHeightCombined + dXBJJ); 529 const topPosition = row * (innerHeightCombined + dXBJJ);
529 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 530 innerDivs.push(createBoxOne(0, row, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
530 } 531 }
@@ -532,8 +533,8 @@ const Typesetting = props =&gt; { @@ -532,8 +533,8 @@ const Typesetting = props =&gt; {
532 } else { 533 } else {
533 for (let col = 0; col < cols; col++) { 534 for (let col = 0; col < cols; col++) {
534 for (let row = 0; row < rows; row++) { 535 for (let row = 0; row < rows; row++) {
535 - const leftPosition = col * (innerWidthCombined + dYBJJ);  
536 - const topPosition = row * (innerHeightCombined + dXBJJ); 536 + const leftPosition = col * (innerWidthCombined);
  537 + const topPosition = row * (innerHeightCombined + dXBJJ) ;
537 innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 538 innerDivs.push(createBox(col, row, 1, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
538 } 539 }
539 // 如果可以放下首盒 540 // 如果可以放下首盒
@@ -544,10 +545,10 @@ const Typesetting = props =&gt; { @@ -544,10 +545,10 @@ const Typesetting = props =&gt; {
544 if (reference) { 545 if (reference) {
545 // 是否首盒 546 // 是否首盒
546 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距 547 // 首盒的上边距下边距 末尾盒子的上下边距 添加那一行的上边距
547 - leftPosition = col * (innerWidthCombined + dYBJJ) + dFLengthOffset; 548 + leftPosition = col * (innerWidthCombined) + dFLengthOffset;
548 topPosition = rows * (innerHeightCombined + dXBJJ) + dFWidthOffset; 549 topPosition = rows * (innerHeightCombined + dXBJJ) + dFWidthOffset;
549 } else { 550 } else {
550 - leftPosition = col * (innerWidthCombined + dYBJJ); 551 + leftPosition = col * (innerWidthCombined);
551 topPosition = rows * (innerHeightCombined + dXBJJ); 552 topPosition = rows * (innerHeightCombined + dXBJJ);
552 } 553 }
553 innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); 554 innerDivs.push(createBoxOne(col, rows, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
@@ -558,9 +559,9 @@ const Typesetting = props =&gt; { @@ -558,9 +559,9 @@ const Typesetting = props =&gt; {
558 let leftPosition = 0; 559 let leftPosition = 0;
559 if (reference) { 560 if (reference) {
560 topPosition = index * (innerHeightCombined + boxWidthOffset); 561 topPosition = index * (innerHeightCombined + boxWidthOffset);
561 - leftPosition = cols * (innerWidthCombined + boxLengthOffset); 562 + leftPosition = cols * (innerWidthCombined + boxLengthOffset + dXBJJ);
562 } else { 563 } else {
563 - topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset); 564 + topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset + dXBJJ);
564 leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset); 565 leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset);
565 } 566 }
566 innerDivs.push(createDiv(col, index, 3, leftPosition + col * dYBJJ, topPosition + index * dXBJJ, iFAngle, DisableMateriallIcon)); 567 innerDivs.push(createDiv(col, index, 3, leftPosition + col * dYBJJ, topPosition + index * dXBJJ, iFAngle, DisableMateriallIcon));