Commit e26288e48e980d98162825e0e930f81f89872c1c

Authored by 陈鑫涛
1 parent 8daf27c8

双部件

src/components/Common/BoxDesignCompontent/index.css
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 } 22 }
23 .boxBody .boxLeft { 23 .boxBody .boxLeft {
24 width: 180px; 24 width: 180px;
25 - height: 320px; 25 + min-height: 320px;
26 display: flex; 26 display: flex;
27 flex-wrap: wrap; 27 flex-wrap: wrap;
28 flex-direction: column; 28 flex-direction: column;
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 } 34 }
35 .boxBody .boxRight { 35 .boxBody .boxRight {
36 width: 180px; 36 width: 180px;
37 - height: 320px; 37 + min-height: 320px;
38 display: flex; 38 display: flex;
39 flex-wrap: wrap; 39 flex-wrap: wrap;
40 justify-content: space-between; 40 justify-content: space-between;
@@ -54,8 +54,8 @@ @@ -54,8 +54,8 @@
54 } 54 }
55 .boxBody .boxBottom .svgBox { 55 .boxBody .boxBottom .svgBox {
56 width: 100%; 56 width: 100%;
57 - height: 250px;  
58 - background-color: #9AFF9A; 57 + min-height: 250px;
  58 + background-color: #9aff9a;
59 } 59 }
60 .boxBody .boxBottom .content { 60 .boxBody .boxBottom .content {
61 width: 100%; 61 width: 100%;
@@ -78,8 +78,9 @@ @@ -78,8 +78,9 @@
78 line-height: 20px; 78 line-height: 20px;
79 text-align: center; 79 text-align: center;
80 } 80 }
81 -.boxBody :global .mySelects .ant-select-selector {  
82 - background-color: #99CCFF !important; 81 +.boxBody :global .mySelects .ant-select-selector,
  82 +.boxBody :global .mySelectsDouble .ant-select-selector {
  83 + background-color: #99ccff !important;
83 /* 选择框背景色 */ 84 /* 选择框背景色 */
84 height: 40px !important; 85 height: 40px !important;
85 /* 选择框高度 */ 86 /* 选择框高度 */
@@ -88,6 +89,11 @@ @@ -88,6 +89,11 @@
88 color: transparent !important; 89 color: transparent !important;
89 /* 选择框文字颜色 */ 90 /* 选择框文字颜色 */
90 } 91 }
  92 +.boxBody :global .mySelectsDouble .ant-select-selection-item {
  93 + color: #333 !important;
  94 + /* 选择框文字颜色 */
  95 + line-height: 40px !important;
  96 +}
91 .boxBody .mySelects { 97 .boxBody .mySelects {
92 position: relative; 98 position: relative;
93 } 99 }
@@ -96,17 +102,20 @@ @@ -96,17 +102,20 @@
96 align-items: center; 102 align-items: center;
97 justify-content: space-between; 103 justify-content: space-between;
98 width: 180px; 104 width: 180px;
99 - height: 40px; 105 + min-height: 40px;
100 position: relative; 106 position: relative;
101 } 107 }
102 .boxBody .boxInput :global .ant-input { 108 .boxBody .boxInput :global .ant-input {
103 - background-color: #99CCFF !important; 109 + background-color: #99ccff !important;
104 /* 输入框背景色 */ 110 /* 输入框背景色 */
105 border: 1px solid #d9d9d9; 111 border: 1px solid #d9d9d9;
106 height: 40px; 112 height: 40px;
107 } 113 }
  114 +.boxBody .boxInput :global .ant-input::placeholder {
  115 + color: #fff !important;
  116 +}
108 .boxBody .text { 117 .boxBody .text {
109 - background-color: #99CCFF; 118 + background-color: #99ccff;
110 width: 100%; 119 width: 100%;
111 height: 40px; 120 height: 40px;
112 line-height: 40px; 121 line-height: 40px;
@@ -115,18 +124,18 @@ @@ -115,18 +124,18 @@
115 margin-right: 1px; 124 margin-right: 1px;
116 } 125 }
117 .boxBody .content :global .ant-input { 126 .boxBody .content :global .ant-input {
118 - background-color: #EEEEEE !important; 127 + background-color: #eeeeee !important;
119 /* 输入框背景色 */ 128 /* 输入框背景色 */
120 height: 40px; 129 height: 40px;
121 } 130 }
122 .boxBody .content :global .ant-select-selector { 131 .boxBody .content :global .ant-select-selector {
123 - background-color: #EEEEEE !important; 132 + background-color: #eeeeee !important;
124 /* 选择框背景色 */ 133 /* 选择框背景色 */
125 height: 40px !important; 134 height: 40px !important;
126 /* 选择框高度 */ 135 /* 选择框高度 */
127 } 136 }
128 .boxBody .content .text { 137 .boxBody .content .text {
129 - background-color: #EEEEEE; 138 + background-color: #eeeeee;
130 margin: 0; 139 margin: 0;
131 } 140 }
132 .boxBody .content .boxFlex { 141 .boxBody .content .boxFlex {
@@ -148,7 +157,7 @@ @@ -148,7 +157,7 @@
148 flex: 1; 157 flex: 1;
149 } 158 }
150 .boxBody .content .boxFlexs .boxInputs :global .ant-input { 159 .boxBody .content .boxFlexs .boxInputs :global .ant-input {
151 - background-color: #EEEEEE !important; 160 + background-color: #eeeeee !important;
152 /* 输入框背景色 */ 161 /* 输入框背景色 */
153 height: 40px; 162 height: 40px;
154 } 163 }
@@ -162,7 +171,7 @@ @@ -162,7 +171,7 @@
162 top: 3px; 171 top: 3px;
163 width: 60px; 172 width: 60px;
164 height: 30px; 173 height: 30px;
165 - background-color: #EEE; 174 + background-color: #eee;
166 color: #333; 175 color: #333;
167 line-height: 40px; 176 line-height: 40px;
168 z-index: 2; 177 z-index: 2;
src/components/Common/BoxDesignCompontent/index.js
@@ -23,6 +23,26 @@ const BoxDesignEvent = props => { @@ -23,6 +23,26 @@ const BoxDesignEvent = props => {
23 23
24 addState.getSqlOptions = async type => { 24 addState.getSqlOptions = async type => {
25 setLoading(true); 25 setLoading(true);
  26 + if (!type) {
  27 + setLoading(false);
  28 + setOptions([
  29 + {
  30 + sId: "0",
  31 + sCode: "0",
  32 + sName: "矩形",
  33 + sMakeUpPath: "",
  34 + sTypes: "0",
  35 + },
  36 + {
  37 + sId: "1",
  38 + sCode: "1",
  39 + sName: "梯形",
  40 + sMakeUpPath: "",
  41 + sTypes: "1",
  42 + },
  43 + ]);
  44 + return;
  45 + }
26 const { app, token, makeConfig } = props; 46 const { app, token, makeConfig } = props;
27 // const quickQuoteConfig = config.gdsconfigformslave.find(item => item.sControlName === "BtnQuickQuote") || {}; 47 // const quickQuoteConfig = config.gdsconfigformslave.find(item => item.sControlName === "BtnQuickQuote") || {};
28 const { sId } = makeConfig; 48 const { sId } = makeConfig;
@@ -48,6 +68,8 @@ const BoxDesignEvent = props => { @@ -48,6 +68,8 @@ const BoxDesignEvent = props => {
48 } 68 }
49 return 0; // 其他元素保持原顺序 69 return 0; // 其他元素保持原顺序
50 }); 70 });
  71 + console.log(data.data.dataset.rows, "data.data.dataset.rows");
  72 +
