Commit f0ea92b58927bfea2cf9430a4885dd64409e757e

Authored by 陈鑫涛
1 parent ba58beaa

同步盒型设计

src/components/Common/BoxDesign/createAirplaneBox.js
@@ -107,7 +107,7 @@ export const createPathElements = (x, y, width, height, id, wrapperId) => { @@ -107,7 +107,7 @@ export const createPathElements = (x, y, width, height, id, wrapperId) => {
107 return svg; 107 return svg;
108 }; 108 };
109 export const createPathElementTrapezoid = (x, y, width, height) => { 109 export const createPathElementTrapezoid = (x, y, width, height) => {
110 - const d = `M ${x + width * 0.1} ${y} L ${x} ${y + height} L ${x + width} ${y + height} L ${x + width * 0.9} ${y} L ${x + width * 0.2} ${y} `; 110 + const d = `M ${x + width * 0.2} ${y} L ${x} ${y + height} L ${x + width} ${y + height} L ${x + width * 0.8} ${y} L ${x + width * 0.2} ${y} `;
111 const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); 111 const svg = document.createElementNS("http://www.w3.org/2000/svg", "path");
112 svg.setAttribute("d", d); 112 svg.setAttribute("d", d);
113 svg.setAttribute("fill", "transparent"); 113 svg.setAttribute("fill", "transparent");
@@ -126,6 +126,16 @@ export const createPathElementTrapezoids = (x, y, width, height) => { @@ -126,6 +126,16 @@ export const createPathElementTrapezoids = (x, y, width, height) => {
126 // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果 126 // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果
127 return svg; 127 return svg;
128 }; 128 };
  129 +export const createPathElementTrapezoidBottom = (x, y, width, height) => {
  130 + const d = `M ${x } ${y} L ${x + width * 0.1} ${y + height} L ${x + width * 0.9} ${y + height} L ${x + width} ${y} L ${x } ${y}`;
  131 + const svg = document.createElementNS("http://www.w3.org/2000/svg", "path");
  132 + svg.setAttribute("d", d);
  133 + svg.setAttribute("fill", "transparent");
  134 + svg.setAttribute("stroke", "#7588B9");
  135 + svg.setAttribute("stroke-width", "1");
  136 + // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果
  137 + return svg;
  138 +};
129 export const createPathElementTrapezoidRight = (x, y, width, height) => { 139 export const createPathElementTrapezoidRight = (x, y, width, height) => {
130 const d = `M ${x} ${y} L ${x + width} ${y + height * 0.1} L ${x + width} ${y + height * 0.9} L ${x} ${y + height} L ${x} ${y}`; 140 const d = `M ${x} ${y} L ${x + width} ${y + height * 0.1} L ${x + width} ${y + height * 0.9} L ${x} ${y + height} L ${x} ${y}`;
131 const svg = document.createElementNS("http://www.w3.org/2000/svg", "path"); 141 const svg = document.createElementNS("http://www.w3.org/2000/svg", "path");
@@ -136,6 +146,7 @@ export const createPathElementTrapezoidRight = (x, y, width, height) => { @@ -136,6 +146,7 @@ export const createPathElementTrapezoidRight = (x, y, width, height) => {
136 // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果 146 // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果
137 return svg; 147 return svg;
138 }; 148 };
  149 +
139 // 150 //
140 // 左边斜线贴边 151 // 左边斜线贴边
141 export const createTrapezoid = (height, offsetX, offsetY, size) => { 152 export const createTrapezoid = (height, offsetX, offsetY, size) => {
src/components/Common/BoxDesignCompontent/index.js
1 /* eslint-disable */ 1 /* eslint-disable */
2 import React, { useRef, useState, useEffect } from "react"; 2 import React, { useRef, useState, useEffect } from "react";
3 -import { Select, Button, message, Input, Spin } from "antd-v4"; 3 +import { Select, Button, message, Input, Spin } from "antd";
4 import { CompressOutlined, ExpandOutlined } from "@ant-design/icons"; 4 import { CompressOutlined, ExpandOutlined } from "@ant-design/icons";
5 import * as commonUtils from "@/utils/utils"; 5 import * as commonUtils from "@/utils/utils";
6 import * as commonFunc from "@/components/Common/commonFunc"; 6 import * as commonFunc from "@/components/Common/commonFunc";
@@ -65,7 +65,6 @@ const BoxDesignEvent = props => { @@ -65,7 +65,6 @@ const BoxDesignEvent = props => {
65 } 65 }
66 return 0; // 其他元素保持原顺序 66 return 0; // 其他元素保持原顺序
67 }); 67 });
68 - console.log(data.data.dataset.rows, "data.data.dataset.rows");  
69 68
70 setOptions(data.data.dataset.rows); 69 setOptions(data.data.dataset.rows);
71 } 70 }
@@ -108,8 +107,6 @@ const BoxDesignCompontent = baseProps => { @@ -108,8 +107,6 @@ const BoxDesignCompontent = baseProps => {
108 const [boxKey, setBoxKey] = useState(new Date().getTime()); 107 const [boxKey, setBoxKey] = useState(new Date().getTime());
109 const [doubleLayerList, setDoubleLayerList] = useState([]); 108 const [doubleLayerList, setDoubleLayerList] = useState([]);
110 if (!boxVisible) return ""; 109 if (!boxVisible) return "";
111 - console.log(baseProps, "baseProps");  
112 -  
113 // 1️⃣ 只负责 tableColum 110 // 1️⃣ 只负责 tableColum
114 useEffect(() => { 111 useEffect(() => {
115 if (!tableData?.length) return; 112 if (!tableData?.length) return;
@@ -284,18 +281,18 @@ const BoxDesignCompontent = baseProps => { @@ -284,18 +281,18 @@ const BoxDesignCompontent = baseProps => {
284 sName: titleList1[i].name, 281 sName: titleList1[i].name,
285 sAssignFormula: item.sAssignFormula, 282 sAssignFormula: item.sAssignFormula,
286 bVisible: item.bVisible, 283 bVisible: item.bVisible,
287 - sLength: item.sLength,  
288 - sWidth: item.sWidth,  
289 - sType: item.sType,  
290 - sTypeName: item.sTypeName,  
291 - sOffset: item.sOffset,  
292 - sQuantity: item.sQuantity,  
293 - cLength: item.cLength,  
294 - cWidth: item.cWidth,  
295 - cType: item.cType,  
296 - cTypeName: item.cTypeName,  
297 - cOffset: item.cOffset,  
298 - cQuantity: item.cQuantity, 284 + sLength: item.iSLength,
  285 + sWidth: item.iSWidth,
  286 + sType: item.iSType,
  287 + sTypeName: item.iSType !== null ? (Number(item.iSType) === 0 ? "矩形" : Number(item.iSType) === 1 ? "梯形" : null) : null,
  288 + sOffset: item.sSOffset,
  289 + sQuantity: item.iSQuantity,
  290 + cLength: item.iCLength,
  291 + cWidth: item.iCWidth,
  292 + cType: item.iCType,
  293 + cTypeName: item.iCType !== null ? (Number(item.iCType) === 0 ? "矩形" : Number(item.iCType) === 1 ? "梯形" : null) : null,
  294 + cOffset: item.sCOffset,
  295 + cQuantity: item.iCQuantity,
299 }); 296 });
300 } 297 }
301 }); 298 });
@@ -534,12 +531,24 @@ const BoxDesignCompontent = baseProps => { @@ -534,12 +531,24 @@ const BoxDesignCompontent = baseProps => {
534 } 531 }
535 setBoxList(updatedBoxList); 532 setBoxList(updatedBoxList);
536 }; 533 };
537 - const getImage = fileName => {  
538 - // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&sModelsId=100&token=${props.token}`;  
539 - const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&scale=0.1&sModelsId=100&token=${props.token}`;  
540 - return imageUrl; 534 + // const getImage = fileName => {
  535 + // // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&sModelsId=100&token=${props.token}`;
  536 + // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&scale=0.1&sModelsId=100&token=${props.token}`;
  537 + // return imageUrl;
  538 + // };
  539 + const removeExtension = filename => {
  540 + const lastDotIndex = filename.lastIndexOf(".");
  541 + if (lastDotIndex === -1) {
  542 + // 如果字符串中没有点,则返回原字符串
  543 + return filename;
  544 + }
  545 + return filename.substring(0, lastDotIndex);
  546 + };
  547 + const getImage = sName => {
  548 + const fileName = removeExtension(sName);
  549 + const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${fileName}&date=${new Date().getTime()}`;
  550 + return imageUrlNew;
541 }; 551 };
542 -  
543 // 下来框 552 // 下来框
544 const renderOptionWithImage = option => { 553 const renderOptionWithImage = option => {
545 return ( 554 return (
@@ -581,6 +590,16 @@ const BoxDesignCompontent = baseProps => { @@ -581,6 +590,16 @@ const BoxDesignCompontent = baseProps => {
581 // 存储子表数据 590 // 存储子表数据
582 const boxTypes = boxList.find(item => item.sName === "盒身")?.type; 591 const boxTypes = boxList.find(item => item.sName === "盒身")?.type;
583 const findList = boxTypes === "8" ? doubleTitlieList1 : titleList1; 592 const findList = boxTypes === "8" ? doubleTitlieList1 : titleList1;
  593 + // boxList.forEach(item=>{
  594 + // if (item.type && item.type.includes('09')) {
  595 + // if (item.sName === "左贴边位" || item.sName === "右贴边位" ) {
  596 + // item.value = (item.sLength ? Number(item.sLength) : 0) + (item.cLength ? Number(item.cLength) : 0)
  597 + // } else {
  598 + // item.value = (item.sLength ? Number(item.sWidth) : 0 )+ (item.cLength ? Number(item.cWidth) : 0)
  599 + // }
  600 +
  601 + // }
  602 + // })
584 boxList.forEach((item, index) => { 603 boxList.forEach((item, index) => {
585 const i = findList.findIndex(i => i.name === item.sName); 604 const i = findList.findIndex(i => i.name === item.sName);
586 const slave = slaveData.find(z => z.sCode === findList[i]?.value); 605 const slave = slaveData.find(z => z.sCode === findList[i]?.value);
@@ -599,18 +618,18 @@ const BoxDesignCompontent = baseProps => { @@ -599,18 +618,18 @@ const BoxDesignCompontent = baseProps => {
599 bVisible: item.value ? true : false, 618 bVisible: item.value ? true : false,
600 sParentId: masterData.sId, 619 sParentId: masterData.sId,
601 sAssignFormula: item.sAssignFormula, 620 sAssignFormula: item.sAssignFormula,
602 - sLength: item.sLength,  
603 - sWidth: item.sWidth,  
604 - sType: item.sType,  
605 - sTypeName: Number(item.sType) === 0 ? "矩形" : "梯形",  
606 - sOffset: item.sOffset,  
607 - sQuantity: item.sQuantity,  
608 - cLength: item.cLength,  
609 - cWidth: item.cWidth,  
610 - cType: item.cType,  
611 - cTypeName: item.cTypeName,  
612 - cOffset: item.cOffset,  
613 - cQuantity: item.cQuantity, 621 + iSLength: item.sLength === undefined ? 0 : item.sLength,
  622 + iSWidth: item.sWidth === undefined ? 0 : item.sWidth,
  623 + iSType: item.sType === undefined ? 0 : item.sType,
  624 + iSTypeName: item.sType !== null ? (Number(item.sType) === 0 ? "矩形" : Number(item.sType) === 1 ? "梯形" : null) : null,
  625 + sSOffset: item.sOffset === undefined ? 0 : item.sOffset,
  626 + iSQuantity: item.sQuantity === undefined ? 0 : item.sQuantity,
  627 + iCLength: item.cLength === undefined ? 0 : item.cLength,
  628 + iCWidth: item.cWidth === undefined ? 0 : item.cWidth,
  629 + iCType: item.cType === undefined ? 0 : item.cType,
  630 + iCTypeName: item.cType !== null ? (Number(item.cType) === 0 ? "矩形" : Number(item.cType) === 1 ? "梯形" : null) : null,
  631 + sCOffset: item.cOffset === undefined ? 0 : item.cOffset,
  632 + iCQuantity: item.cQuantity === undefined ? 0 : item.cQuantity,
614 }; 633 };
615 // if (item.value !== "") { 634 // if (item.value !== "") {
616 newSlaveData.push(data); 635 newSlaveData.push(data);
@@ -1036,7 +1055,7 @@ const BoxDesignCompontent = baseProps => { @@ -1036,7 +1055,7 @@ const BoxDesignCompontent = baseProps => {
1036 <Select 1055 <Select
1037 optionLabelProp="label" 1056 optionLabelProp="label"
1038 className="mySelects" 1057 className="mySelects"
1039 - style={{ width: 180 }} 1058 + style={{ width: 180, height: 40 }}
1040 defaultValue={options.length ? options[0].value : ""} 1059 defaultValue={options.length ? options[0].value : ""}
1041 onSelect={(value, option) => handleSelect(value, option, index, 0)} 1060 onSelect={(value, option) => handleSelect(value, option, index, 0)}
1042 onDropdownVisibleChange={async open => { 1061 onDropdownVisibleChange={async open => {
@@ -1076,7 +1095,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1076,7 +1095,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1076 <Select 1095 <Select
1077 optionLabelProp="label" 1096 optionLabelProp="label"
1078 className="mySelectsDouble" 1097 className="mySelectsDouble"
1079 - style={{ width: 180, color: "#000" }} 1098 + style={{ width: 180, color: "#000", height: 40 }}
1080 defaultValue={options.length ? options[0].value : ""} 1099 defaultValue={options.length ? options[0].value : ""}
1081 value={topItem?.sTypeName || ""} 1100 value={topItem?.sTypeName || ""}
1082 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 0)} 1101 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 0)}
@@ -1134,7 +1153,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1134,7 +1153,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1134 <Select 1153 <Select
1135 optionLabelProp="label" 1154 optionLabelProp="label"
1136 className="mySelectsDouble" 1155 className="mySelectsDouble"
1137 - style={{ width: 180, color: "#000" }} 1156 + style={{ width: 180, color: "#000", height: 40 }}
1138 defaultValue={options.length ? options[0].value : ""} 1157 defaultValue={options.length ? options[0].value : ""}
1139 value={topItem?.cTypeName || ""} 1158 value={topItem?.cTypeName || ""}
1140 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 1)} 1159 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 1)}
@@ -1206,7 +1225,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1206,7 +1225,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1206 <Select 1225 <Select
1207 optionLabelProp="label" 1226 optionLabelProp="label"
1208 className="mySelects" 1227 className="mySelects"
1209 - style={{ width: 180 }} 1228 + style={{ width: 180, height: 40 }}
1210 defaultValue={options.length ? options[0].value : ""} 1229 defaultValue={options.length ? options[0].value : ""}
1211 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)} 1230 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1212 onDropdownVisibleChange={async open => { 1231 onDropdownVisibleChange={async open => {
@@ -1247,7 +1266,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1247,7 +1266,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1247 <Select 1266 <Select
1248 optionLabelProp="label" 1267 optionLabelProp="label"
1249 className="mySelects" 1268 className="mySelects"
1250 - style={{ width: 180 }} 1269 + style={{ width: 180, height: 40 }}
1251 defaultValue={options.length ? options[0].value : ""} 1270 defaultValue={options.length ? options[0].value : ""}
1252 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)} 1271 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1253 onDropdownVisibleChange={async open => { 1272 onDropdownVisibleChange={async open => {
@@ -1305,7 +1324,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1305,7 +1324,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1305 <Select 1324 <Select
1306 optionLabelProp="label" 1325 optionLabelProp="label"
1307 className="mySelectsDouble" 1326 className="mySelectsDouble"
1308 - style={{ width: 180, color: "#000" }} 1327 + style={{ width: 180, color: "#000", height: 40 }}
1309 defaultValue={options.length ? options[0].value : ""} 1328 defaultValue={options.length ? options[0].value : ""}
1310 value={item?.sTypeName || ""} 1329 value={item?.sTypeName || ""}
1311 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)} 1330 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
@@ -1363,7 +1382,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1363,7 +1382,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1363 <Select 1382 <Select
1364 optionLabelProp="label" 1383 optionLabelProp="label"
1365 className="mySelectsDouble" 1384 className="mySelectsDouble"
1366 - style={{ width: 180, color: "#000" }} 1385 + style={{ width: 180, color: "#000", height: 40 }}
1367 defaultValue={options.length ? options[0].value : ""} 1386 defaultValue={options.length ? options[0].value : ""}
1368 value={item?.cTypeName || ""} 1387 value={item?.cTypeName || ""}
1369 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)} 1388 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
@@ -1427,7 +1446,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1427,7 +1446,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1427 <Select 1446 <Select
1428 optionLabelProp="label" 1447 optionLabelProp="label"
1429 className="mySelects" 1448 className="mySelects"
1430 - style={{ width: 180 }} 1449 + style={{ width: 180, height: 40 }}
1431 defaultValue={options.length ? options[0].value : ""} 1450 defaultValue={options.length ? options[0].value : ""}
1432 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)} 1451 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1433 onDropdownVisibleChange={async open => { 1452 onDropdownVisibleChange={async open => {
@@ -1488,7 +1507,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1488,7 +1507,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1488 <Select 1507 <Select
1489 optionLabelProp="label" 1508 optionLabelProp="label"
1490 className="mySelects" 1509 className="mySelects"
1491 - style={{ width: 180 }} 1510 + style={{ width: 180, height: 40 }}
1492 defaultValue={options.length ? options[0].value : ""} 1511 defaultValue={options.length ? options[0].value : ""}
1493 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)} 1512 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1494 onDropdownVisibleChange={async open => { 1513 onDropdownVisibleChange={async open => {
@@ -1499,164 +1518,6 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1499,164 +1518,6 @@ const BoxDesignCompontent = baseProps =&gt; {
1499 > 1518 >
1500 {!loading ? options.map(option => renderOptionWithImage(option)) : ""} 1519 {!loading ? options.map(option => renderOptionWithImage(option)) : ""}
1501 </Select> 1520 </Select>
1502 -  
1503 - {/* {item?.type && item?.type.includes("09") ? (  
1504 - <div className={styles.boxInput}>  
1505 - <div className={styles.boxInput}>  
1506 - <div className={styles.text} style={{ width: " 100%" }}>  
1507 - 层1{" "}  
1508 - </div>  
1509 - <Input  
1510 - value={item?.sLength}  
1511 - onChange={e => handleChange(e, findIndexBySname(item.sName), "sLength")}  
1512 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1513 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1514 - readOnly={!item?.isEditable}  
1515 - style={{ width: " 80%" }}  
1516 - placeholder="长"  
1517 - />  
1518 - <Input  
1519 - value={item?.sWidth}  
1520 - onChange={e => handleChange(e, findIndexBySname(item.sName), "sWidth")}  
1521 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1522 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1523 - readOnly={!item?.isEditable}  
1524 - style={{ width: " 80%" }}  
1525 - placeholder="宽"  
1526 - />  
1527 - </div>  
1528 - <div className={styles.boxInput}>  
1529 - <Select  
1530 - optionLabelProp="label"  
1531 - className="mySelectsDouble"  
1532 - style={{ width: 180, color: "#000" }}  
1533 - defaultValue={options.length ? options[0].value : ""}  
1534 - value={item?.sTypeName || ""}  
1535 - onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}  
1536 - onDropdownVisibleChange={async open => {  
1537 - if (open) {  
1538 - props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions  
1539 - }  
1540 - }}  
1541 - >  
1542 - {!loading ? options.map(option => renderOptionWithText(option)) : ""}  
1543 - </Select>  
1544 - <Input  
1545 - value={item?.sQuantity}  
1546 - onChange={e => handleChange(e, findIndexBySname(item.sName), "sQuantity")}  
1547 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1548 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1549 - readOnly={!item?.isEditable}  
1550 - style={{ width: " 80%" }}  
1551 - placeholder="个数"  
1552 - />  
1553 - <Input  
1554 - value={item?.sOffset}  
1555 - onChange={e => handleChange(e, findIndexBySname(item.sName), "sOffset")}  
1556 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1557 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1558 - readOnly={!item?.isEditable}  
1559 - style={{ width: " 80%" }}  
1560 - placeholder="偏移"  
1561 - />  
1562 - </div>  
1563 - <div className={styles.boxInput}>  
1564 - <div className={styles.text} style={{ width: " 100%" }}>  
1565 - 层2{" "}  
1566 - </div>  
1567 - <Input  
1568 - value={item?.cLength}  
1569 - onChange={e => handleChange(e, findIndexBySname(item.sName), "cLength")}  
1570 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1571 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1572 - readOnly={!item?.isEditable}  
1573 - style={{ width: " 80%" }}  
1574 - placeholder="长"  
1575 - />  
1576 - <Input  
1577 - value={item?.cWidth}  
1578 - onChange={e => handleChange(e, findIndexBySname(item.sName), "cWidth")}  
1579 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1580 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1581 - readOnly={!item?.isEditable}  
1582 - style={{ width: " 80%" }}  
1583 - placeholder="宽"  
1584 - />  
1585 - </div>  
1586 - <div className={styles.boxInput}>  
1587 - <Select  
1588 - optionLabelProp="label"  
1589 - className="mySelectsDouble"  
1590 - style={{ width: 180, color: "#000" }}  
1591 - defaultValue={options.length ? options[0].value : ""}  
1592 - value={item?.cTypeName || ""}  
1593 - onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}  
1594 - onDropdownVisibleChange={async open => {  
1595 - if (open) {  
1596 - props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions  
1597 - }  
1598 - }}  
1599 - >  
1600 - {!loading ? options.map(option => renderOptionWithText(option)) : ""}  
1601 - </Select>  
1602 - <Input  
1603 - value={item?.cQuantity}  
1604 - onChange={e => handleChange(e, findIndexBySname(item.sName), "cQuantity")}  
1605 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1606 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1607 - readOnly={!item?.isEditable}  
1608 - style={{ width: " 80%" }}  
1609 - placeholder="个数"  
1610 - />  
1611 - <Input  
1612 - value={item?.cOffset}  
1613 - onChange={e => handleChange(e, findIndexBySname(item.sName), "cOffset")}  
1614 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1615 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1616 - readOnly={!item?.isEditable}  
1617 - style={{ width: " 80%" }}  
1618 - placeholder="偏移"  
1619 - />  
1620 - </div>  
1621 - </div>  
1622 - ) : (  
1623 - <div className={styles.boxInput}>  
1624 - {item?.selectImage ? (  
1625 - <img  
1626 - src={item?.selectImage}  
1627 - alt={item.value}  
1628 - style={{  
1629 - width: 40,  
1630 - height: 30,  
1631 - marginRight: 8,  
1632 - position: "absolute",  
1633 - left: 20,  
1634 - top: -35,  
1635 - zIndex: 10,  
1636 - }}  
1637 - />  
1638 - ) : (  
1639 - ""  
1640 - )}  
1641 -  
1642 - <Input  
1643 - value={item?.showName}  
1644 - onChange={e => handleChangeName(e, findIndexBySname(item.sName))}  
1645 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1646 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1647 - readOnly={!item?.isEditable}  
1648 - className={styles.text}  
1649 - />  
1650 - <Input  
1651 - value={item?.value}  
1652 - onChange={e => handleChange(e, findIndexBySname(item.sName))}  
1653 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1654 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1655 - readOnly={!item?.isEditable}  
1656 - style={{ width: " 80%" }}  
1657 - />  
1658 - </div>  
1659 - )} */}  
1660 <div className={styles.boxInput}> 1521 <div className={styles.boxInput}>
1661 {item?.selectImage ? ( 1522 {item?.selectImage ? (
1662 <img 1523 <img
@@ -1704,7 +1565,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1704,7 +1565,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1704 <Select 1565 <Select
1705 optionLabelProp="label" 1566 optionLabelProp="label"
1706 className="mySelectsDouble" 1567 className="mySelectsDouble"
1707 - style={{ width: 180, color: "#000" }} 1568 + style={{ width: 180, color: "#000", height: 40 }}
1708 defaultValue={options.length ? options[0].value : ""} 1569 defaultValue={options.length ? options[0].value : ""}
1709 value={item?.sTypeName || ""} 1570 value={item?.sTypeName || ""}
1710 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)} 1571 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
@@ -1762,7 +1623,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1762,7 +1623,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1762 <Select 1623 <Select
1763 optionLabelProp="label" 1624 optionLabelProp="label"
1764 className="mySelectsDouble" 1625 className="mySelectsDouble"
1765 - style={{ width: 180, color: "#000" }} 1626 + style={{ width: 180, color: "#000", height: 40 }}
1766 defaultValue={options.length ? options[0].value : ""} 1627 defaultValue={options.length ? options[0].value : ""}
1767 value={item?.cTypeName || ""} 1628 value={item?.cTypeName || ""}
1768 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)} 1629 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
@@ -1826,7 +1687,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1826,7 +1687,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1826 <Select 1687 <Select
1827 optionLabelProp="label" 1688 optionLabelProp="label"
1828 className="mySelects" 1689 className="mySelects"
1829 - style={{ width: 180 }} 1690 + style={{ width: 180, height: 40 }}
1830 defaultValue={options.length ? options[0].value : ""} 1691 defaultValue={options.length ? options[0].value : ""}
1831 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)} 1692 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1832 onDropdownVisibleChange={async open => { 1693 onDropdownVisibleChange={async open => {
@@ -1929,7 +1790,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1929,7 +1790,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1929 <Select 1790 <Select
1930 optionLabelProp="label" 1791 optionLabelProp="label"
1931 className="mySelects" 1792 className="mySelects"
1932 - style={{ width: "80%" }} 1793 + style={{ width: "80%", height: 40 }}
1933 defaultValue={boxList[uniqueIndex]?.value} 1794 defaultValue={boxList[uniqueIndex]?.value}
1934 onSelect={(value, option) => handleSelect(value, option, uniqueIndex, 1)} 1795 onSelect={(value, option) => handleSelect(value, option, uniqueIndex, 1)}
1935 onDropdownVisibleChange={async open => { 1796 onDropdownVisibleChange={async open => {
src/components/Common/BoxDesignCompontent/svg.js
@@ -52,6 +52,7 @@ import { @@ -52,6 +52,7 @@ import {
52 createPathElementTrapezoid, 52 createPathElementTrapezoid,
53 createPathElementTrapezoids, 53 createPathElementTrapezoids,
54 createPathElementTrapezoidRight, 54 createPathElementTrapezoidRight,
  55 + createPathElementTrapezoidBottom,
55 } from "../BoxDesign/createAirplaneBox"; 56 } from "../BoxDesign/createAirplaneBox";
56 const SvgBox = props => { 57 const SvgBox = props => {
57 const svgContainerRef = useRef(null); 58 const svgContainerRef = useRef(null);
@@ -140,13 +141,17 @@ const SvgBox = props =&gt; { @@ -140,13 +141,17 @@ const SvgBox = props =&gt; {
140 } 141 }
141 142
142 let viewBoxHeight = Number(boxHeight) + max; 143 let viewBoxHeight = Number(boxHeight) + max;
  144 + const doubleTotal = 0
  145 + // const doubleTotal =
  146 + // (zbtb?.type === "8009" ? Number(zbtb.sLength !== undefined ? zbtb.sLength : 0) + Number(zbtb.cLength !== undefined ? zbtb.cLength : 0) : 0) +
  147 + // (ybtb?.type === "9009" ? Number(ybtb.sLength !== undefined ? ybtb.sLength : 0) + Number(ybtb.cLength !== undefined ? ybtb.cLength : 0) : 0);
143 if (Number(svgType) === 1) { 148 if (Number(svgType) === 1) {
144 // 四面盒身 149 // 四面盒身
145 - viewBoxWidth = Number(boxLength) * 2 + Number(boxWidth) * 2 + dZTBW + dYTBW; 150 + viewBoxWidth = Number(boxLength) * 2 + Number(boxWidth) * 2 + dZTBW + dYTBW + doubleTotal;
146 } else if (Number(svgType) === 2) { 151 } else if (Number(svgType) === 2) {
147 - viewBoxWidth = boxLength * 2 + boxWidth + dYTBW + dZTBW; 152 + viewBoxWidth = boxLength * 2 + boxWidth + dYTBW + dZTBW + doubleTotal
148 } else if (Number(svgType) === 3) { 153 } else if (Number(svgType) === 3) {
149 - viewBoxWidth = boxLength + boxWidth * 2 + dYTBW + dZTBW; 154 + viewBoxWidth = boxLength + boxWidth * 2 + dYTBW + dZTBW + doubleTotal
150 } else if (Number(svgType) === 4) { 155 } else if (Number(svgType) === 4) {
151 // 天地盒 156 // 天地盒
152 157
@@ -213,7 +218,7 @@ const SvgBox = props =&gt; { @@ -213,7 +218,7 @@ const SvgBox = props =&gt; {
213 viewBoxWidth = Number(boxLength) + leftValue + rightValue; 218 viewBoxWidth = Number(boxLength) + leftValue + rightValue;
214 viewBoxHeight = Number(boxWidth) + topValue + bottomValue; 219 viewBoxHeight = Number(boxWidth) + topValue + bottomValue;
215 } else if (Number(svgType) === 5) { 220 } else if (Number(svgType) === 5) {
216 - viewBoxWidth = (boxHeight + boxWidth) * 2 + dYTBW + dZTBW; 221 + viewBoxWidth = (boxHeight + boxWidth) * 2 + dYTBW + dZTBW +doubleTotal
217 viewBoxHeight = boxLength + max; 222 viewBoxHeight = boxLength + max;
218 } else if (Number(svgType) === 6) { 223 } else if (Number(svgType) === 6) {
219 viewBoxWidth = boxWidth + 2; 224 viewBoxWidth = boxWidth + 2;
@@ -387,14 +392,16 @@ const SvgBox = props =&gt; { @@ -387,14 +392,16 @@ const SvgBox = props =&gt; {
387 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); 392 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
388 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength)); 393 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
389 } else if (Number(svgType) === 4) { 394 } else if (Number(svgType) === 4) {
390 - xSvg = 100 * scale; 395 + xSvg = (scaledDeep * 2 + scaledWidth) / 2;
391 } else { 396 } else {
392 xSvg = zbtb?.value; 397 xSvg = zbtb?.value;
393 } 398 }
  399 + if (zbtb?.type === "8009") {
  400 + xSvg = doubleTotal * scale;
  401 + }
394 svg.setAttribute( 402 svg.setAttribute(
395 "viewBox", 403 "viewBox",
396 - `${-(xSvg * scale)} ${dSvgBoxWidth ? (dSvgBoxWidth === 100 ? -ySvg : 0) : -ySvg} ${dSvgBoxWidth ? dSvgBoxWidth + ySvg : 500} ${  
397 - dSvgBoxHeight ? dSvgBoxHeight - ySvg - bottom * scale : 250 + ySvg 404 + `${-(xSvg * scale)} ${dSvgBoxWidth ? (dSvgBoxWidth === 100 ? -ySvg : 0) : -ySvg} ${dSvgBoxWidth ? dSvgBoxWidth + ySvg : 500} ${dSvgBoxHeight ? dSvgBoxHeight - ySvg - bottom * scale : 250 + ySvg
398 }` 405 }`
399 ); 406 );
400 svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`); 407 svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`);
@@ -454,12 +461,13 @@ const SvgBox = props =&gt; { @@ -454,12 +461,13 @@ const SvgBox = props =&gt; {
454 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); 461 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
455 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength)); 462 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
456 } else if (Number(svgType) === 4) { 463 } else if (Number(svgType) === 4) {
457 - xSvg = 100; 464 + xSvg = (scaledDeep * 2 + scaledWidth) / 2;
458 } else { 465 } else {
459 xSvg = zbtb?.value; 466 xSvg = zbtb?.value;
460 } 467 }
  468 +
461 if (!dSvgBoxWidth) { 469 if (!dSvgBoxWidth) {
462 - xSvg = viewBoxWidth / 2 + 100 * scale; 470 + xSvg = (viewBoxWidth / 2 + 200) * scale;
463 } 471 }
464 svg.setAttribute( 472 svg.setAttribute(
465 "viewBox", 473 "viewBox",
@@ -471,8 +479,6 @@ const SvgBox = props =&gt; { @@ -471,8 +479,6 @@ const SvgBox = props =&gt; {
471 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`; 479 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`;
472 } 480 }
473 } else if (props.showNew === 1) { 481 } else if (props.showNew === 1) {
474 - console.log("props.showNew === 1");  
475 -  
476 let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale; 482 let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
477 let leftSize = 0; 483 let leftSize = 0;
478 let topSize = 0; 484 let topSize = 0;
@@ -544,11 +550,12 @@ const SvgBox = props =&gt; { @@ -544,11 +550,12 @@ const SvgBox = props =&gt; {
544 ySvg = topOffect(boxList, headLength, headWidth); 550 ySvg = topOffect(boxList, headLength, headWidth);
545 } else { 551 } else {
546 leftSize = zbtb?.value; 552 leftSize = zbtb?.value;
547 - if (zbtb?.type === "8009") {  
548 - leftSize = (Number(zbtb?.sLength) + Number(zbtb?.cLength) * scale) || 0; 553 + if (zbtb?.type === "8009") {
  554 + leftSize = (zbtb?.type === "8009" ? Number(zbtb.sLength !== undefined ? zbtb.sLength : 0) + Number(zbtb.cLength !== undefined ? zbtb.cLength : 0) : 0);
549 } 555 }
550 } 556 }
551 557
  558 +
552 svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth + 2} ${viewBoxHeight + 2}`); 559 svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth + 2} ${viewBoxHeight + 2}`);
553 svg.setAttribute("width", `${viewBoxWidth}px`); 560 svg.setAttribute("width", `${viewBoxWidth}px`);
554 svg.setAttribute("height", `${viewBoxHeight}px`); 561 svg.setAttribute("height", `${viewBoxHeight}px`);
@@ -828,7 +835,7 @@ const SvgBox = props =&gt; { @@ -828,7 +835,7 @@ const SvgBox = props =&gt; {
828 const numOffset = Number(offset) * scale; 835 const numOffset = Number(offset) * scale;
829 836
830 // 选择绘制函数 837 // 选择绘制函数
831 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 838 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
832 839
833 let rectangles = []; 840 let rectangles = [];
834 841
@@ -875,7 +882,7 @@ const SvgBox = props =&gt; { @@ -875,7 +882,7 @@ const SvgBox = props =&gt; {
875 const numOffset = Number(offset) * scale; 882 const numOffset = Number(offset) * scale;
876 883
877 // 选择绘制函数 884 // 选择绘制函数
878 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 885 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
879 886
880 let rectangles = []; 887 let rectangles = [];
881 888
@@ -1684,7 +1691,7 @@ const SvgBox = props =&gt; { @@ -1684,7 +1691,7 @@ const SvgBox = props =&gt; {
1684 const numOffset = Number(offset) * scale; 1691 const numOffset = Number(offset) * scale;
1685 1692
1686 // 选择绘制函数 1693 // 选择绘制函数
1687 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 1694 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
1688 1695
1689 let rectangles = []; 1696 let rectangles = [];
1690 1697
@@ -2134,7 +2141,7 @@ const SvgBox = props =&gt; { @@ -2134,7 +2141,7 @@ const SvgBox = props =&gt; {
2134 const numOffset = Number(offset) * scale; 2141 const numOffset = Number(offset) * scale;
2135 2142
2136 // 选择绘制函数 2143 // 选择绘制函数
2137 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 2144 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
2138 2145
2139 let rectangles = []; 2146 let rectangles = [];
2140 2147
@@ -2233,7 +2240,7 @@ const SvgBox = props =&gt; { @@ -2233,7 +2240,7 @@ const SvgBox = props =&gt; {
2233 const numOffset = Number(offset) * scale; 2240 const numOffset = Number(offset) * scale;
2234 2241
2235 // 选择绘制函数 2242 // 选择绘制函数
2236 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 2243 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
2237 2244
2238 let rectangles = []; 2245 let rectangles = [];
2239 2246
@@ -2519,7 +2526,7 @@ const SvgBox = props =&gt; { @@ -2519,7 +2526,7 @@ const SvgBox = props =&gt; {
2519 const numOffset = Number(offset) * scale; 2526 const numOffset = Number(offset) * scale;
2520 2527
2521 // 选择绘制函数 2528 // 选择绘制函数
2522 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 2529 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
2523 2530
2524 let rectangles = []; 2531 let rectangles = [];
2525 2532
@@ -2566,7 +2573,7 @@ const SvgBox = props =&gt; { @@ -2566,7 +2573,7 @@ const SvgBox = props =&gt; {
2566 const numOffset = Number(offset) * scale; 2573 const numOffset = Number(offset) * scale;
2567 2574
2568 // 选择绘制函数 2575 // 选择绘制函数
2569 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 2576 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
2570 2577
2571 let rectangles = []; 2578 let rectangles = [];
2572 2579
@@ -2833,7 +2840,7 @@ const SvgBox = props =&gt; { @@ -2833,7 +2840,7 @@ const SvgBox = props =&gt; {
2833 const numOffset = Number(offset) * scale; 2840 const numOffset = Number(offset) * scale;
2834 2841
2835 // 选择绘制函数 2842 // 选择绘制函数
2836 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 2843 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
2837 2844
2838 let rectangles = []; 2845 let rectangles = [];
2839 2846
@@ -3201,7 +3208,7 @@ const SvgBox = props =&gt; { @@ -3201,7 +3208,7 @@ const SvgBox = props =&gt; {
3201 const numOffset = Number(offset) * scale; 3208 const numOffset = Number(offset) * scale;
3202 3209
3203 // 选择绘制函数 3210 // 选择绘制函数
3204 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 3211 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
3205 3212
3206 let rectangles = []; 3213 let rectangles = [];
3207 3214
@@ -3248,7 +3255,7 @@ const SvgBox = props =&gt; { @@ -3248,7 +3255,7 @@ const SvgBox = props =&gt; {
3248 const numOffset = Number(offset) * scale; 3255 const numOffset = Number(offset) * scale;
3249 3256
3250 // 选择绘制函数 3257 // 选择绘制函数
3251 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 3258 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
3252 3259
3253 let rectangles = []; 3260 let rectangles = [];
3254 3261
@@ -3652,7 +3659,7 @@ const SvgBox = props =&gt; { @@ -3652,7 +3659,7 @@ const SvgBox = props =&gt; {
3652 const numOffset = Number(offset) * scale; 3659 const numOffset = Number(offset) * scale;
3653 3660
3654 // 选择绘制函数 3661 // 选择绘制函数
3655 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 3662 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
3656 3663
3657 let rectangles = []; 3664 let rectangles = [];
3658 3665
@@ -3928,7 +3935,7 @@ const SvgBox = props =&gt; { @@ -3928,7 +3935,7 @@ const SvgBox = props =&gt; {
3928 const numOffset = Number(offset) * scale; 3935 const numOffset = Number(offset) * scale;
3929 3936
3930 // 选择绘制函数 3937 // 选择绘制函数
3931 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 3938 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
3932 3939
3933 let rectangles = []; 3940 let rectangles = [];
3934 3941
@@ -3975,7 +3982,7 @@ const SvgBox = props =&gt; { @@ -3975,7 +3982,7 @@ const SvgBox = props =&gt; {
3975 const numOffset = Number(offset) * scale; 3982 const numOffset = Number(offset) * scale;
3976 3983
3977 // 选择绘制函数 3984 // 选择绘制函数
3978 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 3985 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
3979 3986
3980 let rectangles = []; 3987 let rectangles = [];
3981 3988
@@ -4453,7 +4460,7 @@ const SvgBox = props =&gt; { @@ -4453,7 +4460,7 @@ const SvgBox = props =&gt; {
4453 const numOffset = Number(offset) * scale; 4460 const numOffset = Number(offset) * scale;
4454 4461
4455 // 选择绘制函数 4462 // 选择绘制函数
4456 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 4463 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
4457 4464
4458 let rectangles = []; 4465 let rectangles = [];
4459 4466
@@ -4556,7 +4563,7 @@ const SvgBox = props =&gt; { @@ -4556,7 +4563,7 @@ const SvgBox = props =&gt; {
4556 const numOffset = Number(offset) * scale; 4563 const numOffset = Number(offset) * scale;
4557 4564
4558 // 选择绘制函数 4565 // 选择绘制函数
4559 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 4566 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
4560 4567
4561 let rectangles = []; 4568 let rectangles = [];
4562 4569
@@ -4797,7 +4804,7 @@ const SvgBox = props =&gt; { @@ -4797,7 +4804,7 @@ const SvgBox = props =&gt; {
4797 const numOffset = Number(offset) * scale; 4804 const numOffset = Number(offset) * scale;
4798 4805
4799 // 选择绘制函数 4806 // 选择绘制函数
4800 - const createFunc = isTrapezoid ? createPathElementTrapezoid : createPathElements; 4807 + const createFunc = isTrapezoid ? createPathElementTrapezoidBottom : createPathElements;
4801 4808
4802 let rectangles = []; 4809 let rectangles = [];
4803 4810
src/components/QuickQuote/index.jsx
1 /* eslint-disable */ 1 /* eslint-disable */
2 import { useRef, useEffect, useState, useCallback, useMemo } from "react"; 2 import { useRef, useEffect, useState, useCallback, useMemo } from "react";
3 -import { Button, Divider, Tabs, Tree, Radio, Image, Modal, Input, message, Badge, Checkbox, Carousel } from "antd-v4"; 3 +import { Button, Divider, Tabs, Tree, Radio, Image, Modal, Input, message, Badge, Checkbox, Carousel } from "antd";
4 import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined, UploadOutlined } from "@ant-design/icons"; 4 import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined, UploadOutlined } from "@ant-design/icons";
5 import { cloneDeep } from "lodash"; 5 import { cloneDeep } from "lodash";
6 import commonConfig from "@/utils/config"; 6 import commonConfig from "@/utils/config";
@@ -53,21 +53,21 @@ const QuickQuoteEvent = props =&gt; { @@ -53,21 +53,21 @@ const QuickQuoteEvent = props =&gt; {
53 ]; 53 ];
54 const slaveDataNew = bInit 54 const slaveDataNew = bInit
55 ? slaveData.map(item => { 55 ? slaveData.map(item => {
56 - const { materialsInfo = [], sMaterialsName } = item;  
57 - if (!materialsInfo.length && sMaterialsName) {  
58 - return {  
59 - ...item,  
60 - materialsInfo: [  
61 - materialInfoFields.reduce((pre, cur) => {  
62 - pre[cur] = item[cur];  
63 - return pre;  
64 - }, {}),  
65 - ],  
66 - };  
67 - } else {  
68 - return item;  
69 - }  
70 - }) 56 + const { materialsInfo = [], sMaterialsName } = item;
  57 + if (!materialsInfo.length && sMaterialsName) {
  58 + return {
  59 + ...item,
  60 + materialsInfo: [
  61 + materialInfoFields.reduce((pre, cur) => {
  62 + pre[cur] = item[cur];
  63 + return pre;
  64 + }, {}),
  65 + ],
  66 + };
  67 + } else {
  68 + return item;
  69 + }
  70 + })
71 : slaveData; 71 : slaveData;
72 72
73 const manyDataNew = manyData.map(item => { 73 const manyDataNew = manyData.map(item => {
@@ -317,6 +317,8 @@ const QuickQuoteEvent = props =&gt; { @@ -317,6 +317,8 @@ const QuickQuoteEvent = props =&gt; {
317 const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); 317 const boxModel = name.replace("slaveUp", "").replace("slaveDown", "");
318 318
319 if (sFieldName === "sName") { 319 if (sFieldName === "sName") {
  320 + let upAbleConfigsList = []
  321 +
320 if (!changeValue.sName) return; 322 if (!changeValue.sName) return;
321 const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName); 323 const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName);
322 const { sColumnNameConfig, sColumnNameConfigExclusion, sColumnNameConfigPic } = dropDownDataSelected; 324 const { sColumnNameConfig, sColumnNameConfigExclusion, sColumnNameConfigPic } = dropDownDataSelected;
@@ -327,11 +329,31 @@ const QuickQuoteEvent = props =&gt; { @@ -327,11 +329,31 @@ const QuickQuoteEvent = props =&gt; {
327 const defaultData = commonFunc.getDefaultData({ gdsconfigformslave: upAbleConfigsExtra }); 329 const defaultData = commonFunc.getDefaultData({ gdsconfigformslave: upAbleConfigsExtra });
328 delete defaultData.sId; 330 delete defaultData.sId;
329 delete dropDownDataSelected.sId; 331 delete dropDownDataSelected.sId;
  332 + upAbleConfigsExtra?.forEach(item => {
  333 + if (item.sTypes && item.sTypes.includes('09')) {
  334 + const list = ['iSLength', 'iSWidth', 'iCLength', 'iCWidth']
  335 + const nameList = ['层1长', '层1宽', '层2长', '层2宽']
  336 + for (let index = 0; index < 4; index++) {
  337 + upAbleConfigsList.push({
  338 + ...item,
  339 + sName: item.sName + list[index],
  340 + sDefault: item[list[index]],
  341 + showName: item.showName + nameList[index]
  342 + })
  343 + }
  344 + } else {
  345 + upAbleConfigsList.push(item)
  346 + }
  347 + })
330 changeValue = { 348 changeValue = {
331 ...changeValue, 349 ...changeValue,
332 ...defaultData, 350 ...defaultData,
333 ...dropDownDataSelected, 351 ...dropDownDataSelected,
334 upAbleConfigsExtra, 352 upAbleConfigsExtra,
  353 + ...upAbleConfigsList.reduce((acc, item) => {
  354 + acc[item.sName] = item.sDefault;
  355 + return acc;
  356 + }, {}),
335 calcMethodData: commonUtils.convertStrToObj(sColumnNameConfigExclusion, []), 357 calcMethodData: commonUtils.convertStrToObj(sColumnNameConfigExclusion, []),
336 boxPicData: commonUtils.convertStrToObj(sColumnNameConfigPic, []), 358 boxPicData: commonUtils.convertStrToObj(sColumnNameConfigPic, []),
337 }; 359 };
@@ -369,13 +391,13 @@ const QuickQuoteEvent = props =&gt; { @@ -369,13 +391,13 @@ const QuickQuoteEvent = props =&gt; {
369 return !sParamDefault 391 return !sParamDefault
370 ? "" 392 ? ""
371 : { 393 : {
372 - sId: commonUtils.createSid(),  
373 - value: sParamDefault,  
374 - sParam: sParam,  
375 - [`sParam${iOrder}`]: sParamDefault,  
376 - ...(sFieldName ? { [sFieldName]: sParamDefault } : {}),  
377 - sParamKey: sFieldName || `sParam${iOrder}`,  
378 - }; 394 + sId: commonUtils.createSid(),
  395 + value: sParamDefault,
  396 + sParam: sParam,
  397 + [`sParam${iOrder}`]: sParamDefault,
  398 + ...(sFieldName ? { [sFieldName]: sParamDefault } : {}),
  399 + sParamKey: sFieldName || `sParam${iOrder}`,
  400 + };
379 }) 401 })
380 .filter(item => item !== ""); 402 .filter(item => item !== "");
381 dropDownDataSelected.sBackendParams = sBackendParams; 403 dropDownDataSelected.sBackendParams = sBackendParams;
@@ -424,12 +446,12 @@ const QuickQuoteEvent = props =&gt; { @@ -424,12 +446,12 @@ const QuickQuoteEvent = props =&gt; {
424 slaveData[iIndex] = { 446 slaveData[iIndex] = {
425 ...(sFieldName === "sName" 447 ...(sFieldName === "sName"
426 ? { 448 ? {
427 - sId: slaveData[iIndex].sId,  
428 - sBoxModel: boxModel,  
429 - sTreeNodeName,  
430 - ...commonFunc.getDefaultData(slaveConfig, { tree: selectedNode }),  
431 - sBackProcessData: slaveData[iIndex].sBackProcessData,  
432 - } 449 + sId: slaveData[iIndex].sId,
  450 + sBoxModel: boxModel,
  451 + sTreeNodeName,
  452 + ...commonFunc.getDefaultData(slaveConfig, { tree: selectedNode }),
  453 + sBackProcessData: slaveData[iIndex].sBackProcessData,
  454 + }
433 : slaveData[iIndex]), 455 : slaveData[iIndex]),
434 ...changeValue, 456 ...changeValue,
435 handleType: slaveData[iIndex].handleType || "update", 457 handleType: slaveData[iIndex].handleType || "update",
@@ -439,6 +461,8 @@ const QuickQuoteEvent = props =&gt; { @@ -439,6 +461,8 @@ const QuickQuoteEvent = props =&gt; {
439 const saveIndex = slaveData.findIndex(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel); 461 const saveIndex = slaveData.findIndex(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel);
440 const materialStyleLength = slaveData[saveIndex].materialLength || 0; 462 const materialStyleLength = slaveData[saveIndex].materialLength || 0;
441 const materialStyleWidth = slaveData[saveIndex].materialWidth || 0; 463 const materialStyleWidth = slaveData[saveIndex].materialWidth || 0;
  464 +
  465 +
442 slaveData[saveIndex] = { 466 slaveData[saveIndex] = {
443 ...slaveData[saveIndex], 467 ...slaveData[saveIndex],
444 sMachineStyle: materialStyleLength + "*" + materialStyleWidth, 468 sMachineStyle: materialStyleLength + "*" + materialStyleWidth,
@@ -511,13 +535,13 @@ const QuickQuoteEvent = props =&gt; { @@ -511,13 +535,13 @@ const QuickQuoteEvent = props =&gt; {
511 return !sParamDefault 535 return !sParamDefault
512 ? "" 536 ? ""
513 : { 537 : {
514 - sId: commonUtils.createSid(),  
515 - value: sParamDefault,  
516 - sParam: sParam,  
517 - [`sParam${iOrder}`]: sParamDefault,  
518 - ...(sFieldName ? { [sFieldName]: sParamDefault } : {}),  
519 - sParamKey: sFieldName || `sParam${iOrder}`,  
520 - }; 538 + sId: commonUtils.createSid(),
  539 + value: sParamDefault,
  540 + sParam: sParam,
  541 + [`sParam${iOrder}`]: sParamDefault,
  542 + ...(sFieldName ? { [sFieldName]: sParamDefault } : {}),
  543 + sParamKey: sFieldName || `sParam${iOrder}`,
  544 + };
521 }) 545 })
522 .filter(item => item !== ""); 546 .filter(item => item !== "");
523 dropDownDataSelected.sBackendParams = sBackendParams; 547 dropDownDataSelected.sBackendParams = sBackendParams;
@@ -1503,8 +1527,6 @@ const TreeComponent = props =&gt; { @@ -1503,8 +1527,6 @@ const TreeComponent = props =&gt; {
1503 masterData: { ...props.masterData, sFormId: "101251240115016076506222050" }, 1527 masterData: { ...props.masterData, sFormId: "101251240115016076506222050" },
1504 }); 1528 });
1505 } 1529 }
1506 - console.log(selectedNode, "selectedNode");  
1507 -  
1508 getDropDownData(props); 1530 getDropDownData(props);
1509 }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]); 1531 }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]);
1510 const { slaveData } = props.state; 1532 const { slaveData } = props.state;
@@ -1539,10 +1561,10 @@ const TreeComponent = props =&gt; { @@ -1539,10 +1561,10 @@ const TreeComponent = props =&gt; {
1539 1561
1540 // 内容组件 1562 // 内容组件
1541 const ContentComponent = props => { 1563 const ContentComponent = props => {
1542 - const { selectedNode = {}, extraParts = {} } = props.state; 1564 + const { selectedNode = {}, extraParts = {}, slaveData } = props.state;
1543 const manyqtysInfo = props.getI18nName("manyqtysInfo", "多数量报价"); 1565 const manyqtysInfo = props.getI18nName("manyqtysInfo", "多数量报价");
1544 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品"); 1566 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品");
1545 - const { showName ,sAllPartsNameDefault} = selectedNode; 1567 + const { showName, sAllPartsNameDefault } = selectedNode;
1546 const extraPartsList = extraParts[showName] || []; 1568 const extraPartsList = extraParts[showName] || [];
1547 let { sAllPartsName = "" } = selectedNode; 1569 let { sAllPartsName = "" } = selectedNode;
1548 let bEmpty = false; 1570 let bEmpty = false;
@@ -1585,8 +1607,7 @@ const ContentComponent = props =&gt; { @@ -1585,8 +1607,7 @@ const ContentComponent = props =&gt; {
1585 ...itemBox, 1607 ...itemBox,
1586 iOrder: indexBox + 1, 1608 iOrder: indexBox + 1,
1587 })); 1609 }));
1588 - if (box) {  
1589 - // Check if 'box' exists before using it 1610 + if (box) { // Check if 'box' exists before using it
1590 props.onDataChange("slaveUp" + sPartName, "sName", { sName: box.sName }, box.sId, boxData); 1611 props.onDataChange("slaveUp" + sPartName, "sName", { sName: box.sName }, box.sId, boxData);
1591 } 1612 }
1592 }); 1613 });
@@ -1594,10 +1615,13 @@ const ContentComponent = props =&gt; { @@ -1594,10 +1615,13 @@ const ContentComponent = props =&gt; {
1594 }); 1615 });
1595 } 1616 }
1596 }; 1617 };
1597 - getSqlDropDownData({ sId: "17428091410008594700322758474000", sSqlCondition: { sProductClassifyId: selectedNode.sId } }); 1618 + getSqlDropDownData(
  1619 + { sId: '17428091410008594700322758474000', sSqlCondition: { sProductClassifyId: selectedNode.sId } }
  1620 + );
1598 } 1621 }
1599 } 1622 }
1600 }, [sAllPartsNameDefaultRef.current, props.state.slaveData]); 1623 }, [sAllPartsNameDefaultRef.current, props.state.slaveData]);
  1624 +
1601 const boxModelList = sAllPartsName.split(","); 1625 const boxModelList = sAllPartsName.split(",");
1602 const [activeKey, setActiveKey] = useState(0); 1626 const [activeKey, setActiveKey] = useState(0);
1603 1627
@@ -1648,7 +1672,7 @@ const ContentComponent = props =&gt; { @@ -1648,7 +1672,7 @@ const ContentComponent = props =&gt; {
1648 })); 1672 }));
1649 setActiveKey(boxModelList.length - 1 + extraPartsList.length); 1673 setActiveKey(boxModelList.length - 1 + extraPartsList.length);
1650 }, 1674 },
1651 - onCancel() {}, 1675 + onCancel() { },
1652 }); 1676 });
1653 } else { 1677 } else {
1654 extraPartsList.splice(targetKey - boxModelList.length, 1); 1678 extraPartsList.splice(targetKey - boxModelList.length, 1);
@@ -1813,7 +1837,7 @@ const BoxComponent = props =&gt; { @@ -1813,7 +1837,7 @@ const BoxComponent = props =&gt; {
1813 const { bBox } = selectedNode; 1837 const { bBox } = selectedNode;
1814 const [boxTypeList, setBoxTypeList] = useState([]); 1838 const [boxTypeList, setBoxTypeList] = useState([]);
1815 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值 1839 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值
1816 - const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; 1840 + let slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
1817 const { sBillNo } = slaveRowData; 1841 const { sBillNo } = slaveRowData;
1818 useEffect(() => { 1842 useEffect(() => {
1819 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { 1843 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
@@ -1840,15 +1864,44 @@ const BoxComponent = props =&gt; { @@ -1840,15 +1864,44 @@ const BoxComponent = props =&gt; {
1840 ...slaveConfig.gdsconfigformslave.filter(item => item.iTag === 10).filter(item => (bBox ? true : item.sName !== "sName")), 1864 ...slaveConfig.gdsconfigformslave.filter(item => item.iTag === 10).filter(item => (bBox ? true : item.sName !== "sName")),
1841 ...showUpAbleConfigsExtra, 1865 ...showUpAbleConfigsExtra,
1842 ]; 1866 ];
  1867 + showUpAbleConfigsExtra.forEach(item => {
  1868 + if (item.sTypes && item.sTypes.includes('09')) {
  1869 + if (item.sName === 'dZTBW' || item.sName === 'dYTBW') {
  1870 + slaveRowData[item.sName] = (item.iSLength ? Number(item.iSLength) : 0) + (item.iCLength ? Number(item.iCLength) : 0)
  1871 + item.sDefault = (item.iSLength ? Number(item.iSLength) : 0) + (item.iCLength ? Number(item.iCLength) : 0)
  1872 + } else {
  1873 + slaveRowData[item.sName] = (item.iSWidth ? Number(item.iSWidth) : 0) + (item.iCWidth ? Number(item.iCWidth) : 0)
  1874 + item.sDefault = (item.iSWidth ? Number(item.iSWidth) : 0) + (item.iCWidth ? Number(item.iCWidth) : 0)
  1875 + }
  1876 + }
  1877 + })
  1878 + const upAbleConfigsList = upAbleConfigs
  1879 + .map(item =>
  1880 + item.sTypes?.includes('09')
  1881 + ? ['iSLength', 'iSWidth', 'iCLength', 'iCWidth'].map((key, idx) => ({
  1882 + ...item,
  1883 + sName: item.sName + key,
  1884 + sDefault: item[key],
  1885 + showName: item.showName + ['1长', '1宽', '2长', '2宽'][idx],
  1886 + sId:item.sId + idx
  1887 + }))
  1888 + : [item] // 非 '09' 也要包一层数组,保持结构一致
  1889 + )
  1890 + .flat(); // 把二维数组拍平成一维
  1891 + const type = upAbleConfigs.find(item =>
  1892 + item?.sTypes && item.sTypes.includes('09')
  1893 + );
1843 const upViewProps = { 1894 const upViewProps = {
1844 ...props, 1895 ...props,
1845 - viewConfigs: upAbleConfigs,  
1846 - tableConfig: { ...slaveConfig, gdsconfigformslave: upAbleConfigs }, 1896 + viewConfigs: upAbleConfigsList,
  1897 + tableConfig: { ...slaveConfig, gdsconfigformslave: upAbleConfigsList },
1847 iColValueView: 24, 1898 iColValueView: 24,
1848 viewRow: slaveRowData, 1899 viewRow: slaveRowData,
1849 tableName: `slaveUp${boxModel}`, 1900 tableName: `slaveUp${boxModel}`,
1850 }; 1901 };
1851 1902
  1903 + console.log(upAbleConfigs,upAbleConfigsList,'upAbleConfigs');
  1904 +
1852 const getUpViewPropsByITag = iTag => { 1905 const getUpViewPropsByITag = iTag => {
1853 const config = slaveConfig.gdsconfigformslave 1906 const config = slaveConfig.gdsconfigformslave
1854 .filter(item => !["sPrint", "sColor", "iPrintModePo"].includes(item.sName)) 1907 .filter(item => !["sPrint", "sColor", "iPrintModePo"].includes(item.sName))
@@ -2350,7 +2403,6 @@ const BoxComponent = props =&gt; { @@ -2350,7 +2403,6 @@ const BoxComponent = props =&gt; {
2350 { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, 2403 { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null },
2351 { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null }, 2404 { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null },
2352 ]; 2405 ];
2353 - const boxTypes = slaveRowData.sTypes;  
2354 const titleList1 = [ 2406 const titleList1 = [
2355 { name: "上方盒舌", value: "dSFHS" }, 2407 { name: "上方盒舌", value: "dSFHS" },
2356 { name: "盒底组件", value: "dHDC" }, 2408 { name: "盒底组件", value: "dHDC" },
@@ -2362,22 +2414,6 @@ const BoxComponent = props =&gt; { @@ -2362,22 +2414,6 @@ const BoxComponent = props =&gt; {
2362 { name: "右贴边位", value: "dYTBW" }, 2414 { name: "右贴边位", value: "dYTBW" },
2363 { name: "右(下)插位组件", value: "dYXCW" }, 2415 { name: "右(下)插位组件", value: "dYXCW" },
2364 ]; 2416 ];
2365 - const doubleTitlieList1 = [  
2366 - { name: "左上插位组件", value: "dZSCW" },  
2367 - { name: "上插位组件", value: "dSCW" },  
2368 - { name: "右上插位组件", value: "dYSCW" },  
2369 - { name: "左偏移", value: "dZPY" },  
2370 - { name: "左插位组件", value: "dZCW" },  
2371 - { name: "左下插位组件", value: "dZXCW" },  
2372 - { name: "右偏移", value: "dYPY" },  
2373 - { name: "右插位组件", value: "dYCW" },  
2374 - { name: "右下插位组件", value: "dYXCW" },  
2375 - { name: "首盒长", value: "dSHC" },  
2376 - { name: "首盒宽", value: "dSHK" },  
2377 - { name: "次盒长", value: "dCHC" },  
2378 - { name: "次盒宽", value: "dCHK" },  
2379 - ];  
2380 - const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1;  
2381 const evaluateFormula = (formula, variables) => { 2417 const evaluateFormula = (formula, variables) => {
2382 if (!formula) return 0; // 如果公式为空,返回0 2418 if (!formula) return 0; // 如果公式为空,返回0
2383 try { 2419 try {
@@ -2409,18 +2445,31 @@ const BoxComponent = props =&gt; { @@ -2409,18 +2445,31 @@ const BoxComponent = props =&gt; {
2409 D, 2445 D,
2410 ...slaveRowData, 2446 ...slaveRowData,
2411 }; 2447 };
2412 - 2448 + slaveNewData.forEach(item => {
  2449 + item.iSLength = slaveRowData[item.sName + 'iSLength']
  2450 + item.iCLength = slaveRowData[item.sName + 'iCLength']
  2451 + item.iSWidth = slaveRowData[item.sName + 'iSWidth']
  2452 + item.iCWidth = slaveRowData[item.sName + 'iCWidth']
  2453 + })
2413 slaveNewData.forEach(x => { 2454 slaveNewData.forEach(x => {
2414 let key = 0; 2455 let key = 0;
2415 if (x.sAssignFormula) { 2456 if (x.sAssignFormula) {
2416 key = evaluateFormula(x.sAssignFormula, variables); 2457 key = evaluateFormula(x.sAssignFormula, variables);
2417 slaveRowData[x.sName] = key; 2458 slaveRowData[x.sName] = key;
2418 } else { 2459 } else {
2419 - key = slaveRowData[x.sName]; 2460 + if (x.sTypes && x.sTypes.includes('09')) {
  2461 + if (x.sName === 'dZTBW' || x.sName === 'dYTBW') {
  2462 + key = (x.iSLength ? Number(x.iSLength) : 0) + (x.iCLength ? Number(x.iCLength) : 0)
  2463 + } else {
  2464 + key = (x.iSWidth ? Number(x.iSWidth) : 0) + (x.iCWidth ? Number(x.iCWidth) : 0)
  2465 + }
  2466 + } else {
  2467 + key = slaveRowData[x.sName];
  2468 + }
2420 } 2469 }
2421 boxList.push({ 2470 boxList.push({
2422 value: key, 2471 value: key,
2423 - sName: srcList.find(item => item.value === x.sName)?.name || "", 2472 + sName: titleList1.find(item => item.value === x.sName)?.name || "",
2424 isEditable: true, 2473 isEditable: true,
2425 isSelect: false, 2474 isSelect: false,
2426 selectValue: null, 2475 selectValue: null,
@@ -2429,6 +2478,18 @@ const BoxComponent = props =&gt; { @@ -2429,6 +2478,18 @@ const BoxComponent = props =&gt; {
2429 type: x.sTypes || null, 2478 type: x.sTypes || null,
2430 show: true, 2479 show: true,
2431 showName: x.showName, // 参数名称 2480 showName: x.showName, // 参数名称
  2481 + sLength: x.iSLength,
  2482 + sWidth: x.iSWidth,
  2483 + sType: x.iSType,
  2484 + sTypeName: Number(x.iSType) === 0 ? "矩形" : "梯形",
  2485 + sOffset: x.sSOffset,
  2486 + sQuantity: x.iSQuantity,
  2487 + cLength: x.iCLength,
  2488 + cWidth: x.iCWidth,
  2489 + cType: x.iCType,
  2490 + cTypeName: Number(x.iCType) === 0 ? "矩形" : "梯形",
  2491 + cOffset: x.sCOffset,
  2492 + cQuantity: x.iCQuantity,
2432 }); 2493 });
2433 }); 2494 });
2434 tables.forEach(x => { 2495 tables.forEach(x => {
@@ -2446,6 +2507,7 @@ const BoxComponent = props =&gt; { @@ -2446,6 +2507,7 @@ const BoxComponent = props =&gt; {
2446 }); 2507 });
2447 }); 2508 });
2448 } 2509 }
  2510 +
2449 const svgProps = { 2511 const svgProps = {
2450 ...props, 2512 ...props,
2451 boxList, 2513 boxList,
@@ -2453,6 +2515,7 @@ const BoxComponent = props =&gt; { @@ -2453,6 +2515,7 @@ const BoxComponent = props =&gt; {
2453 dSvgBoxHeight: 200, 2515 dSvgBoxHeight: 200,
2454 showNew: 1, 2516 showNew: 1,
2455 }; 2517 };
  2518 + console.log("🚀 ~ svgProps:", svgProps)
2456 2519
2457 // upViewProps.viewRow = 2520 // upViewProps.viewRow =
2458 2521
@@ -2463,20 +2526,19 @@ const BoxComponent = props =&gt; { @@ -2463,20 +2526,19 @@ const BoxComponent = props =&gt; {
2463 const ImpositionInformation = commonFunc.showLocalMessage(props, "ImpositionInformation", "拼版信息"); 2526 const ImpositionInformation = commonFunc.showLocalMessage(props, "ImpositionInformation", "拼版信息");
2464 2527
2465 const noImage = commonFunc.showLocalMessage(props, "ImpositionInformation", "暂无图片"); 2528 const noImage = commonFunc.showLocalMessage(props, "ImpositionInformation", "暂无图片");
2466 -  
2467 - const removeExtension = filename => {  
2468 - if (!filename) return;  
2469 - const lastDotIndex = filename.lastIndexOf("."); 2529 + const removeExtension = (filename) => {
  2530 + if (!filename) return
  2531 + const lastDotIndex = filename.lastIndexOf('.');
2470 if (lastDotIndex === -1) { 2532 if (lastDotIndex === -1) {
2471 // 如果字符串中没有点,则返回原字符串 2533 // 如果字符串中没有点,则返回原字符串
2472 return filename; 2534 return filename;
2473 } 2535 }
2474 return filename.substring(0, lastDotIndex); 2536 return filename.substring(0, lastDotIndex);
2475 - };  
2476 - const getImageUrl = sName => { 2537 + }
  2538 + const getImageUrl = (sName) => {
2477 const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`; 2539 const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`;
2478 - return imageUrlNew;  
2479 - }; 2540 + return imageUrlNew
  2541 + }
2480 let imagesData = [ 2542 let imagesData = [
2481 { src: getImageUrl(removeExtension(slaveRowData.sPackDetailPathUpLoad)), alt: "展开图" }, 2543 { src: getImageUrl(removeExtension(slaveRowData.sPackDetailPathUpLoad)), alt: "展开图" },
2482 { src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" }, 2544 { src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" },
@@ -2561,7 +2623,9 @@ const BoxComponent = props =&gt; { @@ -2561,7 +2623,9 @@ const BoxComponent = props =&gt; {
2561 <div className={styles.boxPart1}> 2623 <div className={styles.boxPart1}>
2562 <div className={styles.boxPart1Left}> 2624 <div className={styles.boxPart1Left}>
2563 <div className={styles.viewTable1}> 2625 <div className={styles.viewTable1}>
2564 - {!(selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") ? <CommonViewTable {...upViewProps} /> : ""} 2626 + {!(selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") ? <div>
  2627 + <CommonViewTable {...upViewProps} />
  2628 + </div> : ""}
2565 </div> 2629 </div>
2566 {cailiaoyinshuaDiv} 2630 {cailiaoyinshuaDiv}
2567 </div> 2631 </div>
@@ -3304,26 +3368,10 @@ const BoxModelSelectedModal = props =&gt; { @@ -3304,26 +3368,10 @@ const BoxModelSelectedModal = props =&gt; {
3304 { name: "右贴边位", value: "dYTBW" }, 3368 { name: "右贴边位", value: "dYTBW" },
3305 { name: "右(下)插位组件", value: "dYXCW" }, 3369 { name: "右(下)插位组件", value: "dYXCW" },
3306 ]; 3370 ];
3307 - const doubleTitlieList1 = [  
3308 - { name: "左上插位组件", value: "dZSCW" },  
3309 - { name: "上插位组件", value: "dSCW" },  
3310 - { name: "右上插位组件", value: "dYSCW" },  
3311 - { name: "左偏移", value: "dZPY" },  
3312 - { name: "左插位组件", value: "dZCW" },  
3313 - { name: "左下插位组件", value: "dZXCW" },  
3314 - { name: "右偏移", value: "dYPY" },  
3315 - { name: "右插位组件", value: "dYCW" },  
3316 - { name: "右下插位组件", value: "dYXCW" },  
3317 - { name: "首盒长", value: "dSHC" },  
3318 - { name: "首盒宽", value: "dSHK" },  
3319 - { name: "次盒长", value: "dCHC" },  
3320 - { name: "次盒宽", value: "dCHK" },  
3321 - ];  
3322 - const srcList = Number(sTypes) === 8 ? doubleTitlieList1 : titleList1;  
3323 slaveData.forEach(x => { 3371 slaveData.forEach(x => {
3324 boxList.push({ 3372 boxList.push({
3325 value: x.iValue || x.sDefault, 3373 value: x.iValue || x.sDefault,
3326 - sName: srcList.find(item => item.value === x.sCode || item.value === x.sName)?.name || "", 3374 + sName: titleList1.find(item => item.value === x.sCode || item.value === x.sName)?.name || "",
3327 isEditable: true, 3375 isEditable: true,
3328 isSelect: false, 3376 isSelect: false,
3329 selectValue: null, 3377 selectValue: null,
@@ -3355,7 +3403,6 @@ const BoxModelSelectedModal = props =&gt; { @@ -3355,7 +3403,6 @@ const BoxModelSelectedModal = props =&gt; {
3355 dSvgBoxHeight: 100, 3403 dSvgBoxHeight: 100,
3356 showNew: 1, 3404 showNew: 1,
3357 }; 3405 };
3358 -  
3359 return svgProps; 3406 return svgProps;
3360 }; 3407 };
3361 const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected)); 3408 const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected));
@@ -3381,16 +3428,17 @@ const BoxModelSelectedModal = props =&gt; { @@ -3381,16 +3428,17 @@ const BoxModelSelectedModal = props =&gt; {
3381 .forEach(column => { 3428 .forEach(column => {
3382 // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片"); 3429 // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? <img src={value} alt="" width={270} height={270} /> : '') : <img src={value} alt="" width={270} height={270} />) : "暂无图片");
3383 column.render = (value, record, index) => 3430 column.render = (value, record, index) =>
  3431 +
3384 column.dataIndex === "sPackDetailPathUpLoad" ? ( 3432 column.dataIndex === "sPackDetailPathUpLoad" ? (
3385 !value ? ( 3433 !value ? (
3386 <div style={{ width: "auto", height: 100 }}> 3434 <div style={{ width: "auto", height: 100 }}>
3387 <DynamicSVG {...getSvgProps(selectBoxList[index])} /> 3435 <DynamicSVG {...getSvgProps(selectBoxList[index])} />
3388 </div> 3436 </div>
3389 ) : ( 3437 ) : (
3390 - <img src={value} alt="" width={100} height={100} /> 3438 + <img src={getImageUrl(value)} alt="" width={100} height={100} />
3391 ) 3439 )
3392 ) : value ? ( 3440 ) : value ? (
3393 - <img src={value} alt="" width={100} height={100} /> 3441 + <img src={getImageUrl(value)} alt="" width={100} height={100} />
3394 ) : ( 3442 ) : (
3395 noImage 3443 noImage
3396 ); 3444 );
@@ -3416,6 +3464,10 @@ const BoxModelSelectedModal = props =&gt; { @@ -3416,6 +3464,10 @@ const BoxModelSelectedModal = props =&gt; {
3416 }); 3464 });
3417 }, 3465 },
3418 }; 3466 };
  3467 + const getImageUrl = (sName) => {
  3468 + const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`;
  3469 + return imageUrlNew
  3470 + }
