Commit b5759a1d39970dc1e8dd2a49b19ea603be882c2c
1 parent
1cbbd392
修复排版一个展示不下的问题
Showing
2 changed files
with
24 additions
and
7 deletions
src/components/Common/Typesetting/typesetting.js
| @@ -184,8 +184,8 @@ const Typesetting = props => { | @@ -184,8 +184,8 @@ const Typesetting = props => { | ||
| 184 | 184 | ||
| 185 | let DisableMateriallIcon = L ? sPackDetailPath : null; | 185 | let DisableMateriallIcon = L ? sPackDetailPath : null; |
| 186 | // 盒子展长展开公式计算 | 186 | // 盒子展长展开公式计算 |
| 187 | - const innerWidth = evaluateFormula(sLengthFormula, variabless); | ||
| 188 | - const innerHeight = evaluateFormula(sWidthFormula, variabless); | 187 | + const innerWidth = slaveRowData.sTypes === "6" ? evaluateFormula(sWidthFormula, variabless) : evaluateFormula(sLengthFormula, variabless); |
| 188 | + const innerHeight = slaveRowData.sTypes === "6" ? evaluateFormula(sLengthFormula, variabless) : evaluateFormula(sWidthFormula, variabless); | ||
| 189 | const { sSettingMethod, sSGroupOffset, iFAngle, iSAngle, sSecondorizontalOffset, sSecondLongitudinalOffset } = radioValue ? radioValue : {}; | 189 | const { sSettingMethod, sSGroupOffset, iFAngle, iSAngle, sSecondorizontalOffset, sSecondLongitudinalOffset } = radioValue ? radioValue : {}; |
| 190 | const dFWidthOffset = evaluateFormula(radioValue?.sFWidthOffset, variabless); // 首盒纵向偏移 | 190 | const dFWidthOffset = evaluateFormula(radioValue?.sFWidthOffset, variabless); // 首盒纵向偏移 |
| 191 | const dFLengthOffset = evaluateFormula(radioValue?.sFLengthOffset, variabless); // 首盒横向偏移 | 191 | const dFLengthOffset = evaluateFormula(radioValue?.sFLengthOffset, variabless); // 首盒横向偏移 |
| @@ -249,6 +249,7 @@ const Typesetting = props => { | @@ -249,6 +249,7 @@ const Typesetting = props => { | ||
| 249 | const commonHeightCheck = remainingHeight > jInnerHeight; | 249 | const commonHeightCheck = remainingHeight > jInnerHeight; |
| 250 | const commonWidthCheck = remainingWidth > jInnerWidth; | 250 | const commonWidthCheck = remainingWidth > jInnerWidth; |
| 251 | const isCustomized = bAdvancedSetting; | 251 | const isCustomized = bAdvancedSetting; |
| 252 | + | ||
| 252 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; | 253 | let remaining = isVertical ? commonHeightCheck : commonWidthCheck; |
| 253 | // const remaining = false; | 254 | // const remaining = false; |
| 254 | 255 | ||
| @@ -497,7 +498,15 @@ const Typesetting = props => { | @@ -497,7 +498,15 @@ const Typesetting = props => { | ||
| 497 | } | 498 | } |
| 498 | } | 499 | } |
| 499 | } | 500 | } |
| 500 | - | 501 | + // 如果第一行只能放下一个 |
| 502 | + if (cols === 0 && !isVertical) { | ||
| 503 | + const maxLength = Number(slaveDataDetail?.dMaxLength); | ||
| 504 | + if (maxLength > innerWidth) { | ||
| 505 | + let leftPosition = 0; | ||
| 506 | + let topPosition = 0; | ||
| 507 | + innerDivs.push(createBoxOne(0, rows, 3, leftPosition + dZBLB, topPosition + dSBLB, iFAngle, DisableMateriallIcon)); | ||
| 508 | + } | ||
| 509 | + } | ||
| 501 | // 判断展开长展开宽是否变化 | 510 | // 判断展开长展开宽是否变化 |
| 502 | if (dPartsLength !== innerWidth && !innerDivs.length) { | 511 | if (dPartsLength !== innerWidth && !innerDivs.length) { |
| 503 | setDPartsLength(innerWidth); | 512 | setDPartsLength(innerWidth); |
| @@ -513,7 +522,7 @@ const Typesetting = props => { | @@ -513,7 +522,7 @@ const Typesetting = props => { | ||
| 513 | const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); | 522 | const propsDataHeight = Number(propsData.props.style.height.slice(0, -2)); |
| 514 | const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); | 523 | const propsDataTop = Number(propsData.props.style.top.slice(0, -2)); |
| 515 | // 判断列是否是单独的 | 524 | // 判断列是否是单独的 |
| 516 | - const newMaterialLength = propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined); // 原纸长 | 525 | + const newMaterialLength = propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) - dYBJJ; // 原纸长 |
| 517 | const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; | 526 | const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; |
| 518 | // 计算开数 | 527 | // 计算开数 |
| 519 | const dSinglePQty = isVertical | 528 | const dSinglePQty = isVertical |
| @@ -537,7 +546,6 @@ const Typesetting = props => { | @@ -537,7 +546,6 @@ const Typesetting = props => { | ||
| 537 | newDHorizontalType !== dHorizontalType || | 546 | newDHorizontalType !== dHorizontalType || |
| 538 | newDPortraitType !== dPortraitType | 547 | newDPortraitType !== dPortraitType |
| 539 | ) { | 548 | ) { |
| 540 | - | ||
| 541 | setMaterialLength(newMaterialLength); | 549 | setMaterialLength(newMaterialLength); |
| 542 | setMaterialWidth(newMaterialWidth); | 550 | setMaterialWidth(newMaterialWidth); |
| 543 | setMaterialName(sMaterialsName); | 551 | setMaterialName(sMaterialsName); |
| @@ -915,7 +923,14 @@ const Typesetting = props => { | @@ -915,7 +923,14 @@ const Typesetting = props => { | ||
| 915 | </div> | 923 | </div> |
| 916 | </div> | 924 | </div> |
| 917 | ) : ( | 925 | ) : ( |
| 918 | - "" | 926 | + <div style={{ |
| 927 | + width:'100%', | ||
| 928 | + textAlign:'center', | ||
| 929 | + height:'300px', | ||
| 930 | + lineHeight:'300px', | ||
| 931 | + fontSize:'20px', | ||
| 932 | + fontWeight:'700' | ||
| 933 | + }}>排版尺寸大于上机尺寸,请确认参数!</div> | ||
| 919 | )} | 934 | )} |
| 920 | 935 | ||
| 921 | <Modal | 936 | <Modal |
src/mobile/components/SelectInput.jsx
| @@ -104,6 +104,7 @@ const SelectInput = props => { | @@ -104,6 +104,7 @@ const SelectInput = props => { | ||
| 104 | if (!visible) return; | 104 | if (!visible) return; |
| 105 | let { sDropDownType, sVisColumnName } = itemDetail; | 105 | let { sDropDownType, sVisColumnName } = itemDetail; |
| 106 | if (sVisColumnName && sVisColumnName === "sProcessName") { | 106 | if (sVisColumnName && sVisColumnName === "sProcessName") { |
| 107 | + | ||
| 107 | if (sDropDownType === "sql") { | 108 | if (sDropDownType === "sql") { |
| 108 | if (itemDetail.sParamDropDown) { | 109 | if (itemDetail.sParamDropDown) { |
| 109 | const { sParamDropDown = "", sName0, sName } = itemDetail; | 110 | const { sParamDropDown = "", sName0, sName } = itemDetail; |
| @@ -140,6 +141,7 @@ const SelectInput = props => { | @@ -140,6 +141,7 @@ const SelectInput = props => { | ||
| 140 | 141 | ||
| 141 | // getSqlDropDownData(searchValue); | 142 | // getSqlDropDownData(searchValue); |
| 142 | } else if ((sDropDownType = "const")) { | 143 | } else if ((sDropDownType = "const")) { |
| 144 | + | ||
| 143 | if (!itemDetail.showDropDown) return; | 145 | if (!itemDetail.showDropDown) return; |
| 144 | const list = Object.entries(JSON.parse(itemDetail.showDropDown)).map(([key, value]) => ({ | 146 | const list = Object.entries(JSON.parse(itemDetail.showDropDown)).map(([key, value]) => ({ |
| 145 | label: value, | 147 | label: value, |
| @@ -198,7 +200,7 @@ const SelectInput = props => { | @@ -198,7 +200,7 @@ const SelectInput = props => { | ||
| 198 | }} | 200 | }} |
| 199 | readOnly={bReadonly} | 201 | readOnly={bReadonly} |
| 200 | /> | 202 | /> |
| 201 | - {itemDetail.sDropDownType === 'sql'? ( | 203 | + {(itemDetail.sDropDownType === 'sql' || itemDetail.sDropDownType === 'const')? ( |
| 202 | <div className={styles.icons} onClick={clickBtn}> | 204 | <div className={styles.icons} onClick={clickBtn}> |
| 203 | <DownOutline /> | 205 | <DownOutline /> |
| 204 | </div> | 206 | </div> |