51 setOptions(data.data.dataset.rows); 73 setOptions(data.data.dataset.rows);
52 } 74 }
53 setLoading(false); 75 setLoading(false);
@@ -89,6 +111,8 @@ const BoxDesignCompontent = baseProps => { @@ -89,6 +111,8 @@ const BoxDesignCompontent = baseProps => {
89 const [boxKey, setBoxKey] = useState(new Date().getTime()); 111 const [boxKey, setBoxKey] = useState(new Date().getTime());
90 const [doubleLayerList, setDoubleLayerList] = useState([]); 112 const [doubleLayerList, setDoubleLayerList] = useState([]);
91 if (!boxVisible) return ""; 113 if (!boxVisible) return "";
  114 + console.log(baseProps, "baseProps");
  115 +
92 // 1️⃣ 只负责 tableColum 116 // 1️⃣ 只负责 tableColum
93 useEffect(() => { 117 useEffect(() => {
94 if (!tableData?.length) return; 118 if (!tableData?.length) return;
@@ -230,6 +254,18 @@ const BoxDesignCompontent = baseProps => { @@ -230,6 +254,18 @@ const BoxDesignCompontent = baseProps => {
230 show: true, 254 show: true,
231 showName: item, // 参数名称 255 showName: item, // 参数名称
232 sAssignFormula: null, 256 sAssignFormula: null,
  257 + sLength: null,
  258 + sWidth: null,
  259 + sType: null, // 盒型类别
  260 + sTypeName: null, // 盒型名称
  261 + sOffset: null, // 偏移
  262 + sQuantity: null, // 数量
  263 + cLength: null,
  264 + cWidth: null,
  265 + cType: null, // 盒型类别
  266 + cTypeName: null, // 盒型名称
  267 + cOffset: null, // 偏移
  268 + cQuantity: null, // 数量
233 }); 269 });
234 }); 270 });
235 // 部件信息 271 // 部件信息
@@ -243,13 +279,27 @@ const BoxDesignCompontent = baseProps => { @@ -243,13 +279,27 @@ const BoxDesignCompontent = baseProps => {
243 }); 279 });
244 if (i !== -1) { 280 if (i !== -1) {
245 const x = newBoxList.findIndex(z => z.sName === titleList1[i].name); 281 const x = newBoxList.findIndex(z => z.sName === titleList1[i].name);
246 - newBoxList[x].value = item.iValue;  
247 - newBoxList[x].type = item.sTypes;  
248 - newBoxList[x].showName = item.sName;  
249 - newBoxList[x].selectImage = item.sMakeUpPath;  
250 - newBoxList[x].sName = titleList1[i].name;  
251 - newBoxList[x].sAssignFormula = item.sAssignFormula;  
252 - newBoxList[x].bVisible = item.bVisible; 282 + Object.assign(newBoxList[x], {
  283 + value: item.iValue,
  284 + type: item.sTypes,
  285 + showName: item.sName,
  286 + selectImage: item.sMakeUpPath,
  287 + sName: titleList1[i].name,
  288 + sAssignFormula: item.sAssignFormula,
  289 + bVisible: item.bVisible,
  290 + sLength: item.sLength,
  291 + sWidth: item.sWidth,
  292 + sType: item.sType,
  293 + sTypeName: item.sTypeName,
  294 + sOffset: item.sOffset,
  295 + sQuantity: item.sQuantity,
  296 + cLength: item.cLength,
  297 + cWidth: item.cWidth,
  298 + cType: item.cType,
  299 + cTypeName: item.cTypeName,
  300 + cOffset: item.cOffset,
  301 + cQuantity: item.cQuantity,
  302 + });
253 } 303 }
254 }); 304 });
255 } else { 305 } else {
@@ -273,10 +323,10 @@ const BoxDesignCompontent = baseProps => { @@ -273,10 +323,10 @@ const BoxDesignCompontent = baseProps => {
273 } 323 }
274 // 盒身信息 324 // 盒身信息
275 if (masterData) { 325 if (masterData) {
276 - const headLength = slaveData.find(item => item.sCode === "dSHC")?.iValue  
277 - const headWidth = slaveData.find(item => item.sCode === "dSHK")?.iValue  
278 - const orderLength = slaveData.find(item => item.sCode === "dCHC")?.iValue  
279 - const orderWidth = slaveData.find(item => item.sCode === "dCHK")?.iValue 326 + const headLength = slaveData.find(item => item.sCode === "dSHC")?.iValue;
  327 + const headWidth = slaveData.find(item => item.sCode === "dSHK")?.iValue;
  328 + const orderLength = slaveData.find(item => item.sCode === "dCHC")?.iValue;
  329 + const orderWidth = slaveData.find(item => item.sCode === "dCHK")?.iValue;
280 newBoxList.forEach((item, index) => { 330 newBoxList.forEach((item, index) => {
281 if (item.sName === "盒身") { 331 if (item.sName === "盒身") {
282 newBoxList[index].value = masterData.sBoxBody; 332 newBoxList[index].value = masterData.sBoxBody;
@@ -298,7 +348,7 @@ const BoxDesignCompontent = baseProps => { @@ -298,7 +348,7 @@ const BoxDesignCompontent = baseProps => {
298 newBoxList[index].value = orderLength; 348 newBoxList[index].value = orderLength;
299 } else if (item.sName === "次盒宽") { 349 } else if (item.sName === "次盒宽") {
300 newBoxList[index].value = orderWidth; 350 newBoxList[index].value = orderWidth;
301 - } 351 + }
302 }); 352 });
303 } 353 }
304 // 有数据的时候 盒型设计需要赋值 354 // 有数据的时候 盒型设计需要赋值
@@ -422,9 +472,13 @@ const BoxDesignCompontent = baseProps => { @@ -422,9 +472,13 @@ const BoxDesignCompontent = baseProps => {
422 } 472 }
423 }; 473 };
424 474
425 - const handleChange = (e, index) => { 475 + const handleChange = (e, index, field) => {
426 const updatedBoxList = [...boxList]; 476 const updatedBoxList = [...boxList];
427 - updatedBoxList[index].value = e.target.value; 477 + if (field) {
  478 + updatedBoxList[index][field] = e.target.value;
  479 + } else {
  480 + updatedBoxList[index].value = e.target.value;
  481 + }
428 setBoxList(updatedBoxList); 482 setBoxList(updatedBoxList);
429 }; 483 };
430 484
@@ -434,7 +488,7 @@ const BoxDesignCompontent = baseProps => { @@ -434,7 +488,7 @@ const BoxDesignCompontent = baseProps => {
434 setBoxList(updatedBoxList); 488 setBoxList(updatedBoxList);
435 }; 489 };
436 490
437 - const handleSelect = (name, selectConfig, index, type) => { 491 + const handleSelect = (name, selectConfig, index, type, doubleType) => {
438 let updatedBoxList = [...boxList]; 492 let updatedBoxList = [...boxList];
439 updatedBoxList[index].type = name; 493 updatedBoxList[index].type = name;
440 updatedBoxList[index].selectImage = selectConfig.image; 494 updatedBoxList[index].selectImage = selectConfig.image;
@@ -460,6 +514,17 @@ const BoxDesignCompontent = baseProps => { @@ -460,6 +514,17 @@ const BoxDesignCompontent = baseProps => {
460 } 514 }
461 setBoxList(updatedBoxList); 515 setBoxList(updatedBoxList);
462 }; 516 };
  517 + const handleSelects = (name, selectConfig, index, type, doubleType) => {
  518 + let updatedBoxList = [...boxList];
  519 + if (doubleType === 0) {
  520 + updatedBoxList[index].sTypeName = Number(name) === 0 ? "矩形" : "梯形";
  521 + updatedBoxList[index].sType = Number(name)
  522 + } else {
  523 + updatedBoxList[index].cTypeName = Number(name) === 0 ? "矩形" : "梯形";
  524 + updatedBoxList[index].cType = Number(name)
  525 + }
  526 + setBoxList(updatedBoxList);
  527 + };
463 const getImage = fileName => { 528 const getImage = fileName => {
464 // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&sModelsId=100&token=${props.token}`; 529 // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&sModelsId=100&token=${props.token}`;
465 const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&scale=0.1&sModelsId=100&token=${props.token}`; 530 const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&scale=0.1&sModelsId=100&token=${props.token}`;
@@ -477,10 +542,22 @@ const BoxDesignCompontent = baseProps => { @@ -477,10 +542,22 @@ const BoxDesignCompontent = baseProps => {
477 </Select.Option> 542 </Select.Option>
478 ); 543 );
479 }; 544 };
480 - const svgBoxProps = { 545 + const renderOptionWithText = option => {
  546 + return (
  547 + <Select.Option key={option.sId} value={option.sCode} label={option.sName}>
  548 + <div style={{ display: "flex", alignItems: "center" }}>
  549 + <span>{option.sName}</span>
  550 + </div>
  551 + </Select.Option>
  552 + );
  553 + };
  554 + // const [svgBoxProps, setSvgBoxProps] = useState({ ...props, boxList, showNew: 0, dSvgBoxWidth: 500, dSvgBoxHeight: 250 });
  555 + let svgBoxProps = {
481 ...props, 556 ...props,
482 boxList, 557 boxList,
483 showNew: 0, 558 showNew: 0,
  559 + // dSvgBoxWidth: 500,
  560 + // dSvgBoxHeight: 250,
484 }; 561 };
485 const dobuleProps = { 562 const dobuleProps = {
486 ...props, 563 ...props,
@@ -513,6 +590,18 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -513,6 +590,18 @@ const BoxDesignCompontent = baseProps =&gt; {
513 bVisible: item.value ? true : false, 590 bVisible: item.value ? true : false,
514 sParentId: masterData.sId, 591 sParentId: masterData.sId,
515 sAssignFormula: item.sAssignFormula, 592 sAssignFormula: item.sAssignFormula,
  593 + sLength: item.sLength,
  594 + sWidth: item.sWidth,
  595 + sType: item.sType,
  596 + sTypeName: item.sTypeName,
  597 + sOffset: item.sOffset,
  598 + sQuantity: item.sQuantity,
  599 + cLength: item.cLength,
  600 + cWidth: item.cWidth,
  601 + cType: item.cType,
  602 + cTypeName: item.cTypeName,
  603 + cOffset: item.cOffset,
  604 + cQuantity: item.cQuantity,
516 }; 605 };
517 // if (item.value !== "") { 606 // if (item.value !== "") {
518 newSlaveData.push(data); 607 newSlaveData.push(data);
@@ -534,7 +623,6 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -534,7 +623,6 @@ const BoxDesignCompontent = baseProps =&gt; {
534 let sWidthFormula = ""; 623 let sWidthFormula = "";
535 const boxType = boxList.find(item => item.sName === "盒身")?.type; 624 const boxType = boxList.find(item => item.sName === "盒身")?.type;
536 if (boxType === "8") { 625 if (boxType === "8") {
537 -  
538 } else { 626 } else {
539 const boxLength = Number(boxList.find(item => item.sName === "盒长")?.value); 627 const boxLength = Number(boxList.find(item => item.sName === "盒长")?.value);
540 const boxWidth = Number(boxList.find(item => item.sName === "盒宽")?.value); 628 const boxWidth = Number(boxList.find(item => item.sName === "盒宽")?.value);
@@ -878,7 +966,27 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -878,7 +966,27 @@ const BoxDesignCompontent = baseProps =&gt; {
878 const i = boxList.findIndex(x => x.sName === name); 966 const i = boxList.findIndex(x => x.sName === name);
879 return i || 0; 967 return i || 0;
880 }; 968 };
881 - 969 + const types = (leftBoxList || []).find(item => {
  970 + if (!item.type) return false;
  971 + return item.type.includes("09");
  972 + });
  973 + const typesRight = (rightBoxList || []).find(item => {
  974 + if (!item.type) return false;
  975 + return item.type.includes("09");
  976 + });
  977 + const typesTop = (topBoxList || []).find(item => {
  978 + if (!item.type) return false;
  979 + return item.type.includes("09");
  980 + });
  981 + if (types || typesRight) {
  982 + svgBoxProps = {
  983 + ...props,
  984 + boxList,
  985 + showNew: 0,
  986 + // dSvgBoxWidth: 500,
  987 + // dSvgBoxHeight: 400,
  988 + };
  989 + }
882 return ( 990 return (
883 <AntdDraggableModal 991 <AntdDraggableModal
884 width="1000px" 992 width="1000px"
@@ -901,7 +1009,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -901,7 +1009,7 @@ const BoxDesignCompontent = baseProps =&gt; {
901 {/* 盒身信息 */} 1009 {/* 盒身信息 */}
902 1010
903 <div className={styles.boxBody} key={boxKey}> 1011 <div className={styles.boxBody} key={boxKey}>
904 - <div className={styles.boxTop}> 1012 + <div className={styles.boxTop} style={{ height: `${typesTop ? "200px" : "100px"}` }}>
905 {boxType !== "8" && 1013 {boxType !== "8" &&
906 topBoxList.map((topItem, index) => ( 1014 topBoxList.map((topItem, index) => (
907 <div key={index} className={styles.boxFlex} style={{ display: topItem.show ? "block" : "none" }}> 1015 <div key={index} className={styles.boxFlex} style={{ display: topItem.show ? "block" : "none" }}>
@@ -930,25 +1038,146 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -930,25 +1038,146 @@ const BoxDesignCompontent = baseProps =&gt; {
930 > 1038 >
931 {!loading ? options.map(option => renderOptionWithImage(option)) : ""} 1039 {!loading ? options.map(option => renderOptionWithImage(option)) : ""}
932 </Select> 1040 </Select>
933 - <div className={styles.boxInput}>  
934 - {/* <div className={styles.text}>参数:</div> */}  
935 - <Input  
936 - value={topItem?.showName}  
937 - onChange={e => handleChangeName(e, index)}  
938 - onFocus={e => handleFocus(e, index)}  
939 - onBlur={e => handleBlur(e, index)}  
940 - readOnly={!topItem?.isEditable}  
941 - className={styles.text}  
942 - />  
943 - <Input  
944 - value={topItem?.value}  
945 - onChange={e => handleChange(e, index)}  
946 - onFocus={e => handleFocus(e, index)}  
947 - onBlur={e => handleBlur(e, index)}  
948 - readOnly={!topItem?.isEditable}  
949 - style={{ width: " 80%" }}  
950 - />  
951 - </div> 1041 + {topItem.type && topItem.type.includes("09") ? (
  1042 + <div>
  1043 + <div className={styles.boxInput}>
  1044 + <div className={styles.text} style={{ width: " 100%" }}>
  1045 + 层1{" "}
  1046 + </div>
  1047 + <Input
  1048 + value={topItem?.sLength}
  1049 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "sLength")}
  1050 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1051 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1052 + readOnly={!topItem?.isEditable}
  1053 + style={{ width: " 80%" }}
  1054 + placeholder="长"
  1055 + />
  1056 + <Input
  1057 + value={topItem?.sWidth}
  1058 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "sWidth")}
  1059 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1060 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1061 + readOnly={!topItem?.isEditable}
  1062 + style={{ width: " 80%" }}
  1063 + placeholder="宽"
  1064 + />
  1065 + </div>
  1066 + <div className={styles.boxInput}>
  1067 + <Select
  1068 + optionLabelProp="label"
  1069 + className="mySelectsDouble"
  1070 + style={{ width: 180, color: "#000" }}
  1071 + defaultValue={options.length ? options[0].value : ""}
  1072 + value={topItem?.sTypeName || ""}
  1073 + onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 0)}
  1074 + onDropdownVisibleChange={async open => {
  1075 + if (open) {
  1076 + props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions
  1077 + }
  1078 + }}
  1079 + >
  1080 + {!loading ? options.map(option => renderOptionWithText(option)) : ""}
  1081 + </Select>
  1082 + <Input
  1083 + value={topItem?.sQuantity}
  1084 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "sQuantity")}
  1085 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1086 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1087 + readOnly={!topItem?.isEditable}
  1088 + style={{ width: " 80%" }}
  1089 + placeholder="个数"
  1090 + />
  1091 + <Input
  1092 + value={topItem?.sOffset}
  1093 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "sOffset")}
  1094 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1095 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1096 + readOnly={!topItem?.isEditable}
  1097 + style={{ width: " 80%" }}
  1098 + placeholder="偏移"
  1099 + />
  1100 + </div>
  1101 + <div className={styles.boxInput}>
  1102 + <div className={styles.text} style={{ width: " 100%" }}>
  1103 + 层2{" "}
  1104 + </div>
  1105 + <Input
  1106 + value={topItem?.cLength}
  1107 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "cLength")}
  1108 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1109 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1110 + readOnly={!topItem?.isEditable}
  1111 + style={{ width: " 80%" }}
  1112 + placeholder="长"
  1113 + />
  1114 + <Input
  1115 + value={topItem?.cWidth}
  1116 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "cWidth")}
  1117 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1118 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1119 + readOnly={!topItem?.isEditable}
  1120 + style={{ width: " 80%" }}
  1121 + placeholder="宽"
  1122 + />
  1123 + </div>
  1124 + <div className={styles.boxInput}>
  1125 + <Select
  1126 + optionLabelProp="label"
  1127 + className="mySelectsDouble"
  1128 + style={{ width: 180, color: "#000" }}
  1129 + defaultValue={options.length ? options[0].value : ""}
  1130 + value={topItem?.cTypeName || ""}
  1131 + onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 1)}
  1132 + onDropdownVisibleChange={async open => {
  1133 + if (open) {
  1134 + props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions
  1135 + }
  1136 + }}
  1137 + >
  1138 + {!loading ? options.map(option => renderOptionWithText(option)) : ""}
  1139 + </Select>
  1140 + <Input
  1141 + value={topItem?.cQuantity}
  1142 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "cQuantity")}
  1143 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1144 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1145 + readOnly={!topItem?.isEditable}
  1146 + style={{ width: " 80%" }}
  1147 + placeholder="个数"
  1148 + />
  1149 + <Input
  1150 + value={topItem?.cOffset}
  1151 + onChange={e => handleChange(e, findIndexBySname(topItem.sName), "cOffset")}
  1152 + onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
  1153 + onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
  1154 + readOnly={!topItem?.isEditable}
  1155 + style={{ width: " 80%" }}
  1156 + placeholder="偏移"
  1157 + />
  1158 + </div>
  1159 + </div>
  1160 + ) : (
  1161 + <div className={styles.boxInput}>
  1162 + {/* <div className={styles.text}>参数:</div> */}
  1163 + <Input
  1164 + value={topItem?.showName}
  1165 + onChange={e => handleChangeName(e, index)}
  1166 + onFocus={e => handleFocus(e, index)}
  1167 + onBlur={e => handleBlur(e, index)}
  1168 + readOnly={!topItem?.isEditable}
  1169 + className={styles.text}
  1170 + />
  1171 + <Input
  1172 + value={topItem?.value}
  1173 + onChange={e => handleChange(e, index)}
  1174 + onFocus={e => handleFocus(e, index)}
  1175 + onBlur={e => handleBlur(e, index)}
  1176 + readOnly={!topItem?.isEditable}
  1177 + style={{ width: " 80%" }}
  1178 + />
  1179 + </div>
  1180 + )}
