Commit 1ba48b0f89343f7a86906f6173ba53439343fd96

Authored by 陈鑫涛
1 parent a0e42b2c

材料

src/components/Common/BoxShowImgMaterial/indexNew.js
@@ -25,8 +25,8 @@ const BoxShowImgMaterial = props => { @@ -25,8 +25,8 @@ const BoxShowImgMaterial = props => {
25 // 计算可以放置的盒子数量 25 // 计算可以放置的盒子数量
26 const horizontalBoxes = Math.floor(dWlcd / dMachineLength); 26 const horizontalBoxes = Math.floor(dWlcd / dMachineLength);
27 const verticalBoxes = Math.floor(dWlkd / dMachineWidth); 27 const verticalBoxes = Math.floor(dWlkd / dMachineWidth);
28 - const scaleX = (clientWidth - 100) / dWlcd;  
29 - const scaleY = (clientHeight - 70) / dWlkd; 28 + const scaleX = (clientWidth - 100) / Number(dWlcd);
  29 + const scaleY = (clientHeight - 70) / Number(dWlkd);
30 // 动态生成多个 materialBox 30 // 动态生成多个 materialBox
31 const generateMaterialBoxes = () => { 31 const generateMaterialBoxes = () => {
32 const boxes = []; 32 const boxes = [];
@@ -170,7 +170,7 @@ const BoxShowImgMaterial = props => { @@ -170,7 +170,7 @@ const BoxShowImgMaterial = props => {
170 100 170 100
171 ).toFixed(2); 171 ).toFixed(2);
172 useEffect(() => { 172 useEffect(() => {
173 - // setBoxKey(new Date().getTime()); 173 + setBoxKey(new Date().getTime());
174 setTimeout(() => { 174 setTimeout(() => {
175 // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) 175 // if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current)
176 if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) { 176 if (boxRef.current && textRef.current && textRefs.current && nTextRef.current && nTextRefs.current) {
@@ -184,8 +184,8 @@ const BoxShowImgMaterial = props => { @@ -184,8 +184,8 @@ const BoxShowImgMaterial = props => {
184 textRefs.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`; 184 textRefs.current.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`;
185 textRefs.current.style.transformOrigin = "top left"; 185 textRefs.current.style.transformOrigin = "top left";
186 } 186 }
187 - }, 0);  
188 - }, [slaveDataDetail]); 187 + }, 10);
  188 + }, [scaleX,scaleY]);
189 const isMax = slaveDataDetail?.dMaxWidth * slaveDataDetail?.dMaxLength > slaveDataDetail?.dMachineLength * slaveDataDetail?.dMachineWidth; 189 const isMax = slaveDataDetail?.dMaxWidth * slaveDataDetail?.dMaxLength > slaveDataDetail?.dMachineLength * slaveDataDetail?.dMachineWidth;
190 const isDPartsLength = slaveDataDetail?.dPartsLength < slaveDataDetail?.dMaxLength && slaveDataDetail?.dPartsWidth < slaveDataDetail?.dMaxWidth; 190 const isDPartsLength = slaveDataDetail?.dPartsLength < slaveDataDetail?.dMaxLength && slaveDataDetail?.dPartsWidth < slaveDataDetail?.dMaxWidth;
191 191
src/components/Common/Typesetting/typesetting.js
@@ -567,6 +567,8 @@ const Typesetting = props =&gt; { @@ -567,6 +567,8 @@ const Typesetting = props =&gt; {
567 567
568 let openEdition = 0; 568 let openEdition = 0;
569 if (propsData && L) { 569 if (propsData && L) {
  570 + console.log(111111);
  571 +
570 const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName; 572 const sMaterialsName = slaveData.find(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel).sMaterialsName;
571 const propsDataLeft = Number(propsData.props.style.left.slice(0, -2)); 573 const propsDataLeft = Number(propsData.props.style.left.slice(0, -2));
572 // 长需要找出最大的 574 // 长需要找出最大的
@@ -612,6 +614,8 @@ const Typesetting = props =&gt; { @@ -612,6 +614,8 @@ const Typesetting = props =&gt; {
612 newDHorizontalType !== dHorizontalType || 614 newDHorizontalType !== dHorizontalType ||
613 newDPortraitType !== dPortraitType 615 newDPortraitType !== dPortraitType
614 ) { 616 ) {
  617 + console.log(222222);
  618 +
615 setMaterialLength(newMaterialLength); 619 setMaterialLength(newMaterialLength);
616 setMaterialWidth(newMaterialWidth); 620 setMaterialWidth(newMaterialWidth);
617 setMaterialName(sMaterialsName); 621 setMaterialName(sMaterialsName);
@@ -619,7 +623,7 @@ const Typesetting = props =&gt; { @@ -619,7 +623,7 @@ const Typesetting = props =&gt; {
619 setDPartsLength(innerWidth); 623 setDPartsLength(innerWidth);
620 setNewDHorizontalType(dHorizontalType); 624 setNewDHorizontalType(dHorizontalType);
621 setNewDPortraitType(dPortraitType); 625 setNewDPortraitType(dPortraitType);
622 - // setDMaterialsKQty(newDMaterialsKQty) 626 + setOldVariables(selectedNode.sTypeKey)
623 const scaleX = (clientWidth - 50) / (outerWidth + 110); 627 const scaleX = (clientWidth - 50) / (outerWidth + 110);
624 const scaleY = (clientHeight - 5) / (outerHeight + 90); 628 const scaleY = (clientHeight - 5) / (outerHeight + 90);
625 const newScale = Math.min(scaleX, scaleY); 629 const newScale = Math.min(scaleX, scaleY);
@@ -662,6 +666,9 @@ const Typesetting = props =&gt; { @@ -662,6 +666,9 @@ const Typesetting = props =&gt; {
662 dHorizontalType, 666 dHorizontalType,
663 dPortraitType 667 dPortraitType
664 ); 668 );
  669 + } else if (selectedNode.sTypeKey === 'kapai') {
  670 + console.log(111111111);
  671 +
665 } 672 }
666 openEdition = (((newMaterialLength * newMaterialWidth) / (maxWidth * maxHeight)) * 100).toFixed(2); 673 openEdition = (((newMaterialLength * newMaterialWidth) / (maxWidth * maxHeight)) * 100).toFixed(2);
667 674
src/components/QuickQuote/index.jsx
@@ -400,6 +400,8 @@ const QuickQuoteEvent = props =&gt; { @@ -400,6 +400,8 @@ const QuickQuoteEvent = props =&gt; {
400 ...slaveData[saveIndex], 400 ...slaveData[saveIndex],
401 dMachineQty: Math.floor(slaveData[saveIndex].dMachineQty / slaveData[saveIndex].dSinglePQty), 401 dMachineQty: Math.floor(slaveData[saveIndex].dMachineQty / slaveData[saveIndex].dSinglePQty),
402 dMaterialsKQty: newDMaterialsKQty, 402 dMaterialsKQty: newDMaterialsKQty,
  403 + newMaterialLength: sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd,
  404 + newMaterialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd,
403 }; 405 };
404 } 406 }
405 407
@@ -1098,6 +1100,7 @@ const QuickQuoteEvent = props =&gt; { @@ -1098,6 +1100,7 @@ const QuickQuoteEvent = props =&gt; {
1098 // 入口 1100 // 入口
1099 const QuickQuote = baseProps => { 1101 const QuickQuote = baseProps => {
1100 const props = QuickQuoteEvent(baseProps); 1102 const props = QuickQuoteEvent(baseProps);
  1103 + console.log("🚀 ~ QuickQuote:", props)
1101 const [treeClassName, setTreeClassName] = useState(""); 1104 const [treeClassName, setTreeClassName] = useState("");
1102 1105
1103 // 监听页面滚动事件 1106 // 监听页面滚动事件
@@ -1911,8 +1914,8 @@ const BoxComponent = props =&gt; { @@ -1911,8 +1914,8 @@ const BoxComponent = props =&gt; {
1911 sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸 1914 sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸
1912 sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸 1915 sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸
1913 sMaterialRate: (((length * width) / (slaveData[index].dWlcd * slaveData[index].dWlkd)) * 100).toFixed(2), 1916 sMaterialRate: (((length * width) / (slaveData[index].dWlcd * slaveData[index].dWlkd)) * 100).toFixed(2),
1914 - newMaterialLength: length,  
1915 - newMaterialWidth: width, 1917 + newMaterialLength: dWlcd,
  1918 + newMaterialWidth: dWlkd,
1916 sLayoutRate: Number( 1919 sLayoutRate: Number(
1917 ( 1920 (
1918 (((length || slaveData[index].materialLength) * (width || slaveData[index].materialWidth)) / 1921 (((length || slaveData[index].materialLength) * (width || slaveData[index].materialWidth)) /