diff --git a/src/components/Common/BoxShowImgMaterial/indexNew.js b/src/components/Common/BoxShowImgMaterial/indexNew.js index 45050f5..6df12b0 100644 --- a/src/components/Common/BoxShowImgMaterial/indexNew.js +++ b/src/components/Common/BoxShowImgMaterial/indexNew.js @@ -25,6 +25,9 @@ const BoxShowImgMaterial = props => { const verticalBoxes = Math.floor(dWlkd / dMachineWidth); const scaleX = (clientWidth - 70) / (dWlcd); const scaleY = (clientHeight - 70) / (dWlkd); + const getNum =(num)=>{ + return Number(num).toFixed(0); + } // 动态生成多个 materialBox const generateMaterialBoxes = () => { const boxes = []; @@ -78,7 +81,7 @@ const BoxShowImgMaterial = props => { color: "red", }} > - {dMachineLength} + {getNum(dMachineLength)} { color: "red", }} > - {dMachineWidth} + {getNum(dMachineWidth)} { textRefs.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; textRefs.current.style.transformOrigin = "top left"; } - }, 0); + }, 1); // umijs 需要延时处理 }, [slaveDataDetail] ); @@ -192,7 +195,6 @@ const BoxShowImgMaterial = props => { const MaterialUtilizationRate = commonFunc.showLocalMessage(props, "MaterialUtilizationRate", "材料利用率"); const isShow = slaveDataDetail && slaveDataDetail.dMachineLength && slaveDataDetail.dMaxWidth && slaveDataDetail.dMaxLength && isMax; - console.log("🚀 ~ isDPartsLength:", isDPartsLength,isMax) return ( <> {isShow ? ( @@ -248,7 +250,7 @@ const BoxShowImgMaterial = props => { color: "red", }} > - {dWlcd} + {getNum(dWlcd)} { - {dWlkd} + {getNum(dWlkd)} { const newScale = Math.min(scaleX, scaleY); setScale(newScale); if (boxRef.current) { - boxRef.current.style.transform = `scale(${scaleX}, ${scaleY})`; + boxRef.current.style.transform = `scale(${newScale}, ${newScale})`; boxRef.current.style.transformOrigin = "top left"; } }, 0); @@ -871,7 +871,9 @@ const Typesetting = props => { setIsModalOpen(false); }; - + const getNum =(num)=>{ + return Number(num).toFixed(0); + } return ( <> {isShow ? ( @@ -928,7 +930,7 @@ const Typesetting = props => { transformOrigin: "top left", }} > - {materialLength} + {getNum(materialLength)}
{ transformOrigin: "top left", }} > - {materialWidth} + {getNum(materialWidth)} {isJuantong ? ( {
{ color: "red", }} > - {maxHeight} + {getNum(maxHeight)}
{ color: "#333", }} > - {materialLength} + {getNum(materialLength)}
{ overflow: "hide", }} > - {maxWidth} + {getNum(maxWidth)} {openEdition ? ( {OpenVersion}: @@ -1524,7 +1526,7 @@ const Typesetting = props => { color: "red", }} > - {maxHeight} + {getNum(maxHeight)}
{ newCopyTo.slave = commonUtils.isEmptyArr(slaveData) ? {} : slaveData[0]; for (let i = 0; i < partsNewInfo.length; i++) { const partInfo = partsNewInfo[i]; - console.log("🚀 ~ QuickQuoteEvent ~ partInfo:", partInfo) const iIndex = i; const partsDataRow = {}; for (const child of Object.keys(partInfo)) { @@ -2381,9 +2380,9 @@ const BoxComponent = props => { materialWidth: dWlkd, dMachineLength: dWlcd, // 上机长 dMachineWidth: dWlkd, // 上机宽 - sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸 + sMaterialsStyle: `${slaveData[index]?.dWlcd || dWlcd}*${slaveData[index]?.dWlkd || dWlkd}`, // 原纸尺寸 sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸 - sMaterialRate: (((length * width) / (slaveData[index].dWlcd * slaveData[index].dWlkd)) * 100).toFixed(2), + sMaterialRate: (((length * width) / ((slaveData[index].dWlcd || dWlcd) * (slaveData[index].dWlkd || dWlkd))) * 100).toFixed(2), newMaterialLength: dWlcd, newMaterialWidth: dWlkd, sLayoutRate: Number( @@ -3248,6 +3247,7 @@ const ManyComponent = props => { }, fixedHeight: 145, }; + const pricingInProgress = commonFunc.showLocalMessage(props, "sNuclearPricing", "核价中"); const progress = commonFunc.showLocalMessage(props, "progress", "进度"); return (