diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index d87501c..67c3d61 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -460,6 +460,13 @@ const Typesetting = props => { }, [radioValue, slaveRowData, masterData, selectedNode, slaveData]); // 生成里层 div 的数组 const innerDivs = []; + // 如果第一列 + if (rows === 0) { + const maxWidth = Number(slaveDataDetail?.dMaxWidth) + if (maxWidth > innerHeight) { + rows = 1 + } + } for (let col = 0; col < cols; col++) { for (let row = 0; row < rows; row++) { const leftPosition = col * innerWidthCombined; @@ -507,6 +514,9 @@ const Typesetting = props => { innerDivs.push(createBoxOne(0, rows, 3, leftPosition + dZBLB, topPosition + dSBLB, iFAngle, DisableMateriallIcon)); } } + + console.log(cols,rows,'dadadad'); + // 判断展开长展开宽是否变化 if (dPartsLength !== innerWidth && !innerDivs.length) { setDPartsLength(innerWidth); @@ -524,6 +534,8 @@ const Typesetting = props => { // 判断列是否是单独的 const newMaterialLength = propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) - dYBJJ; // 原纸长 const newMaterialWidth = propsDataTop + propsDataHeight - dSBLB; + console.log("🚀 ~ newMaterialLength:", newMaterialLength,newMaterialWidth) + // 计算开数 const dSinglePQty = isVertical ? remaining @@ -615,6 +627,7 @@ const Typesetting = props => { Number(slaveDataDetail?.dMaxWidth) >= Number(slaveRowData?.dMachineWidth); const isShow = slaveRowData && slaveRowData.dMachineLength && slaveRowData.dMaxWidth && slaveRowData.dMaxLength && isMax && innerDivs.length; + if (isCustomized && !isShow) { if (isMobile) return; message.error("排版尺寸大于上机尺寸,请确认参数!"); @@ -936,7 +949,7 @@ const Typesetting = props => { wordWrap: "break-word", whiteSpace: "normal", overflow: "hidden", - textAlign:'center' + textAlign: "center", }} > { const addState = {}; @@ -1154,6 +1153,8 @@ const TreeComponent = props => { const { masterData = {} } = pre; const { sProductName, sProductUnit } = masterData; const showNameList = [...flattenArray(treeData).map(item => item.showName), ""]; + console.log(select.selectedNodes[0]?.treeNode ,'select.selectedNodes[0]?.treeNode '); + return { ...pre, selectedNode: select.selectedNodes[0]?.treeNode || {}, @@ -1293,14 +1294,14 @@ const MasterComponent = props => { const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); // 处理长宽样式 - const viewConfigs = selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); - if (selectedNode?.bBox && selectedNode.sTypeKey !== "kapai") { + const viewConfigs = !(selectedNode?.bBox && selectedNode.sTypeKey === "kapai" || selectedNode?.bBox && selectedNode.sTypeKey === "juantong") ? ableConfigs : ableConfigs.filter(x => x.sName !== "dHeight"); + if (!(selectedNode?.bBox && selectedNode.sTypeKey === "kapai" || selectedNode?.bBox && selectedNode.sTypeKey === "juantong")) { viewConfigs.forEach(item => { if (item.sName === "dLength" || item.sName === "dWidth") { item.iColValue = 4; } }); - } else { + } else { viewConfigs.forEach(item => { item.iColValue = viewConfigs[0].iColValue; }); @@ -1354,7 +1355,7 @@ const BoxComponent = props => { const [boxTypeList, setBoxTypeList] = useState([]); const [boxData, setBoxData] = useState([]); useEffect(() => { - if (selectedNode.sTypeKey === "kapai") { + if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { const getSqlDropDownData = async ({ sId }, cb) => { const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; const body = { @@ -1788,6 +1789,7 @@ const BoxComponent = props => { if ( (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) || (selectedNode.sTypeKey === "kapai" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) + ||(selectedNode.sTypeKey === "juantong" && slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth) ) { const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); const tables = [ @@ -1950,7 +1952,7 @@ const BoxComponent = props => { <>
-
{selectedNode.sTypeKey !== "kapai" ? : ""}
+
{!(selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") ? : ""}
{cailiaoyinshuaDiv}
{bBox && (