Commit 9463c85bfc4dedf91744c03f4886047207756cc6
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi
Showing
3 changed files
with
38 additions
and
44 deletions
src/components/Common/Typesetting/typesetting.js
| ... | ... | @@ -52,7 +52,8 @@ const Typesetting = props => { |
| 52 | 52 | const [materialName, setMaterialName] = useState(""); |
| 53 | 53 | const [dMaterialsKQty, setDMaterialsKQty] = useState(0); |
| 54 | 54 | const [dPartsLength, setDPartsLength] = useState(0); |
| 55 | - | |
| 55 | + const [newDHorizontalType, setNewDHorizontalType] = useState(0); | |
| 56 | + const [newDPortraitType, setNewDPortraitType] = useState(0); | |
| 56 | 57 | // 横板 |
| 57 | 58 | let { dHorizontal, dPortrait, dHorizontalType, dPortraitType } = slaveRowData; |
| 58 | 59 | // 使用 useRef 获取 DOM 元素 |
| ... | ... | @@ -73,11 +74,9 @@ const Typesetting = props => { |
| 73 | 74 | |
| 74 | 75 | let outerWidth = Number(slaveDataDetail?.dMaxLength); // 默认取最大上机尺寸 |
| 75 | 76 | let outerHeight = Number(slaveDataDetail?.dMaxWidth); // 默认取最大上机尺寸 |
| 76 | - dHorizontal = 2; | |
| 77 | + // dHorizontal = 1; | |
| 77 | 78 | // 如果需要自定义排版数 |
| 78 | 79 | |
| 79 | - console.log("🚀 ~ maxWidth:", dHorizontal, dPortrait, dHorizontalType, dPortraitType, outerWidth, outerHeight); | |
| 80 | - | |
| 81 | 80 | // 确认是竖向排列还是横向排列 |
| 82 | 81 | const L = masterData?.dLength; |
| 83 | 82 | const W = masterData?.dWidth; |
| ... | ... | @@ -248,43 +247,35 @@ const Typesetting = props => { |
| 248 | 247 | //剩余量能不能放一下单独一个 |
| 249 | 248 | const commonHeightCheck = remainingHeight > jInnerHeight; |
| 250 | 249 | const commonWidthCheck = remainingWidth > jInnerWidth; |
| 250 | + const isCustomized = false; | |
| 251 | 251 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; |
| 252 | - console.log( | |
| 253 | - cols, | |
| 254 | - rows, | |
| 255 | - innerWidth, | |
| 256 | - innerHeight, | |
| 257 | - jInnerWidth, | |
| 258 | - jInnerHeight, | |
| 259 | - innerWidthCombined, | |
| 260 | - innerHeightCombined, | |
| 261 | - remainingWidth, | |
| 262 | - remainingHeight, | |
| 263 | - colsMaxLength, | |
| 264 | - rowsMaxLength, | |
| 265 | - remaining, | |
| 266 | - isVertical, | |
| 267 | - boxLengthOffset, | |
| 268 | - boxWidthOffset, | |
| 269 | - dSLengthOffset, | |
| 270 | - dFLengthOffset, | |
| 271 | - "rowsMaxLength" | |
| 272 | - ); | |
| 273 | - // 从上到下 | |
| 274 | - if (isVertical) { | |
| 275 | - // dHorizontal, dPortrait, dHorizontalType, dPortraitType | |
| 276 | - // 如果dHorizontal 与 dHorizontalType 不相同 横板 | |
| 277 | - if (Number(dHorizontal) !== Number(dHorizontalType)) { | |
| 278 | - console.log(dHorizontal, "dHorizontal"); | |
| 279 | - } | |
| 280 | - } else { | |
| 281 | - if (Number(dHorizontal) !== Number(dHorizontalType)) { | |
| 282 | - // outerWidth = outerWidth - jInnerWidth; | |
| 283 | - } | |
| 284 | - if (Number(dPortrait) !== Number(dPortraitType)) { | |
| 285 | - console.log(dPortrait, "dPortrait"); | |
| 252 | + // const remaining = false; | |
| 253 | + | |
| 254 | + const isOdd = num => { | |
| 255 | + return num % 2 !== 0; | |
| 256 | + }; | |
| 257 | + | |
| 258 | + // 是否定制 | |
| 259 | + if (isCustomized) { | |
| 260 | + if (isVertical) { | |
| 261 | + cols = dHorizontal; | |
| 262 | + rows = Math.trunc(dPortrait / 2); | |
| 263 | + if (isOdd(dPortrait)) { | |
| 264 | + remaining = true; | |
| 265 | + } else { | |
| 266 | + remaining = false; | |
| 267 | + } | |
| 268 | + } else { | |
| 269 | + cols = Math.trunc(dHorizontal / 2); | |
| 270 | + rows = dPortrait; | |
| 271 | + if (isOdd(dHorizontal)) { | |
| 272 | + remaining = true; | |
| 273 | + } else { | |
| 274 | + remaining = false; | |
| 275 | + } | |
| 286 | 276 | } |
| 287 | 277 | } |
| 278 | + | |
| 288 | 279 | // 抵扣盒默认展示 svg |
| 289 | 280 | // const isSvg = props.slaveRowData.sName === "扣抵盒"; |
| 290 | 281 | // 组装svg数据 |
| ... | ... | @@ -533,7 +524,7 @@ const Typesetting = props => { |
| 533 | 524 | : rows * (cols * 2); |
| 534 | 525 | // 计算竖版数量 |
| 535 | 526 | const dHorizontalType = isVertical ? cols : remaining ? cols * 2 + 1 : cols * 2; |
| 536 | - const dPortraitType = isVertical ? rows * 2 : remaining ? rows : rows; | |
| 527 | + const dPortraitType = isVertical ? (remaining ? rows * 2 + 1 : rows * 2) : remaining ? rows : rows; | |
| 537 | 528 | |
| 538 | 529 | const newDProductQty = masterData.dProductQty; |
| 539 | 530 | const dMaterialsKQty = slaveDataDetail.dMaterialsKQty || 1; |
| ... | ... | @@ -541,13 +532,17 @@ const Typesetting = props => { |
| 541 | 532 | dPartsLength !== innerWidth || |
| 542 | 533 | newMaterialLength !== materialLength || |
| 543 | 534 | newMaterialWidth !== materialWidth || |
| 544 | - materialName !== sMaterialsName | |
| 535 | + materialName !== sMaterialsName || | |
| 536 | + newDHorizontalType !== dHorizontalType || | |
| 537 | + newDPortraitType !== dPortraitType | |
| 545 | 538 | ) { |
| 546 | 539 | setMaterialLength(newMaterialLength); |
| 547 | 540 | setMaterialWidth(newMaterialWidth); |
| 548 | 541 | setMaterialName(sMaterialsName); |
| 549 | 542 | setDProductQty(newDProductQty); |
| 550 | 543 | setDPartsLength(innerWidth); |
| 544 | + setNewDHorizontalType(dHorizontalType); | |
| 545 | + setNewDPortraitType(dPortraitType); | |
| 551 | 546 | // setDMaterialsKQty(newDMaterialsKQty) |
| 552 | 547 | const scaleX = (clientWidth - 50) / (outerWidth + 110); |
| 553 | 548 | const scaleY = (clientHeight - 5) / (outerHeight + 90); | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -1000,7 +1000,6 @@ const TreeComponent = props => { |
| 1000 | 1000 | // 点击节点后查询数据 |
| 1001 | 1001 | useEffect(() => { |
| 1002 | 1002 | if (!selectedNode.sId || commonUtils.isEmptyObject(slaveConfig)) return; |
| 1003 | - console.log(selectedNode,'selectedNode'); | |
| 1004 | 1003 | |
| 1005 | 1004 | timeRef.current += 1; |
| 1006 | 1005 | |
| ... | ... | @@ -1583,8 +1582,8 @@ const BoxComponent = props => { |
| 1583 | 1582 | scale: scale, |
| 1584 | 1583 | dPartsLength: innerWidth, |
| 1585 | 1584 | dPartsWidth: innerHeight, |
| 1586 | - dHorizontal: dHorizontal || dHorizontalType, | |
| 1587 | - dPortrait: dPortrait || dPortraitType, | |
| 1585 | + dHorizontal: dHorizontalType, | |
| 1586 | + dPortrait: dPortraitType, | |
| 1588 | 1587 | dHorizontalType: dHorizontalType, // 判断 |
| 1589 | 1588 | dPortraitType: dPortraitType, |
| 1590 | 1589 | }; | ... | ... |
src/mobile/quotation/detailNew.jsx
| ... | ... | @@ -1196,7 +1196,7 @@ const QuotationTabs = props => { |
| 1196 | 1196 | > |
| 1197 | 1197 | {sAllPartsNameList && sAllPartsNameList.length |
| 1198 | 1198 | ? sAllPartsNameList.map((pane, index) => ( |
| 1199 | - <Tabs.Tab key={pane} title={pane} style={{ position: "relative" }}> | |
| 1199 | + <Tabs.Tab key={pane} title={pane} > | |
| 1200 | 1200 | <BoxComponent {...tabsProps} paneKey={pane} /> |
| 1201 | 1201 | {/* <CloseOutline className={styles.tabClearBtn}/> */} |
| 1202 | 1202 | </Tabs.Tab> | ... | ... |