952 </div> 1181 </div>
953 ))} 1182 ))}
954 {boxType === "8" && 1183 {boxType === "8" &&
@@ -1000,7 +1229,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1000,7 +1229,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1000 </div> 1229 </div>
1001 ))} 1230 ))}
1002 </div> 1231 </div>
1003 - <div className={styles.boxLeft}> 1232 + <div className={styles.boxLeft} style={{ top: `${typesTop ? "240px" : "130px"}` }}>
1004 {boxType !== "8" && 1233 {boxType !== "8" &&
1005 leftBoxList.map((item, index) => ( 1234 leftBoxList.map((item, index) => (
1006 <div key={index + 3} className={styles.boxFlex} style={{ display: item?.show ? "block" : "none" }}> 1235 <div key={index + 3} className={styles.boxFlex} style={{ display: item?.show ? "block" : "none" }}>
@@ -1038,22 +1267,145 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1038,22 +1267,145 @@ const BoxDesignCompontent = baseProps =&gt; {
1038 ) : ( 1267 ) : (
1039 "" 1268 ""
1040 )} 1269 )}
1041 - <Input  
1042 - value={item?.showName}  
1043 - onChange={e => handleChangeName(e, findIndexBySname(item.sName))}  
1044 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1045 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1046 - readOnly={!item?.isEditable}  
1047 - className={styles.text}  
1048 - />  
1049 - <Input  
1050 - value={item?.value}  
1051 - onChange={e => handleChange(e, findIndexBySname(item.sName))}  
1052 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1053 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1054 - readOnly={!item?.isEditable}  
1055 - style={{ width: " 80%" }}  
1056 - /> 1270 + {item.type && item.type.includes("09") ? (
  1271 + <div>
  1272 + <div className={styles.boxInput}>
  1273 + <div className={styles.text} style={{ width: " 100%" }}>
  1274 + 层1{" "}
  1275 + </div>
  1276 + <Input
  1277 + value={item?.sLength}
  1278 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sLength")}
  1279 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1280 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1281 + readOnly={!item?.isEditable}
  1282 + style={{ width: " 80%" }}
  1283 + placeholder="长"
  1284 + />
  1285 + <Input
  1286 + value={item?.sWidth}
  1287 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sWidth")}
  1288 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1289 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1290 + readOnly={!item?.isEditable}
  1291 + style={{ width: " 80%" }}
  1292 + placeholder="宽"
  1293 + />
  1294 + </div>
  1295 + <div className={styles.boxInput}>
  1296 + <Select
  1297 + optionLabelProp="label"
  1298 + className="mySelectsDouble"
  1299 + style={{ width: 180, color: "#000" }}
  1300 + defaultValue={options.length ? options[0].value : ""}
  1301 + value={item?.sTypeName || ""}
  1302 + onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
  1303 + onDropdownVisibleChange={async open => {
  1304 + if (open) {
  1305 + props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions
  1306 + }
  1307 + }}
  1308 + >
  1309 + {!loading ? options.map(option => renderOptionWithText(option)) : ""}
  1310 + </Select>
  1311 + <Input
  1312 + value={item?.sQuantity}
  1313 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sQuantity")}
  1314 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1315 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1316 + readOnly={!item?.isEditable}
  1317 + style={{ width: " 80%" }}
  1318 + placeholder="个数"
  1319 + />
  1320 + <Input
  1321 + value={item?.sOffset}
  1322 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sOffset")}
  1323 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1324 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1325 + readOnly={!item?.isEditable}
  1326 + style={{ width: " 80%" }}
  1327 + placeholder="偏移"
  1328 + />
  1329 + </div>
  1330 + <div className={styles.boxInput}>
  1331 + <div className={styles.text} style={{ width: " 100%" }}>
  1332 + 层2{" "}
  1333 + </div>
  1334 + <Input
  1335 + value={item?.cLength}
  1336 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cLength")}
  1337 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1338 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1339 + readOnly={!item?.isEditable}
  1340 + style={{ width: " 80%" }}
  1341 + placeholder="长"
  1342 + />
  1343 + <Input
  1344 + value={item?.cWidth}
  1345 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cWidth")}
  1346 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1347 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1348 + readOnly={!item?.isEditable}
  1349 + style={{ width: " 80%" }}
  1350 + placeholder="宽"
  1351 + />
  1352 + </div>
  1353 + <div className={styles.boxInput}>
  1354 + <Select
  1355 + optionLabelProp="label"
  1356 + className="mySelectsDouble"
  1357 + style={{ width: 180, color: "#000" }}
  1358 + defaultValue={options.length ? options[0].value : ""}
  1359 + value={item?.cTypeName || ""}
  1360 + onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
  1361 + onDropdownVisibleChange={async open => {
  1362 + if (open) {
  1363 + props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions
  1364 + }
  1365 + }}
  1366 + >
  1367 + {!loading ? options.map(option => renderOptionWithText(option)) : ""}
  1368 + </Select>
  1369 + <Input
  1370 + value={item?.cQuantity}
  1371 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cQuantity")}
  1372 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1373 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1374 + readOnly={!item?.isEditable}
  1375 + style={{ width: " 80%" }}
  1376 + placeholder="个数"
  1377 + />
  1378 + <Input
  1379 + value={item?.cOffset}
  1380 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cOffset")}
  1381 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1382 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1383 + readOnly={!item?.isEditable}
  1384 + style={{ width: " 80%" }}
  1385 + placeholder="偏移"
  1386 + />
  1387 + </div>
  1388 + </div>
  1389 + ) : (
  1390 + <div className={styles.boxInput}>
  1391 + <Input
  1392 + value={item?.showName}
  1393 + onChange={e => handleChangeName(e, findIndexBySname(item.sName))}
  1394 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1395 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1396 + readOnly={!item?.isEditable}
  1397 + className={styles.text}
  1398 + />
  1399 + <Input
  1400 + value={item?.value}
  1401 + onChange={e => handleChange(e, findIndexBySname(item.sName))}
  1402 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1403 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1404 + readOnly={!item?.isEditable}
  1405 + style={{ width: " 80%" }}
  1406 + />
  1407 + </div>
  1408 + )}
1057 </div> 1409 </div>
1058 </div> 1410 </div>
1059 ))} 1411 ))}
@@ -1118,7 +1470,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1118,7 +1470,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1118 </div> 1470 </div>
1119 ))} 1471 ))}
1120 </div> 1472 </div>
1121 - <div className={styles.boxRight}> 1473 + <div className={styles.boxRight} style={{ top: `${typesTop ? "240px" : "130px"}` }}>
1122 {boxType !== "8" && 1474 {boxType !== "8" &&
1123 rightBoxList.map((item, index) => ( 1475 rightBoxList.map((item, index) => (
1124 <div key={findIndexBySname(item.sName)} className={styles.boxFlex} style={{ display: item?.show ? "block" : "none" }}> 1476 <div key={findIndexBySname(item.sName)} className={styles.boxFlex} style={{ display: item?.show ? "block" : "none" }}>
@@ -1138,42 +1490,163 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1138,42 +1490,163 @@ const BoxDesignCompontent = baseProps =&gt; {
1138 > 1490 >
1139 {!loading ? options.map(option => renderOptionWithImage(option)) : ""} 1491 {!loading ? options.map(option => renderOptionWithImage(option)) : ""}
1140 </Select> 1492 </Select>
1141 - <div className={styles.boxInput}>  
1142 - {item?.selectImage ? (  
1143 - <img  
1144 - src={item?.selectImage}  
1145 - alt={item.value}  
1146 - style={{  
1147 - width: 40,  
1148 - height: 30,  
1149 - marginRight: 8,  
1150 - position: "absolute",  
1151 - left: 20,  
1152 - top: -35,  
1153 - zIndex: 10,  
1154 - }}  
1155 - />  
1156 - ) : (  
1157 - ""  
1158 - )} 1493 + {item?.type && item?.type.includes("09") ? (
  1494 + <div>
  1495 + <div className={styles.boxInput}>
  1496 + <div className={styles.text} style={{ width: " 100%" }}>
  1497 + 层1{" "}
  1498 + </div>
  1499 + <Input
  1500 + value={item?.sLength}
  1501 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sLength")}
  1502 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1503 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1504 + readOnly={!item?.isEditable}
  1505 + style={{ width: " 80%" }}
  1506 + placeholder="长"
  1507 + />
  1508 + <Input
  1509 + value={item?.sWidth}
  1510 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sWidth")}
  1511 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1512 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1513 + readOnly={!item?.isEditable}
  1514 + style={{ width: " 80%" }}
  1515 + placeholder="宽"
  1516 + />
  1517 + </div>
  1518 + <div className={styles.boxInput}>
  1519 + <Select
  1520 + optionLabelProp="label"
  1521 + className="mySelectsDouble"
  1522 + style={{ width: 180, color: "#000" }}
  1523 + defaultValue={options.length ? options[0].value : ""}
  1524 + value={item?.sTypeName || ""}
  1525 + onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
  1526 + onDropdownVisibleChange={async open => {
  1527 + if (open) {
  1528 + props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions
  1529 + }
  1530 + }}
  1531 + >
  1532 + {!loading ? options.map(option => renderOptionWithText(option)) : ""}
  1533 + </Select>
  1534 + <Input
  1535 + value={item?.sQuantity}
  1536 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sQuantity")}
  1537 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1538 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1539 + readOnly={!item?.isEditable}
  1540 + style={{ width: " 80%" }}
  1541 + placeholder="个数"
  1542 + />
  1543 + <Input
  1544 + value={item?.sOffset}
  1545 + onChange={e => handleChange(e, findIndexBySname(item.sName), "sOffset")}
  1546 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1547 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1548 + readOnly={!item?.isEditable}
  1549 + style={{ width: " 80%" }}
  1550 + placeholder="偏移"
  1551 + />
  1552 + </div>
  1553 + <div className={styles.boxInput}>
  1554 + <div className={styles.text} style={{ width: " 100%" }}>
  1555 + 层2{" "}
  1556 + </div>
  1557 + <Input
  1558 + value={item?.cLength}
  1559 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cLength")}
  1560 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1561 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1562 + readOnly={!item?.isEditable}
  1563 + style={{ width: " 80%" }}
  1564 + placeholder="长"
  1565 + />
  1566 + <Input
  1567 + value={item?.cWidth}
  1568 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cWidth")}
  1569 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1570 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1571 + readOnly={!item?.isEditable}
  1572 + style={{ width: " 80%" }}
  1573 + placeholder="宽"
  1574 + />
  1575 + </div>
  1576 + <div className={styles.boxInput}>
  1577 + <Select
  1578 + optionLabelProp="label"
  1579 + className="mySelectsDouble"
  1580 + style={{ width: 180, color: "#000" }}
  1581 + defaultValue={options.length ? options[0].value : ""}
  1582 + value={item?.cTypeName || ""}
  1583 + onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
  1584 + onDropdownVisibleChange={async open => {
  1585 + if (open) {
  1586 + props.getSqlOptions(null); // 在下拉菜单打开时调用 getSqlOptions
  1587 + }
  1588 + }}
  1589 + >
  1590 + {!loading ? options.map(option => renderOptionWithText(option)) : ""}
  1591 + </Select>
  1592 + <Input
  1593 + value={item?.cQuantity}
  1594 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cQuantity")}
  1595 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1596 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1597 + readOnly={!item?.isEditable}
  1598 + style={{ width: " 80%" }}
  1599 + placeholder="个数"
  1600 + />
  1601 + <Input
  1602 + value={item?.cOffset}
  1603 + onChange={e => handleChange(e, findIndexBySname(item.sName), "cOffset")}
  1604 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1605 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1606 + readOnly={!item?.isEditable}
  1607 + style={{ width: " 80%" }}
  1608 + placeholder="偏移"
  1609 + />
  1610 + </div>
  1611 + </div>
  1612 + ) : (
  1613 + <div className={styles.boxInput}>
  1614 + {item?.selectImage ? (
  1615 + <img
  1616 + src={item?.selectImage}
  1617 + alt={item.value}
  1618 + style={{
  1619 + width: 40,
  1620 + height: 30,
  1621 + marginRight: 8,
  1622 + position: "absolute",
  1623 + left: 20,
  1624 + top: -35,
  1625 + zIndex: 10,
  1626 + }}
  1627 + />
  1628 + ) : (
  1629 + ""
  1630 + )}
1159 1631
1160 - <Input  
1161 - value={item?.showName}  
1162 - onChange={e => handleChangeName(e, findIndexBySname(item.sName))}  
1163 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1164 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1165 - readOnly={!item?.isEditable}  
1166 - className={styles.text}  
1167 - />  
1168 - <Input  
1169 - value={item?.value}  
1170 - onChange={e => handleChange(e, findIndexBySname(item.sName))}  
1171 - onFocus={e => handleFocus(e, findIndexBySname(item.sName))}  
1172 - onBlur={e => handleBlur(e, findIndexBySname(item.sName))}  
1173 - readOnly={!item?.isEditable}  
1174 - style={{ width: " 80%" }}  
1175 - />  
1176 - </div> 1632 + <Input
  1633 + value={item?.showName}
  1634 + onChange={e => handleChangeName(e, findIndexBySname(item.sName))}
  1635 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1636 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1637 + readOnly={!item?.isEditable}
  1638 + className={styles.text}
  1639 + />
  1640 + <Input
  1641 + value={item?.value}
  1642 + onChange={e => handleChange(e, findIndexBySname(item.sName))}
  1643 + onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
  1644 + onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
  1645 + readOnly={!item?.isEditable}
  1646 + style={{ width: " 80%" }}
  1647 + />
  1648 + </div>
  1649 + )}
1177 </div> 1650 </div>
1178 ))} 1651 ))}
1179 {boxType === "8" && 1652 {boxType === "8" &&
@@ -1238,7 +1711,7 @@ const BoxDesignCompontent = baseProps =&gt; { @@ -1238,7 +1711,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1238 </div> 1711 </div>
1239 ))} 1712 ))}
1240 </div> 1713 </div>
1241 - <div className={styles.boxBottom}> 1714 + <div className={styles.boxBottom} style={{ top: `${typesTop ? "240px" : "130px"}` }}>
1242 <div className={styles.svgBox}> 1715 <div className={styles.svgBox}>
1243 <SvgBox {...svgBoxProps} /> 1716 <SvgBox {...svgBoxProps} />
1244 </div> 1717 </div>
src/components/Common/BoxDesignCompontent/index.less
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 } 21 }
22 .boxLeft { 22 .boxLeft {
23 width: 180px; 23 width: 180px;
24 - height: 320px; 24 + min-height: 320px;
25 display: flex; 25 display: flex;
26 flex-wrap: wrap; 26 flex-wrap: wrap;
27 flex-direction: column; 27 flex-direction: column;
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 } 33 }
34 .boxRight { 34 .boxRight {
35 width: 180px; 35 width: 180px;
36 - height: 320px; 36 + min-height: 320px;
37 display: flex; 37 display: flex;
38 flex-wrap: wrap; 38 flex-wrap: wrap;
39 justify-content: space-between; 39 justify-content: space-between;
@@ -43,23 +43,23 @@ @@ -43,23 +43,23 @@
43 top: 130px; 43 top: 130px;
44 text-align: center; 44 text-align: center;
45 } 45 }
46 - .boxBottom{ 46 + .boxBottom {
47 width: 500px; 47 width: 500px;
48 height: 380px; 48 height: 380px;
49 position: absolute; 49 position: absolute;
50 top: 130px; 50 top: 130px;
51 left: 50%; 51 left: 50%;
52 transform: translateX(-50%); 52 transform: translateX(-50%);
53 - .svgBox{ 53 + .svgBox {
54 width: 100%; 54 width: 100%;
55 - height: 250px;  
56 - background-color: #9AFF9A; 55 + min-height: 250px;
  56 + background-color: #9aff9a;
57 } 57 }
58 - .content{ 58 + .content {
59 width: 100%; 59 width: 100%;
60 height: 130px; 60 height: 130px;
61 - :global{  
62 - .ant-select-selector{ 61 + :global {
  62 + .ant-select-selector {
63 // width: 380px !important; /* 选择框宽度 */ 63 // width: 380px !important; /* 选择框宽度 */
64 color: #333; 64 color: #333;
65 } 65 }
@@ -68,11 +68,10 @@ @@ -68,11 +68,10 @@
68 padding-left: 50px; 68 padding-left: 50px;
69 line-height: 40px; 69 line-height: 40px;
70 } 70 }
71 -  
72 } 71 }
73 } 72 }
74 } 73 }
75 - .boxTitle{ 74 + .boxTitle {
76 background-color: #3399ff; 75 background-color: #3399ff;
77 color: #fff; 76 color: #fff;
78 width: 180px; 77 width: 180px;
@@ -80,37 +79,45 @@ @@ -80,37 +79,45 @@
80 line-height: 20px; 79 line-height: 20px;
81 text-align: center; 80 text-align: center;
82 } 81 }
83 - :global{  
84 - .mySelects .ant-select-selector {  
85 - background-color: #99CCFF !important; /* 选择框背景色 */ 82 + :global {
  83 + .mySelects .ant-select-selector,
  84 + .mySelectsDouble .ant-select-selector {
  85 + background-color: #99ccff !important; /* 选择框背景色 */
86 height: 40px !important; /* 选择框高度 */ 86 height: 40px !important; /* 选择框高度 */
87 } 87 }
88 .mySelects .ant-select-selection-item { 88 .mySelects .ant-select-selection-item {
89 color: transparent !important; /* 选择框文字颜色 */ 89 color: transparent !important; /* 选择框文字颜色 */
90 } 90 }
91 - 91 + .mySelectsDouble .ant-select-selection-item {
  92 + color: #333 !important; /* 选择框文字颜色 */
  93 + line-height: 40px !important;
  94 +
  95 + }
92 } 96 }
93 .mySelects { 97 .mySelects {
94 position: relative; 98 position: relative;
95 } 99 }
96 - .boxInput{ 100 + .boxInput {
97 display: flex; 101 display: flex;
98 align-items: center; 102 align-items: center;
99 justify-content: space-between; 103 justify-content: space-between;
100 width: 180px; 104 width: 180px;
101 - height: 40px; 105 + // height: 40px;
  106 + min-height: 40px;
102 position: relative; 107 position: relative;
103 :global { 108 :global {
104 .ant-input { 109 .ant-input {
105 - background-color: #99CCFF !important; /* 输入框背景色 */ 110 + background-color: #99ccff !important; /* 输入框背景色 */
106 border: 1px solid #d9d9d9; 111 border: 1px solid #d9d9d9;
107 height: 40px; 112 height: 40px;
108 } 113 }
109 - 114 + .ant-input::placeholder {
  115 + color: #fff !important; // 修改为你想要的颜色
  116 + }
110 } 117 }
111 } 118 }
112 - .text{  
113 - background-color: #99CCFF; 119 + .text {
  120 + background-color: #99ccff;
114 width: 100%; 121 width: 100%;
115 height: 40px; 122 height: 40px;
116 line-height: 40px; 123 line-height: 40px;
@@ -119,19 +126,18 @@ @@ -119,19 +126,18 @@
119 margin-right: 1px; 126 margin-right: 1px;
120 } 127 }
121 .content { 128 .content {
122 - :global{ 129 + :global {
123 .ant-input { 130 .ant-input {
124 - background-color: #EEEEEE !important; /* 输入框背景色 */ 131 + background-color: #eeeeee !important; /* 输入框背景色 */
125 height: 40px; 132 height: 40px;
126 } 133 }
127 .ant-select-selector { 134 .ant-select-selector {
128 - background-color: #EEEEEE !important; /* 选择框背景色 */ 135 + background-color: #eeeeee !important; /* 选择框背景色 */
129 height: 40px !important; /* 选择框高度 */ 136 height: 40px !important; /* 选择框高度 */
130 } 137 }
131 -  
132 } 138 }
133 - .text{  
134 - background-color: #EEEEEE ; 139 + .text {
  140 + background-color: #eeeeee;
135 margin: 0; 141 margin: 0;
136 } 142 }
137 .boxFlex { 143 .boxFlex {
@@ -141,33 +147,33 @@ @@ -141,33 +147,33 @@
141 flex-direction: column; 147 flex-direction: column;
142 width: 500px; 148 width: 500px;
143 } 149 }
144 - .boxFlexs{ 150 + .boxFlexs {
145 display: flex; 151 display: flex;
146 align-items: center; 152 align-items: center;
147 width: 500px; 153 width: 500px;
148 justify-content: space-between; 154 justify-content: space-between;
149 - .boxInputs{ 155 + .boxInputs {
150 display: flex; 156 display: flex;
151 align-items: center; 157 align-items: center;
152 flex: 1; 158 flex: 1;
153 - :global{ 159 + :global {
154 .ant-input { 160 .ant-input {
155 - background-color: #EEEEEE !important; /* 输入框背景色 */ 161 + background-color: #eeeeee !important; /* 输入框背景色 */
156 height: 40px; 162 height: 40px;
157 } 163 }
158 } 164 }
159 } 165 }
160 } 166 }
161 - .boxInput{ 167 + .boxInput {
162 width: 100%; 168 width: 100%;
163 position: relative; 169 position: relative;
164 - .defaultValue{ 170 + .defaultValue {
165 position: absolute; 171 position: absolute;
166 left: 32%; 172 left: 32%;
167 top: 3px; 173 top: 3px;
168 width: 60px; 174 width: 60px;
169 height: 30px; 175 height: 30px;
170 - background-color: #EEE; 176 + background-color: #eee;
171 color: #333; 177 color: #333;
172 line-height: 40px; 178 line-height: 40px;
173 z-index: 2; 179 z-index: 2;
src/components/Common/BoxDesignCompontent/svg.js
@@ -606,30 +606,44 @@ const SvgBox = props =&gt; { @@ -606,30 +606,44 @@ const SvgBox = props =&gt; {
606 pathList.push(createText(scaledWidth * 2 + scaledHeight * 2 + dYTBW * 0.4, scaledDeep / 2, 10 * scales, dYTBW)); 606 pathList.push(createText(scaledWidth * 2 + scaledHeight * 2 + dYTBW * 0.4, scaledDeep / 2, 10 * scales, dYTBW));
607 } 607 }
608 // 左上部件 608 // 左上部件
609 - pathList.push(createDynamicTopLeft(zsbj?.type, scaledWidth, -scaledHeight, -dZSCW * scale, 0, 0));  
610 - if ((zsbj?.type === "3001" && zsbj?.value) || (zsbj?.type === "3006" && zsbj?.value) || (zsbj?.type === "3007" && zsbj?.value)) {  
611 - pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.2, -scaledHeight / 2, scales));  
612 - pathList.push(createText(scaledWidth * 0.2 + 10 * scales, -scaledHeight / 2, 10 * scales, "W"));  
613 - // 插位值  
614 - pathList.push(createText(scaledWidth / 2, -scaledHeight - dZSCW / 2 + 4, 10 * scales, dZSCW));  
615 - } else if (zsbj?.type === "3002" && dZSCW) {  
616 - pathList.push(createText(scaledWidth / 2, -dZSCW / 2 + 4, 10 * scales, dZSCW));  
617 - } else if (zsbj?.type === "3003" && dZSCW) {  
618 - pathList.push(createText(scaledWidth / 2, -dZSCW / 2 + 4, 10 * scales, dZSCW));  
619 - } else if (zsbj?.type === "3004" && zsbj?.value) {  
620 - pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.2, -scaledHeight / 2, scales));  
621 - pathList.push(createText(scaledWidth * 0.2 + 10 * scales, -scaledHeight / 2, 10 * scales, "W"));  
622 - pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.85, -(scaledHeight + scaledHeight / 2), scales));  
623 - pathList.push(createText(scaledWidth * 0.85 + 10 * scales, -(scaledHeight + scaledHeight / 2), 10 * scales, "W"));  
624 - pathList.push(createText(scaledWidth * 0.3, -(scaledHeight * 2) - dZSCW / 2 + 4, 10 * scales, dZSCW));  
625 - } else if (zsbj?.type === "3005" && zsbj?.value) {  
626 - pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.1, -scaledHeight / 2, scales));  
627 - pathList.push(createText(scaledWidth * 0.1 + 10 * scales, -scaledHeight / 2, 10 * scales, "W"));  
628 - pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.8, -(scaledHeight + scaledHeight / 2), scales));  
629 - pathList.push(createText(scaledWidth * 0.8 + 10 * scales, -(scaledHeight + scaledHeight / 2), 10 * scales, "W"));  
630 - } else if (zsbj?.type && dZSCW) {  
631 - pathList.push(createText(scaledWidth / 2, -dZSCW / 2 + 4, 10 * scales, dZSCW)); 609 + if (zsbj?.type && zsbj?.type === "3009") {
  610 + console.log(zsbj, boxList, "zsbj");
  611 + // 先放层1的盒型
  612 + const { sType, sLength, sWidth, sOffset, sQuantity, cType, cLength, cWidth, cOffset, cQuantity } = zsbj;
  613 + if (Number(sType) === 0) {
  614 + const rectangles = [{ x: -sLength * scale, y: ((scaledDeep - (Number(sWidth) * scale)) / 2) + Number(sOffset), width: sLength * scale, height: sWidth * scale }];
  615 + rectangles.forEach(rect => {
  616 + g.appendChild(createPathElements(rect.x, rect.y, rect.width, rect.height));
  617 + });
  618 + svg.appendChild(g);
  619 + }
  620 + } else {
  621 + pathList.push(createDynamicTopLeft(zsbj?.type, scaledWidth, -scaledHeight, -dZSCW * scale, 0, 0));
  622 + if ((zsbj?.type === "3001" && zsbj?.value) || (zsbj?.type === "3006" && zsbj?.value) || (zsbj?.type === "3007" && zsbj?.value)) {
  623 + pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.2, -scaledHeight / 2, scales));
  624 + pathList.push(createText(scaledWidth * 0.2 + 10 * scales, -scaledHeight / 2, 10 * scales, "W"));
  625 + // 插位值
  626 + pathList.push(createText(scaledWidth / 2, -scaledHeight - dZSCW / 2 + 4, 10 * scales, dZSCW));
  627 + } else if (zsbj?.type === "3002" && dZSCW) {
  628 + pathList.push(createText(scaledWidth / 2, -dZSCW / 2 + 4, 10 * scales, dZSCW));
  629 + } else if (zsbj?.type === "3003" && dZSCW) {
  630 + pathList.push(createText(scaledWidth / 2, -dZSCW / 2 + 4, 10 * scales, dZSCW));
  631 + } else if (zsbj?.type === "3004" && zsbj?.value) {
  632 + pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.2, -scaledHeight / 2, scales));
  633 + pathList.push(createText(scaledWidth * 0.2 + 10 * scales, -scaledHeight / 2, 10 * scales, "W"));
  634 + pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.85, -(scaledHeight + scaledHeight / 2), scales));
  635 + pathList.push(createText(scaledWidth * 0.85 + 10 * scales, -(scaledHeight + scaledHeight / 2), 10 * scales, "W"));
  636 + pathList.push(createText(scaledWidth * 0.3, -(scaledHeight * 2) - dZSCW / 2 + 4, 10 * scales, dZSCW));
  637 + } else if (zsbj?.type === "3005" && zsbj?.value) {
  638 + pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.1, -scaledHeight / 2, scales));
  639 + pathList.push(createText(scaledWidth * 0.1 + 10 * scales, -scaledHeight / 2, 10 * scales, "W"));
  640 + pathList.push(createDoubleArrow(scaledHeight, scaledWidth * 0.8, -(scaledHeight + scaledHeight / 2), scales));
  641 + pathList.push(createText(scaledWidth * 0.8 + 10 * scales, -(scaledHeight + scaledHeight / 2), 10 * scales, "W"));
  642 + } else if (zsbj?.type && dZSCW) {
  643 + pathList.push(createText(scaledWidth / 2, -dZSCW / 2 + 4, 10 * scales, dZSCW));
  644 + }
