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 107 return svg;
108 108 };
109 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 111 const svg = document.createElementNS("http://www.w3.org/2000/svg", "path");
112 112 svg.setAttribute("d", d);
113 113 svg.setAttribute("fill", "transparent");
... ... @@ -126,6 +126,16 @@ export const createPathElementTrapezoids = (x, y, width, height) => {
126 126 // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果
127 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 139 export const createPathElementTrapezoidRight = (x, y, width, height) => {
130 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 141 const svg = document.createElementNS("http://www.w3.org/2000/svg", "path");
... ... @@ -136,6 +146,7 @@ export const createPathElementTrapezoidRight = (x, y, width, height) => {
136 146 // svg.setAttribute("stroke-dasharray", "4"); // 添加虚线效果
137 147 return svg;
138 148 };
  149 +
139 150 //
140 151 // 左边斜线贴边
141 152 export const createTrapezoid = (height, offsetX, offsetY, size) => {
... ...
src/components/Common/BoxDesignCompontent/index.js
1 1 /* eslint-disable */
2 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 4 import { CompressOutlined, ExpandOutlined } from "@ant-design/icons";
5 5 import * as commonUtils from "@/utils/utils";
6 6 import * as commonFunc from "@/components/Common/commonFunc";
... ... @@ -65,7 +65,6 @@ const BoxDesignEvent = props => {
65 65 }
66 66 return 0; // 其他元素保持原顺序
67 67 });
68   - console.log(data.data.dataset.rows, "data.data.dataset.rows");
69 68  
70 69 setOptions(data.data.dataset.rows);
71 70 }
... ... @@ -108,8 +107,6 @@ const BoxDesignCompontent = baseProps => {
108 107 const [boxKey, setBoxKey] = useState(new Date().getTime());
109 108 const [doubleLayerList, setDoubleLayerList] = useState([]);
110 109 if (!boxVisible) return "";
111   - console.log(baseProps, "baseProps");
112   -
113 110 // 1️⃣ 只负责 tableColum
114 111 useEffect(() => {
115 112 if (!tableData?.length) return;
... ... @@ -284,18 +281,18 @@ const BoxDesignCompontent = baseProps => {
284 281 sName: titleList1[i].name,
285 282 sAssignFormula: item.sAssignFormula,
286 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 531 }
535 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 553 const renderOptionWithImage = option => {
545 554 return (
... ... @@ -581,6 +590,16 @@ const BoxDesignCompontent = baseProps => {
581 590 // 存储子表数据
582 591 const boxTypes = boxList.find(item => item.sName === "盒身")?.type;
583 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 603 boxList.forEach((item, index) => {
585 604 const i = findList.findIndex(i => i.name === item.sName);
586 605 const slave = slaveData.find(z => z.sCode === findList[i]?.value);
... ... @@ -599,18 +618,18 @@ const BoxDesignCompontent = baseProps => {
599 618 bVisible: item.value ? true : false,
600 619 sParentId: masterData.sId,
601 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 634 // if (item.value !== "") {
616 635 newSlaveData.push(data);
... ... @@ -1036,7 +1055,7 @@ const BoxDesignCompontent = baseProps => {
1036 1055 <Select
1037 1056 optionLabelProp="label"
1038 1057 className="mySelects"
1039   - style={{ width: 180 }}
  1058 + style={{ width: 180, height: 40 }}
1040 1059 defaultValue={options.length ? options[0].value : ""}
1041 1060 onSelect={(value, option) => handleSelect(value, option, index, 0)}
1042 1061 onDropdownVisibleChange={async open => {
... ... @@ -1076,7 +1095,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1076 1095 <Select
1077 1096 optionLabelProp="label"
1078 1097 className="mySelectsDouble"
1079   - style={{ width: 180, color: "#000" }}
  1098 + style={{ width: 180, color: "#000", height: 40 }}
1080 1099 defaultValue={options.length ? options[0].value : ""}
1081 1100 value={topItem?.sTypeName || ""}
1082 1101 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 0)}
... ... @@ -1134,7 +1153,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1134 1153 <Select
1135 1154 optionLabelProp="label"
1136 1155 className="mySelectsDouble"
1137   - style={{ width: 180, color: "#000" }}
  1156 + style={{ width: 180, color: "#000", height: 40 }}
1138 1157 defaultValue={options.length ? options[0].value : ""}
1139 1158 value={topItem?.cTypeName || ""}
1140 1159 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 1)}
... ... @@ -1206,7 +1225,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1206 1225 <Select
1207 1226 optionLabelProp="label"
1208 1227 className="mySelects"
1209   - style={{ width: 180 }}
  1228 + style={{ width: 180, height: 40 }}
1210 1229 defaultValue={options.length ? options[0].value : ""}
1211 1230 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1212 1231 onDropdownVisibleChange={async open => {
... ... @@ -1247,7 +1266,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1247 1266 <Select
1248 1267 optionLabelProp="label"
1249 1268 className="mySelects"
1250   - style={{ width: 180 }}
  1269 + style={{ width: 180, height: 40 }}
1251 1270 defaultValue={options.length ? options[0].value : ""}
1252 1271 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1253 1272 onDropdownVisibleChange={async open => {
... ... @@ -1305,7 +1324,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1305 1324 <Select
1306 1325 optionLabelProp="label"
1307 1326 className="mySelectsDouble"
1308   - style={{ width: 180, color: "#000" }}
  1327 + style={{ width: 180, color: "#000", height: 40 }}
1309 1328 defaultValue={options.length ? options[0].value : ""}
1310 1329 value={item?.sTypeName || ""}
1311 1330 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
... ... @@ -1363,7 +1382,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1363 1382 <Select
1364 1383 optionLabelProp="label"
1365 1384 className="mySelectsDouble"
1366   - style={{ width: 180, color: "#000" }}
  1385 + style={{ width: 180, color: "#000", height: 40 }}
1367 1386 defaultValue={options.length ? options[0].value : ""}
1368 1387 value={item?.cTypeName || ""}
1369 1388 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
... ... @@ -1427,7 +1446,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1427 1446 <Select
1428 1447 optionLabelProp="label"
1429 1448 className="mySelects"
1430   - style={{ width: 180 }}
  1449 + style={{ width: 180, height: 40 }}
1431 1450 defaultValue={options.length ? options[0].value : ""}
1432 1451 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1433 1452 onDropdownVisibleChange={async open => {
... ... @@ -1488,7 +1507,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1488 1507 <Select
1489 1508 optionLabelProp="label"
1490 1509 className="mySelects"
1491   - style={{ width: 180 }}
  1510 + style={{ width: 180, height: 40 }}
1492 1511 defaultValue={options.length ? options[0].value : ""}
1493 1512 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1494 1513 onDropdownVisibleChange={async open => {
... ... @@ -1499,164 +1518,6 @@ const BoxDesignCompontent = baseProps =&gt; {
1499 1518 >
1500 1519 {!loading ? options.map(option => renderOptionWithImage(option)) : ""}
1501 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 1521 <div className={styles.boxInput}>
1661 1522 {item?.selectImage ? (
1662 1523 <img
... ... @@ -1704,7 +1565,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1704 1565 <Select
1705 1566 optionLabelProp="label"
1706 1567 className="mySelectsDouble"
1707   - style={{ width: 180, color: "#000" }}
  1568 + style={{ width: 180, color: "#000", height: 40 }}
1708 1569 defaultValue={options.length ? options[0].value : ""}
1709 1570 value={item?.sTypeName || ""}
1710 1571 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
... ... @@ -1762,7 +1623,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1762 1623 <Select
1763 1624 optionLabelProp="label"
1764 1625 className="mySelectsDouble"
1765   - style={{ width: 180, color: "#000" }}
  1626 + style={{ width: 180, color: "#000", height: 40 }}
1766 1627 defaultValue={options.length ? options[0].value : ""}
1767 1628 value={item?.cTypeName || ""}
1768 1629 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
... ... @@ -1826,7 +1687,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1826 1687 <Select
1827 1688 optionLabelProp="label"
1828 1689 className="mySelects"
1829   - style={{ width: 180 }}
  1690 + style={{ width: 180, height: 40 }}
1830 1691 defaultValue={options.length ? options[0].value : ""}
1831 1692 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1832 1693 onDropdownVisibleChange={async open => {
... ... @@ -1929,7 +1790,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1929 1790 <Select
1930 1791 optionLabelProp="label"
1931 1792 className="mySelects"
1932   - style={{ width: "80%" }}
  1793 + style={{ width: "80%", height: 40 }}
1933 1794 defaultValue={boxList[uniqueIndex]?.value}
1934 1795 onSelect={(value, option) => handleSelect(value, option, uniqueIndex, 1)}
1935 1796 onDropdownVisibleChange={async open => {
... ...
src/components/Common/BoxDesignCompontent/svg.js
... ... @@ -52,6 +52,7 @@ import {
52 52 createPathElementTrapezoid,
53 53 createPathElementTrapezoids,
54 54 createPathElementTrapezoidRight,
  55 + createPathElementTrapezoidBottom,
55 56 } from "../BoxDesign/createAirplaneBox";
56 57 const SvgBox = props => {
57 58 const svgContainerRef = useRef(null);
... ... @@ -140,13 +141,17 @@ const SvgBox = props =&gt; {
140 141 }
141 142  
142 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 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 151 } else if (Number(svgType) === 2) {
147   - viewBoxWidth = boxLength * 2 + boxWidth + dYTBW + dZTBW;
  152 + viewBoxWidth = boxLength * 2 + boxWidth + dYTBW + dZTBW + doubleTotal
148 153 } else if (Number(svgType) === 3) {
149   - viewBoxWidth = boxLength + boxWidth * 2 + dYTBW + dZTBW;
  154 + viewBoxWidth = boxLength + boxWidth * 2 + dYTBW + dZTBW + doubleTotal
150 155 } else if (Number(svgType) === 4) {
151 156 // 天地盒
152 157  
... ... @@ -213,7 +218,7 @@ const SvgBox = props =&gt; {
213 218 viewBoxWidth = Number(boxLength) + leftValue + rightValue;
214 219 viewBoxHeight = Number(boxWidth) + topValue + bottomValue;
215 220 } else if (Number(svgType) === 5) {
216   - viewBoxWidth = (boxHeight + boxWidth) * 2 + dYTBW + dZTBW;
  221 + viewBoxWidth = (boxHeight + boxWidth) * 2 + dYTBW + dZTBW +doubleTotal
217 222 viewBoxHeight = boxLength + max;
218 223 } else if (Number(svgType) === 6) {
219 224 viewBoxWidth = boxWidth + 2;
... ... @@ -387,14 +392,16 @@ const SvgBox = props =&gt; {
387 392 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
388 393 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
389 394 } else if (Number(svgType) === 4) {
390   - xSvg = 100 * scale;
  395 + xSvg = (scaledDeep * 2 + scaledWidth) / 2;
391 396 } else {
392 397 xSvg = zbtb?.value;
393 398 }
  399 + if (zbtb?.type === "8009") {
  400 + xSvg = doubleTotal * scale;
  401 + }
394 402 svg.setAttribute(
395 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 407 svg.setAttribute("width", `${dSvgBoxWidth ? dSvgBoxWidth : 500}px`);
... ... @@ -454,12 +461,13 @@ const SvgBox = props =&gt; {
454 461 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
455 462 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
456 463 } else if (Number(svgType) === 4) {
457   - xSvg = 100;
  464 + xSvg = (scaledDeep * 2 + scaledWidth) / 2;
458 465 } else {
459 466 xSvg = zbtb?.value;
460 467 }
  468 +
461 469 if (!dSvgBoxWidth) {
462   - xSvg = viewBoxWidth / 2 + 100 * scale;
  470 + xSvg = (viewBoxWidth / 2 + 200) * scale;
463 471 }
464 472 svg.setAttribute(
465 473 "viewBox",
... ... @@ -471,8 +479,6 @@ const SvgBox = props =&gt; {
471 479 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`;
472 480 }
473 481 } else if (props.showNew === 1) {
474   - console.log("props.showNew === 1");
475   -
476 482 let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
477 483 let leftSize = 0;
478 484 let topSize = 0;
... ... @@ -544,11 +550,12 @@ const SvgBox = props =&gt; {
544 550 ySvg = topOffect(boxList, headLength, headWidth);
545 551 } else {
546 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 559 svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth + 2} ${viewBoxHeight + 2}`);
553 560 svg.setAttribute("width", `${viewBoxWidth}px`);
554 561 svg.setAttribute("height", `${viewBoxHeight}px`);
... ... @@ -828,7 +835,7 @@ const SvgBox = props =&gt; {
828 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 840 let rectangles = [];
834 841  
... ... @@ -875,7 +882,7 @@ const SvgBox = props =&gt; {
875 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 887 let rectangles = [];
881 888  
... ... @@ -1684,7 +1691,7 @@ const SvgBox = props =&gt; {
1684 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 1696 let rectangles = [];
1690 1697  
... ... @@ -2134,7 +2141,7 @@ const SvgBox = props =&gt; {
2134 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 2146 let rectangles = [];
2140 2147  
... ... @@ -2233,7 +2240,7 @@ const SvgBox = props =&gt; {
2233 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 2245 let rectangles = [];
2239 2246  
... ... @@ -2519,7 +2526,7 @@ const SvgBox = props =&gt; {
2519 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 2531 let rectangles = [];
2525 2532  
... ... @@ -2566,7 +2573,7 @@ const SvgBox = props =&gt; {
2566 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 2578 let rectangles = [];
2572 2579  
... ... @@ -2833,7 +2840,7 @@ const SvgBox = props =&gt; {
2833 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 2845 let rectangles = [];
2839 2846  
... ... @@ -3201,7 +3208,7 @@ const SvgBox = props =&gt; {
3201 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 3213 let rectangles = [];
3207 3214  
... ... @@ -3248,7 +3255,7 @@ const SvgBox = props =&gt; {
3248 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 3260 let rectangles = [];
3254 3261  
... ... @@ -3652,7 +3659,7 @@ const SvgBox = props =&gt; {
3652 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 3664 let rectangles = [];
3658 3665  
... ... @@ -3928,7 +3935,7 @@ const SvgBox = props =&gt; {
3928 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 3940 let rectangles = [];
3934 3941  
... ... @@ -3975,7 +3982,7 @@ const SvgBox = props =&gt; {
3975 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 3987 let rectangles = [];
3981 3988  
... ... @@ -4453,7 +4460,7 @@ const SvgBox = props =&gt; {
4453 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 4465 let rectangles = [];
4459 4466  
... ... @@ -4556,7 +4563,7 @@ const SvgBox = props =&gt; {
4556 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 4568 let rectangles = [];
4562 4569  
... ... @@ -4797,7 +4804,7 @@ const SvgBox = props =&gt; {
4797 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 4809 let rectangles = [];
4803 4810  
... ...
src/components/QuickQuote/index.jsx
1 1 /* eslint-disable */
2 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 4 import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined, UploadOutlined } from "@ant-design/icons";
5 5 import { cloneDeep } from "lodash";
6 6 import commonConfig from "@/utils/config";
... ... @@ -53,21 +53,21 @@ const QuickQuoteEvent = props =&gt; {
53 53 ];
54 54 const slaveDataNew = bInit
55 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 71 : slaveData;
72 72  
73 73 const manyDataNew = manyData.map(item => {
... ... @@ -317,6 +317,8 @@ const QuickQuoteEvent = props =&gt; {
317 317 const boxModel = name.replace("slaveUp", "").replace("slaveDown", "");
318 318  
319 319 if (sFieldName === "sName") {
  320 + let upAbleConfigsList = []
  321 +
320 322 if (!changeValue.sName) return;
321 323 const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName);
322 324 const { sColumnNameConfig, sColumnNameConfigExclusion, sColumnNameConfigPic } = dropDownDataSelected;
... ... @@ -327,11 +329,31 @@ const QuickQuoteEvent = props =&gt; {
327 329 const defaultData = commonFunc.getDefaultData({ gdsconfigformslave: upAbleConfigsExtra });
328 330 delete defaultData.sId;
329 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 348 changeValue = {
331 349 ...changeValue,
332 350 ...defaultData,
333 351 ...dropDownDataSelected,
334 352 upAbleConfigsExtra,
  353 + ...upAbleConfigsList.reduce((acc, item) => {
  354 + acc[item.sName] = item.sDefault;
  355 + return acc;
  356 + }, {}),
335 357 calcMethodData: commonUtils.convertStrToObj(sColumnNameConfigExclusion, []),
336 358 boxPicData: commonUtils.convertStrToObj(sColumnNameConfigPic, []),
337 359 };
... ... @@ -369,13 +391,13 @@ const QuickQuoteEvent = props =&gt; {
369 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 402 .filter(item => item !== "");
381 403 dropDownDataSelected.sBackendParams = sBackendParams;
... ... @@ -424,12 +446,12 @@ const QuickQuoteEvent = props =&gt; {
424 446 slaveData[iIndex] = {
425 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 455 : slaveData[iIndex]),
434 456 ...changeValue,
435 457 handleType: slaveData[iIndex].handleType || "update",
... ... @@ -439,6 +461,8 @@ const QuickQuoteEvent = props =&gt; {
439 461 const saveIndex = slaveData.findIndex(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel);
440 462 const materialStyleLength = slaveData[saveIndex].materialLength || 0;
441 463 const materialStyleWidth = slaveData[saveIndex].materialWidth || 0;
  464 +
  465 +
442 466 slaveData[saveIndex] = {
443 467 ...slaveData[saveIndex],
444 468 sMachineStyle: materialStyleLength + "*" + materialStyleWidth,
... ... @@ -511,13 +535,13 @@ const QuickQuoteEvent = props =&gt; {
511 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 546 .filter(item => item !== "");
523 547 dropDownDataSelected.sBackendParams = sBackendParams;
... ... @@ -1503,8 +1527,6 @@ const TreeComponent = props =&gt; {
1503 1527 masterData: { ...props.masterData, sFormId: "101251240115016076506222050" },
1504 1528 });
1505 1529 }
1506   - console.log(selectedNode, "selectedNode");
1507   -
1508 1530 getDropDownData(props);
1509 1531 }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]);
1510 1532 const { slaveData } = props.state;
... ... @@ -1539,10 +1561,10 @@ const TreeComponent = props =&gt; {
1539 1561  
1540 1562 // 内容组件
1541 1563 const ContentComponent = props => {
1542   - const { selectedNode = {}, extraParts = {} } = props.state;
  1564 + const { selectedNode = {}, extraParts = {}, slaveData } = props.state;
1543 1565 const manyqtysInfo = props.getI18nName("manyqtysInfo", "多数量报价");
1544 1566 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品");
1545   - const { showName ,sAllPartsNameDefault} = selectedNode;
  1567 + const { showName, sAllPartsNameDefault } = selectedNode;
1546 1568 const extraPartsList = extraParts[showName] || [];
1547 1569 let { sAllPartsName = "" } = selectedNode;
1548 1570 let bEmpty = false;
... ... @@ -1585,8 +1607,7 @@ const ContentComponent = props =&gt; {
1585 1607 ...itemBox,
1586 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 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 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 1623 }, [sAllPartsNameDefaultRef.current, props.state.slaveData]);
  1624 +
1601 1625 const boxModelList = sAllPartsName.split(",");
1602 1626 const [activeKey, setActiveKey] = useState(0);
1603 1627  
... ... @@ -1648,7 +1672,7 @@ const ContentComponent = props =&gt; {
1648 1672 }));
1649 1673 setActiveKey(boxModelList.length - 1 + extraPartsList.length);
1650 1674 },
1651   - onCancel() {},
  1675 + onCancel() { },
1652 1676 });
1653 1677 } else {
1654 1678 extraPartsList.splice(targetKey - boxModelList.length, 1);
... ... @@ -1813,7 +1837,7 @@ const BoxComponent = props =&gt; {
1813 1837 const { bBox } = selectedNode;
1814 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 1841 const { sBillNo } = slaveRowData;
1818 1842 useEffect(() => {
1819 1843 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
... ... @@ -1840,15 +1864,44 @@ const BoxComponent = props =&gt; {
1840 1864 ...slaveConfig.gdsconfigformslave.filter(item => item.iTag === 10).filter(item => (bBox ? true : item.sName !== "sName")),
1841 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 1894 const upViewProps = {
1844 1895 ...props,
1845   - viewConfigs: upAbleConfigs,
1846   - tableConfig: { ...slaveConfig, gdsconfigformslave: upAbleConfigs },
  1896 + viewConfigs: upAbleConfigsList,
  1897 + tableConfig: { ...slaveConfig, gdsconfigformslave: upAbleConfigsList },
1847 1898 iColValueView: 24,
1848 1899 viewRow: slaveRowData,
1849 1900 tableName: `slaveUp${boxModel}`,
1850 1901 };
1851 1902  
  1903 + console.log(upAbleConfigs,upAbleConfigsList,'upAbleConfigs');
  1904 +
1852 1905 const getUpViewPropsByITag = iTag => {
1853 1906 const config = slaveConfig.gdsconfigformslave
1854 1907 .filter(item => !["sPrint", "sColor", "iPrintModePo"].includes(item.sName))
... ... @@ -2350,7 +2403,6 @@ const BoxComponent = props =&gt; {
2350 2403 { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null },
2351 2404 { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null },
2352 2405 ];
2353   - const boxTypes = slaveRowData.sTypes;
2354 2406 const titleList1 = [
2355 2407 { name: "上方盒舌", value: "dSFHS" },
2356 2408 { name: "盒底组件", value: "dHDC" },
... ... @@ -2362,22 +2414,6 @@ const BoxComponent = props =&gt; {
2362 2414 { name: "右贴边位", value: "dYTBW" },
2363 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 2417 const evaluateFormula = (formula, variables) => {
2382 2418 if (!formula) return 0; // 如果公式为空,返回0
2383 2419 try {
... ... @@ -2409,18 +2445,31 @@ const BoxComponent = props =&gt; {
2409 2445 D,
2410 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 2454 slaveNewData.forEach(x => {
2414 2455 let key = 0;
2415 2456 if (x.sAssignFormula) {
2416 2457 key = evaluateFormula(x.sAssignFormula, variables);
2417 2458 slaveRowData[x.sName] = key;
2418 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 2470 boxList.push({
2422 2471 value: key,
2423   - sName: srcList.find(item => item.value === x.sName)?.name || "",
  2472 + sName: titleList1.find(item => item.value === x.sName)?.name || "",
2424 2473 isEditable: true,
2425 2474 isSelect: false,
2426 2475 selectValue: null,
... ... @@ -2429,6 +2478,18 @@ const BoxComponent = props =&gt; {
2429 2478 type: x.sTypes || null,
2430 2479 show: true,
2431 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 2495 tables.forEach(x => {
... ... @@ -2446,6 +2507,7 @@ const BoxComponent = props =&gt; {
2446 2507 });
2447 2508 });
2448 2509 }
  2510 +
2449 2511 const svgProps = {
2450 2512 ...props,
2451 2513 boxList,
... ... @@ -2453,6 +2515,7 @@ const BoxComponent = props =&gt; {
2453 2515 dSvgBoxHeight: 200,
2454 2516 showNew: 1,
2455 2517 };
  2518 + console.log("🚀 ~ svgProps:", svgProps)
2456 2519  
2457 2520 // upViewProps.viewRow =
2458 2521  
... ... @@ -2463,20 +2526,19 @@ const BoxComponent = props =&gt; {
2463 2526 const ImpositionInformation = commonFunc.showLocalMessage(props, "ImpositionInformation", "拼版信息");
2464 2527  
2465 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 2532 if (lastDotIndex === -1) {
2471 2533 // 如果字符串中没有点,则返回原字符串
2472 2534 return filename;
2473 2535 }
2474 2536 return filename.substring(0, lastDotIndex);
2475   - };
2476   - const getImageUrl = sName => {
  2537 + }
  2538 + const getImageUrl = (sName) => {
2477 2539 const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`;
2478   - return imageUrlNew;
2479   - };
  2540 + return imageUrlNew
  2541 + }
2480 2542 let imagesData = [
2481 2543 { src: getImageUrl(removeExtension(slaveRowData.sPackDetailPathUpLoad)), alt: "展开图" },
2482 2544 { src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" },
... ... @@ -2561,7 +2623,9 @@ const BoxComponent = props =&gt; {
2561 2623 <div className={styles.boxPart1}>
2562 2624 <div className={styles.boxPart1Left}>
2563 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 2629 </div>
2566 2630 {cailiaoyinshuaDiv}
2567 2631 </div>
... ... @@ -3304,26 +3368,10 @@ const BoxModelSelectedModal = props =&gt; {
3304 3368 { name: "右贴边位", value: "dYTBW" },
3305 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 3371 slaveData.forEach(x => {
3324 3372 boxList.push({
3325 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 3375 isEditable: true,
3328 3376 isSelect: false,
3329 3377 selectValue: null,
... ... @@ -3355,7 +3403,6 @@ const BoxModelSelectedModal = props =&gt; {
3355 3403 dSvgBoxHeight: 100,
3356 3404 showNew: 1,
3357 3405 };
3358   -
3359 3406 return svgProps;
3360 3407 };
3361 3408 const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected));
... ... @@ -3381,16 +3428,17 @@ const BoxModelSelectedModal = props =&gt; {
3381 3428 .forEach(column => {
3382 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 3430 column.render = (value, record, index) =>
  3431 +
3384 3432 column.dataIndex === "sPackDetailPathUpLoad" ? (
3385 3433 !value ? (
3386 3434 <div style={{ width: "auto", height: 100 }}>
3387 3435 <DynamicSVG {...getSvgProps(selectBoxList[index])} />
3388 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 3440 ) : value ? (
3393   - <img src={value} alt="" width={100} height={100} />
  3441 + <img src={getImageUrl(value)} alt="" width={100} height={100} />
3394 3442 ) : (
3395 3443 noImage
3396 3444 );
... ... @@ -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 3471 const BoxSelection = commonFunc.showLocalMessage(props, "Box-TypeSelection", "盒型选择");
3420 3472 const BtnClose = commonFunc.showLocalMessage(props, "BtnClose", "关闭");
3421 3473 return (
... ... @@ -3555,11 +3607,11 @@ const BackendParamsExtraComponent = props =&gt; {
3555 3607 const dropDownDataSelected = dropDownData?.length
3556 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 3615 if (!dropDownDataSelected) return;
3564 3616 dropDownDataSelected[sFieldName] = dropDownDataSelected.value;
3565 3617 const { sParam } = dropDownDataSelected;
... ... @@ -3678,7 +3730,6 @@ const GetBestAlgorithm = props =&gt; {
3678 3730 { name: "盒宽", value: W, type: null },
3679 3731 { name: "盒高", value: D, type: null },
3680 3732 ];
3681   - const boxTypes = slaveRowData.sTypes;
3682 3733 const titleList1 = [
3683 3734 { name: "上方盒舌", value: "dSFHS" },
3684 3735 { name: "盒底组件", value: "dHDC" },
... ... @@ -3690,22 +3741,6 @@ const GetBestAlgorithm = props =&gt; {
3690 3741 { name: "右贴边位", value: "dYTBW" },
3691 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 3744 slaveNewData.forEach(x => {
3710 3745 let key = 0;
3711 3746 if (x.sAssignFormula) {
... ... @@ -3715,7 +3750,7 @@ const GetBestAlgorithm = props =&gt; {
3715 3750 }
3716 3751 boxList.push({
3717 3752 value: key,
3718   - sName: srcList.find(item => item.value === x.sName)?.name || "",
  3753 + sName: titleList1.find(item => item.value === x.sName)?.name || "",
3719 3754 isEditable: true,
3720 3755 isSelect: false,
3721 3756 selectValue: null,
... ... @@ -3723,7 +3758,7 @@ const GetBestAlgorithm = props =&gt; {
3723 3758 selectImage: null,
3724 3759 type: x.sTypes || null,
3725 3760 show: true,
3726   - sCode: srcList.find(item => item.value === x.sName)?.value || "",
  3761 + sCode: titleList1.find(item => item.value === x.sName)?.value || "",
3727 3762 showName: x.showName, // 参数名称
3728 3763 });
3729 3764 });
... ... @@ -3910,16 +3945,14 @@ const GetBestAlgorithm = props =&gt; {
3910 3945 justifyContent: "center",
3911 3946 alignItems: "center",
3912 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 3951 ? innerHeight + dFLengthOffset + dSLengthOffset + dYBJJ
3918 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 3957 ></div>
3925 3958 </div>
... ... @@ -4068,8 +4101,8 @@ const GetBestAlgorithm = props =&gt; {
4068 4101 ? cols + cols * (rows * 2)
4069 4102 : cols * (rows * 2)
4070 4103 : remaining
4071   - ? rows + rows * (cols * 2)
4072   - : rows * (cols * 2);
  4104 + ? rows + rows * (cols * 2)
  4105 + : rows * (cols * 2);
4073 4106  
4074 4107 let dHorizontalType = isVertical ? cols : remaining ? cols * 2 + 1 : cols * 2;
4075 4108 let dPortraitType = isVertical ? (remaining ? rows * 2 + 1 : rows * 2) : remaining ? rows : rows;
... ...