3419 const BoxSelection = commonFunc.showLocalMessage(props, "Box-TypeSelection", "盒型选择"); 3471 const BoxSelection = commonFunc.showLocalMessage(props, "Box-TypeSelection", "盒型选择");
3420 const BtnClose = commonFunc.showLocalMessage(props, "BtnClose", "关闭"); 3472 const BtnClose = commonFunc.showLocalMessage(props, "BtnClose", "关闭");
3421 return ( 3473 return (
@@ -3555,11 +3607,11 @@ const BackendParamsExtraComponent = props =&gt; { @@ -3555,11 +3607,11 @@ const BackendParamsExtraComponent = props =&gt; {
3555 const dropDownDataSelected = dropDownData?.length 3607 const dropDownDataSelected = dropDownData?.length
3556 ? dropDownData.find(item => item.sId === changeValue[sFieldName]) 3608 ? dropDownData.find(item => item.sId === changeValue[sFieldName])
3557 : { 3609 : {
3558 - sId: commonUtils.createSid(),  
3559 - value: changeValue[sFieldName],  
3560 - sParam: showConfig.sParam,  
3561 - sParamKey: sFieldName,  
3562 - }; 3610 + sId: commonUtils.createSid(),
  3611 + value: changeValue[sFieldName],
  3612 + sParam: showConfig.sParam,
  3613 + sParamKey: sFieldName,
  3614 + };
3563 if (!dropDownDataSelected) return; 3615 if (!dropDownDataSelected) return;
3564 dropDownDataSelected[sFieldName] = dropDownDataSelected.value; 3616 dropDownDataSelected[sFieldName] = dropDownDataSelected.value;
3565 const { sParam } = dropDownDataSelected; 3617 const { sParam } = dropDownDataSelected;
@@ -3678,7 +3730,6 @@ const GetBestAlgorithm = props =&gt; { @@ -3678,7 +3730,6 @@ const GetBestAlgorithm = props =&gt; {
3678 { name: "盒宽", value: W, type: null }, 3730 { name: "盒宽", value: W, type: null },
3679 { name: "盒高", value: D, type: null }, 3731 { name: "盒高", value: D, type: null },
3680 ]; 3732 ];
3681 - const boxTypes = slaveRowData.sTypes;  
3682 const titleList1 = [ 3733 const titleList1 = [
3683 { name: "上方盒舌", value: "dSFHS" }, 3734 { name: "上方盒舌", value: "dSFHS" },
3684 { name: "盒底组件", value: "dHDC" }, 3735 { name: "盒底组件", value: "dHDC" },
@@ -3690,22 +3741,6 @@ const GetBestAlgorithm = props =&gt; { @@ -3690,22 +3741,6 @@ const GetBestAlgorithm = props =&gt; {
3690 { name: "右贴边位", value: "dYTBW" }, 3741 { name: "右贴边位", value: "dYTBW" },
3691 { name: "右(下)插位组件", value: "dYXCW" }, 3742 { name: "右(下)插位组件", value: "dYXCW" },
3692 ]; 3743 ];
3693 - const doubleTitlieList1 = [  
3694 - { name: "左上插位组件", value: "dZSCW" },  
3695 - { name: "上插位组件", value: "dSCW" },  
3696 - { name: "右上插位组件", value: "dYSCW" },  
3697 - { name: "左偏移", value: "dZPY" },  
3698 - { name: "左插位组件", value: "dZCW" },  
3699 - { name: "左下插位组件", value: "dZXCW" },  
3700 - { name: "右偏移", value: "dYPY" },  
3701 - { name: "右插位组件", value: "dYCW" },  
3702 - { name: "右下插位组件", value: "dYXCW" },  
3703 - { name: "首盒长", value: "dSHC" },  
3704 - { name: "首盒宽", value: "dSHK" },  
3705 - { name: "次盒长", value: "dCHC" },  
3706 - { name: "次盒宽", value: "dCHK" },  
3707 - ];  
3708 - const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1;  
3709 slaveNewData.forEach(x => { 3744 slaveNewData.forEach(x => {
3710 let key = 0; 3745 let key = 0;
3711 if (x.sAssignFormula) { 3746 if (x.sAssignFormula) {
@@ -3715,7 +3750,7 @@ const GetBestAlgorithm = props =&gt; { @@ -3715,7 +3750,7 @@ const GetBestAlgorithm = props =&gt; {
3715 } 3750 }
3716 boxList.push({ 3751 boxList.push({
3717 value: key, 3752 value: key,
3718 - sName: srcList.find(item => item.value === x.sName)?.name || "", 3753 + sName: titleList1.find(item => item.value === x.sName)?.name || "",
3719 isEditable: true, 3754 isEditable: true,
3720 isSelect: false, 3755 isSelect: false,
3721 selectValue: null, 3756 selectValue: null,
@@ -3723,7 +3758,7 @@ const GetBestAlgorithm = props =&gt; { @@ -3723,7 +3758,7 @@ const GetBestAlgorithm = props =&gt; {
3723 selectImage: null, 3758 selectImage: null,
3724 type: x.sTypes || null, 3759 type: x.sTypes || null,
3725 show: true, 3760 show: true,
3726 - sCode: srcList.find(item => item.value === x.sName)?.value || "", 3761 + sCode: titleList1.find(item => item.value === x.sName)?.value || "",
3727 showName: x.showName, // 参数名称 3762 showName: x.showName, // 参数名称
3728 }); 3763 });
3729 }); 3764 });
@@ -3910,16 +3945,14 @@ const GetBestAlgorithm = props =&gt; { @@ -3910,16 +3945,14 @@ const GetBestAlgorithm = props =&gt; {
3910 justifyContent: "center", 3945 justifyContent: "center",
3911 alignItems: "center", 3946 alignItems: "center",
3912 position: "absolute", 3947 position: "absolute",
3913 - left: `${  
3914 - isVertical  
3915 - ? dSLengthOffset  
3916 - : iSAngle === 90 || iSAngle === 270 3948 + left: `${isVertical
  3949 + ? dSLengthOffset
  3950 + : iSAngle === 90 || iSAngle === 270
3917 ? innerHeight + dFLengthOffset + dSLengthOffset + dYBJJ 3951 ? innerHeight + dFLengthOffset + dSLengthOffset + dYBJJ
3918 : innerWidth + dFLengthOffset + dSLengthOffset + dYBJJ 3952 : innerWidth + dFLengthOffset + dSLengthOffset + dYBJJ
3919 - }px`,  
3920 - top: `${  
3921 - isVertical ? jInnerHeight + dFWidthOffset + dSWidthOffset + dXBJJ : iSAngle === 90 || iSAngle === 270 ? dSWidthOffset : dSWidthOffset  
3922 - }px`, 3953 + }px`,
  3954 + top: `${isVertical ? jInnerHeight + dFWidthOffset + dSWidthOffset + dXBJJ : iSAngle === 90 || iSAngle === 270 ? dSWidthOffset : dSWidthOffset
  3955 + }px`,
3923 }} 3956 }}
3924 ></div> 3957 ></div>
3925 </div> 3958 </div>
@@ -4068,8 +4101,8 @@ const GetBestAlgorithm = props =&gt; { @@ -4068,8 +4101,8 @@ const GetBestAlgorithm = props =&gt; {
4068 ? cols + cols * (rows * 2) 4101 ? cols + cols * (rows * 2)
4069 : cols * (rows * 2) 4102 : cols * (rows * 2)
4070 : remaining 4103 : remaining
4071 - ? rows + rows * (cols * 2)  
4072 - : rows * (cols * 2); 4104 + ? rows + rows * (cols * 2)
  4105 + : rows * (cols * 2);
4073 4106
4074 let dHorizontalType = isVertical ? cols : remaining ? cols * 2 + 1 : cols * 2; 4107 let dHorizontalType = isVertical ? cols : remaining ? cols * 2 + 1 : cols * 2;
4075 let dPortraitType = isVertical ? (remaining ? rows * 2 + 1 : rows * 2) : remaining ? rows : rows; 4108 let dPortraitType = isVertical ? (remaining ? rows * 2 + 1 : rows * 2) : remaining ? rows : rows;