632 } 645 }
  646 +
633 // 右上部件 647 // 右上部件
634 pathList.push(createDynamicTopLeft(ysbj?.type, scaledWidth, -scaledHeight, -dYSCW * scale, scaledWidth + scaledHeight, 0)); 648 pathList.push(createDynamicTopLeft(ysbj?.type, scaledWidth, -scaledHeight, -dYSCW * scale, scaledWidth + scaledHeight, 0));
635 if ((ysbj?.type === "6001" && ysbj?.value) || (ysbj?.type === "6006" && ysbj?.value) || (ysbj?.type === "6007" && ysbj?.value)) { 649 if ((ysbj?.type === "6001" && ysbj?.value) || (ysbj?.type === "6006" && ysbj?.value) || (ysbj?.type === "6007" && ysbj?.value)) {
@@ -1425,10 +1439,12 @@ const SvgBox = props =&gt; { @@ -1425,10 +1439,12 @@ const SvgBox = props =&gt; {
1425 pathList.push(createText(scaleHeadWidth / 2, scaleHeadLength * 0.3 + 10 * scales, 10 * scales, "dSHC")); 1439 pathList.push(createText(scaleHeadWidth / 2, scaleHeadLength * 0.3 + 10 * scales, 10 * scales, "dSHC"));
1426 } 1440 }
1427 if (scaleOrderLength && scaleOrderWidth) { 1441 if (scaleOrderLength && scaleOrderWidth) {
1428 - pathList.push(createDoubleArrow(scaleOrderWidth, scaleOrderLength * 0.6 - (leftOffect ), scaleHeadWidth + scaleOrderWidth / 2, scales));  
1429 - pathList.push(createText(scaleOrderLength * 0.8 - 10 * scales - (leftOffect ), scaleHeadWidth + scaleOrderWidth / 2, 10 * scales, "dCHK"));  
1430 - pathList.push(createHorizontalDoubleArrow(scaleOrderLength, scaleOrderLength / 2 - (leftOffect ), scaleHeadWidth + scaleOrderWidth * 0.7, scales));  
1431 - pathList.push(createText(scaleOrderWidth / 2 - (leftOffect ), scaleHeadWidth + scaleOrderLength * 0.8 * scales, 10 * scales, "dCHC")); 1442 + pathList.push(createDoubleArrow(scaleOrderWidth, scaleOrderLength * 0.6 - leftOffect, scaleHeadWidth + scaleOrderWidth / 2, scales));
  1443 + pathList.push(createText(scaleOrderLength * 0.8 - 10 * scales - leftOffect, scaleHeadWidth + scaleOrderWidth / 2, 10 * scales, "dCHK"));
  1444 + pathList.push(
  1445 + createHorizontalDoubleArrow(scaleOrderLength, scaleOrderLength / 2 - leftOffect, scaleHeadWidth + scaleOrderWidth * 0.7, scales)
  1446 + );
  1447 + pathList.push(createText(scaleOrderWidth / 2 - leftOffect, scaleHeadWidth + scaleOrderLength * 0.8 * scales, 10 * scales, "dCHC"));
1432 } 1448 }
1433 1449
1434 pathList.forEach(x => { 1450 pathList.forEach(x => {