Commit ddddc2f1d96e9346e5215fab99e9d55a82dc98b9

Authored by 陈鑫涛
1 parent 5c636474

第一列展示

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