Commit ddddc2f1d96e9346e5215fab99e9d55a82dc98b9
1 parent
5c636474
第一列展示
Showing
2 changed files
with
22 additions
and
7 deletions
src/components/Common/Typesetting/typesetting.js
| ... | ... | @@ -460,6 +460,13 @@ const Typesetting = props => { |
| 460 | 460 | }, [radioValue, slaveRowData, masterData, selectedNode, slaveData]); |
| 461 | 461 | // 生成里层 div 的数组 |
| 462 | 462 | const innerDivs = []; |
| 463 | + // 如果第一列 | |
| 464 | + if (rows === 0) { | |
| 465 | + const maxWidth = Number(slaveDataDetail?.dMaxWidth) | |
| 466 | + if (maxWidth > innerHeight) { | |
| 467 | + rows = 1 | |
| 468 | + } | |
| 469 | + } | |
| 463 | 470 | for (let col = 0; col < cols; col++) { |
| 464 | 471 | for (let row = 0; row < rows; row++) { |
| 465 | 472 | const leftPosition = col * innerWidthCombined; |
| ... | ... | @@ -507,6 +514,9 @@ const Typesetting = props => { |
| 507 | 514 | innerDivs.push(createBoxOne(0, rows, 3, leftPosition + dZBLB, topPosition + dSBLB, iFAngle, DisableMateriallIcon)); |
| 508 | 515 | } |
| 509 | 516 | } |
| 517 | + | |
| 518 | + console.log(cols,rows,'dadadad'); | |
| 519 | + | |
| 510 | 520 | // 判断展开长展开宽是否变化 |
| 511 | 521 | if (dPartsLength !== innerWidth && !innerDivs.length) { |
| 512 | 522 | setDPartsLength(innerWidth); |
| ... | ... | @@ -524,6 +534,8 @@ const Typesetting = props => { |
| 524 | 534 | // 判断列是否是单独的 |
| 525 | 535 | const newMaterialLength = propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) - dYBJJ; // 原纸长 |
| 526 | 536 | const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; |
| 537 | + console.log("🚀 ~ newMaterialLength:", newMaterialLength,newMaterialWidth) | |
| 538 | + | |
| 527 | 539 | // 计算开数 |
| 528 | 540 | const dSinglePQty = isVertical |
| 529 | 541 | ? remaining |
| ... | ... | @@ -615,6 +627,7 @@ const Typesetting = props => { |
| 615 | 627 | Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); |
| 616 | 628 | |
| 617 | 629 | const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; |
| 630 | + | |
| 618 | 631 | if (isCustomized && !isShow) { |
| 619 | 632 | if (isMobile) return; |
| 620 | 633 | message.error("排版尺寸大于上机尺寸,请确认参数!"); |
| ... | ... | @@ -936,7 +949,7 @@ const Typesetting = props => { |
| 936 | 949 | wordWrap: "break-word", |
| 937 | 950 | whiteSpace: "normal", |
| 938 | 951 | overflow: "hidden", |
| 939 | - textAlign:'center' | |
| 952 | + textAlign: "center", | |
| 940 | 953 | }} |
| 941 | 954 | > |
| 942 | 955 | <span | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -15,7 +15,6 @@ import AntdDraggableModal from "@/components/Common/AntdDraggableModal"; |
| 15 | 15 | import styles from "./index.less"; |
| 16 | 16 | import Typesetting from "@/components/Common/Typesetting/typesetting"; |
| 17 | 17 | import DynamicSVG from "@/components/Common/BoxDesignCompontent/svg"; |
| 18 | -import Kapai from "./kapai.json"; | |
| 19 | 18 | // 事件 |
| 20 | 19 | const QuickQuoteEvent = props => { |
| 21 | 20 | const addState = {}; |
| ... | ... | @@ -1154,6 +1153,8 @@ const TreeComponent = props => { |
| 1154 | 1153 | const { masterData = {} } = pre; |
| 1155 | 1154 | const { sProductName, sProductUnit } = masterData; |
| 1156 | 1155 | const showNameList = [...flattenArray(treeData).map(item => item.showName), ""]; |
| 1156 | + console.log(select.selectedNodes[0]?.treeNode ,'select.selectedNodes[0]?.treeNode '); | |
| 1157 | + | |
| 1157 | 1158 | return { |
| 1158 | 1159 | ...pre, |
| 1159 | 1160 | selectedNode: select.selectedNodes[0]?.treeNode || {}, |
| ... | ... | @@ -1293,14 +1294,14 @@ const MasterComponent = props => { |
| 1293 | 1294 | |
| 1294 | 1295 | const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); |
| 1295 | 1296 | // 处理长宽样式 |
| 1296 | - const viewConfigs = selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); | |
| 1297 | - if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") { | |
| 1297 | + const viewConfigs = !(selectedNode?.bBox && selectedNode.sTypeKey === "kapai" || selectedNode?.bBox && selectedNode.sTypeKey === "juantong") ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); | |
| 1298 | + if (!(selectedNode?.bBox && selectedNode.sTypeKey === "kapai" || selectedNode?.bBox && selectedNode.sTypeKey === "juantong")) { | |
| 1298 | 1299 | viewConfigs.forEach(item => { |
| 1299 | 1300 | if (item.sName === "dLength" || item.sName === "dWidth") { |
| 1300 | 1301 | item.iColValue = 4; |
| 1301 | 1302 | } |
| 1302 | 1303 | }); |
| 1303 | - } else { | |
| 1304 | + } else { | |
| 1304 | 1305 | viewConfigs.forEach(item => { |
| 1305 | 1306 | item.iColValue = viewConfigs[0].iColValue; |
| 1306 | 1307 | }); |
| ... | ... | @@ -1354,7 +1355,7 @@ const BoxComponent = props => { |
| 1354 | 1355 | const [boxTypeList, setBoxTypeList] = useState([]); |
| 1355 | 1356 | const [boxData, setBoxData] = useState([]); |
| 1356 | 1357 | useEffect(() => { |
| 1357 | - if (selectedNode.sTypeKey === "kapai") { | |
| 1358 | + if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { | |
| 1358 | 1359 | const getSqlDropDownData = async ({ sId }, cb) => { |
| 1359 | 1360 | const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; |
| 1360 | 1361 | const body = { |
| ... | ... | @@ -1788,6 +1789,7 @@ const BoxComponent = props => { |
| 1788 | 1789 | if ( |
| 1789 | 1790 | (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || |
| 1790 | 1791 | (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) |
| 1792 | + ||(selectedNode.sTypeKey === "juantong" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) | |
| 1791 | 1793 | ) { |
| 1792 | 1794 | const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); |
| 1793 | 1795 | const tables = [ |
| ... | ... | @@ -1950,7 +1952,7 @@ const BoxComponent = props => { |
| 1950 | 1952 | <> |
| 1951 | 1953 | <div className={styles.boxPart1}> |
| 1952 | 1954 | <div className={styles.boxPart1Left}> |
| 1953 | - <div className={styles.viewTable1}>{selectedNode.sTypeKey !== "kapai" ? <CommonViewTable {...upViewProps} /> : ""}</div> | |
| 1955 | + <div className={styles.viewTable1}>{!(selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") ? <CommonViewTable {...upViewProps} /> : ""}</div> | |
| 1954 | 1956 | {cailiaoyinshuaDiv} |
| 1955 | 1957 | </div> |
| 1956 | 1958 | {bBox && ( | ... | ... |