Commit 91ec52e25138454ffc776eac2a6ae21495642fc5

Authored by 陈鑫涛
1 parent af31c58f

功能页面拖拽排序

src/components/Common/BoxDesignCompontent/index.js
... ... @@ -22,18 +22,22 @@ const BoxDesignEvent = props => {
22 22 setLoading(true);
23 23 if (!type) {
24 24 setLoading(false);
  25 + if (!tableData?.length) return
  26 + const shape = tableData?.find(x => x.iTag === 70)?.showDropDown
  27 + const JsonShape = JSON.parse(shape)
  28 + const arr = Array.from(Object.values(JsonShape));
25 29 setOptions([
26 30 {
27 31 sId: "0",
28 32 sCode: "0",
29   - sName: "矩形",
  33 + sName: arr[0],
30 34 sMakeUpPath: "",
31 35 sTypes: "0",
32 36 },
33 37 {
34 38 sId: "1",
35 39 sCode: "1",
36   - sName: "梯形",
  40 + sName: arr[1],
37 41 sMakeUpPath: "",
38 42 sTypes: "1",
39 43 },
... ... @@ -89,7 +93,7 @@ const BoxDesignEvent = props => {
89 93 };
90 94 const BoxDesignCompontent = baseProps => {
91 95 const props = BoxDesignEvent(baseProps);
92   - const { onCancel, onOk, title, loading, masterConfig, bFullScreen, tableData, options = [] } = props;
  96 + const { onCancel, onOk, title, loading, masterConfig, bFullScreen, tableData = [], options = [] } = props;
93 97 const { slaveData = {}, masterData = {} } = props.state;
94 98 const { boxVisible } = baseProps;
95 99 const [boxList, setBoxList] = useState([]);
... ... @@ -106,18 +110,15 @@ const BoxDesignCompontent = baseProps => {
106 110 const [rightDoubleBoxList, setRightDoubleBoxList] = useState([]);
107 111 const [boxKey, setBoxKey] = useState(new Date().getTime());
108 112 const [doubleLayerList, setDoubleLayerList] = useState([]);
109   - if (!boxVisible) return "";
110   - const isEnglish = (str) => {
111   - return /^[A-Za-z]+$/.test(str);
112   - }
113   - // 1️⃣ 只负责 tableColum
  113 + const [shapeList, setShapeList] = useState([])
  114 + const [doublePrompt, setDoublePrompt] = useState([])
  115 +
  116 + // if (!boxVisible) return "";
  117 + // 1️⃣ 只负责 tableColum 盒型名称
114 118 useEffect(() => {
115 119 if (!tableData?.length) return;
116   - const keywords = ["盒长", "盒高", "盒宽", "盒身","Box Length", "Box Width", "Box Height","Box Body"];
117   - // 判断是否是英文
118   - // isEnglish(item.showName) ? item.sEnglish : item.sChinese
119 120 const newTableColum = tableData
120   - .filter(item => item.bVisible) // 先过滤可见
  121 + .filter(item => item.bVisible).filter(item => item.iTag === 10) // 先过滤可见
121 122 .map(item => ({
122 123 ...item,
123 124 isEditable: true,
... ... @@ -125,32 +126,14 @@ const BoxDesignCompontent = baseProps => {
125 126 selectImage: null,
126 127 value: "",
127 128 }))
128   - .filter(
129   - item =>
130   - !keywords.some(keyword => item.showName.includes(keyword))
131   - )
132   - .map(item => {
133   - if (item.showName === '盒型类别') {
134   - return { ...item, showName: '盒型名称' };
135   - }
136   - if (item.showName.trim() === 'Box Type Category') {
137   - return { ...item, showName: 'Box Name' };
138   - }
139   - return item;
140   - }
141   - );
142   -
143 129 setTableColum(newTableColum);
144   - }, [tableData]);
  130 + }, [tableData.length]);
145 131  
146   - // 2️⃣ 只负责 boxBodyList
  132 + // 2️⃣ 只负责 boxBodyList 盒身
147 133 useEffect(() => {
148 134 if (!tableData?.length) return;
149   -
150   - const keywords = ['盒身', 'Box Body'];
151   -
152 135 const bodyList = tableData
153   - .filter(item => item.bVisible)
  136 + .filter(item => item.bVisible).filter(item => item.iTag === 20)
154 137 .map(item => ({
155 138 ...item,
156 139 isEditable: true,
... ... @@ -158,17 +141,14 @@ const BoxDesignCompontent = baseProps => {
158 141 selectImage: null,
159 142 value: '',
160 143 }))
161   - .filter(item =>
162   - keywords.some(k => item.showName.trim().includes(k))
163   - );
164   -
165 144 setBoxBodyList(bodyList);
166   - }, [tableData]);
  145 + }, [tableData.length]);
167 146  
168 147 // 3️⃣ 只负责 tableDataList 和 tableDataLists
  148 +
169 149 useEffect(() => {
170 150 if (!tableData?.length) return;
171   - const keywords = ["盒长", "盒高", "盒宽", "Box Length", "Box Width", "Box Height"];
  151 + // const keywords = ["盒长", "盒高", "盒宽", "Box Length", "Box Width", "Box Height"];
172 152 const keywordMap = {
173 153 '盒长': 'L',
174 154 '盒宽': 'W',
... ... @@ -179,28 +159,44 @@ const BoxDesignCompontent = baseProps => {
179 159 };
180 160  
181 161 const newList = tableData
182   - .filter(item => item.bVisible)
  162 + .filter(item => item.bVisible).filter(item => item.iTag === 30)
183 163 .map(item => ({
184 164 ...item,
185 165 isEditable: true,
186 166 isSelect: false,
187 167 selectImage: null,
188 168 value: "",
189   - }))
190   - .filter(item =>
191   - keywords.some(keyword => item.showName.includes(keyword))
192   - )
193   - .map(item => {
194   - const hitKey = keywords.find(k => item.showName.includes(k));
  169 + })).map(item => {
195 170 // 拼出新名字:原始关键字 + (后缀)
196   - const sName = hitKey
197   - ? `${hitKey} (${keywordMap[hitKey]})`
198   - : item.showName; // 兜底,理论上不会发生
  171 + const sName = `${item.showName} (${keywordMap[item.showName?.trim()]})`
199 172 return { ...item, sName };
200 173 });
201 174 setTableDataList(newList);
202 175 setTableDataLists(newList);
203   - }, [tableData]);
  176 + const shape = tableData.find(x => x.iTag === 70)?.showDropDown
  177 + if (!shape) return
  178 + const JsonShape = JSON.parse(shape)
  179 + const shapeLists = Array.from(Object.values(JsonShape))
  180 + setShapeList(shapeLists)
  181 + const prompt = tableData.filter(x => x.iTag === 80)
  182 + setDoublePrompt(prompt)
  183 + }, [tableData.length]);
  184 +
  185 + // 获取itag为40的数据
  186 + const upViewPropsAll = Array.isArray(tableData)
  187 + ? tableData
  188 + .filter(item => item.bVisible)
  189 + .filter(item => [40, 50, 60].includes(item.iTag))
  190 + : [];
  191 + let titleListConfiguration = upViewPropsAll?.map(item => {
  192 + return item.showName
  193 + })
  194 + const btnName = Array.isArray(tableData)
  195 + ? tableData
  196 + .filter(item => item.bVisible) // 过滤出可见的项目
  197 + .find(item => [11].includes(item.iTag))?.showName || ''
  198 + : '';
  199 +
204 200 const titleList = [
205 201 "上方盒舌",
206 202 "盒底组件",
... ... @@ -211,7 +207,7 @@ const BoxDesignCompontent = baseProps => {
211 207 "右(上)插位组件",
212 208 "右贴边位",
213 209 "右(下)插位组件",
214   - ];
  210 + ]
215 211 const titleList1 = [
216 212 { name: "上方盒舌", value: "dSFHS" },
217 213 { name: "盒底组件", value: "dHDC" },
... ... @@ -223,6 +219,12 @@ const BoxDesignCompontent = baseProps => {
223 219 { name: "右贴边位", value: "dYTBW" },
224 220 { name: "右(下)插位组件", value: "dYXCW" },
225 221 ];
  222 + // const titleList1 = upViewPropsAll?.map(item=>{
  223 + // return {
  224 + // name:item.showName,
  225 + // value:item.sName
  226 + // }
  227 + // })
226 228 const doubleTitlieList = [
227 229 "左上插位组件",
228 230 "上插位组件",
... ... @@ -275,7 +277,7 @@ const BoxDesignCompontent = baseProps => {
275 277 selectImage: null,
276 278 type: null,
277 279 show: true,
278   - showName: item, // 参数名称
  280 + showName: upViewPropsAll?.find(x => x.sName === titleList1.find(x => x.name === item)?.value)?.showName, // 参数名称
279 281 sAssignFormula: null,
280 282 sLength: null,
281 283 sWidth: null,
... ... @@ -289,10 +291,11 @@ const BoxDesignCompontent = baseProps => {
289 291 cTypeName: null, // 盒型名称
290 292 cOffset: null, // 偏移
291 293 cQuantity: null, // 数量
  294 + sCode: titleList1.find(x => x.name === item)?.value,
  295 + showNames: upViewPropsAll?.find(x => x.sName === titleList1.find(x => x.name === item)?.value)?.showName
292 296 });
293 297 });
294 298 // 部件信息
295   -
296 299 const boxTypes = masterData.sTypes;
297 300 if (slaveData && slaveData.length) {
298 301 if (boxTypes !== "8") {
... ... @@ -302,27 +305,31 @@ const BoxDesignCompontent = baseProps => {
302 305 });
303 306 if (i !== -1) {
304 307 const x = newBoxList.findIndex(z => z.sName === titleList1[i].name);
305   - Object.assign(newBoxList[x], {
306   - value: item.iValue,
307   - type: item.sTypes,
308   - showName: item.sName,
309   - selectImage: item.sMakeUpPath,
310   - sName: titleList1[i].name,
311   - sAssignFormula: item.sAssignFormula,
312   - bVisible: item.bVisible,
313   - sLength: item.iSLength,
314   - sWidth: item.iSWidth,
315   - sType: item.iSType,
316   - sTypeName: item.iSType !== null ? (Number(item.iSType) === 0 ? "矩形" : Number(item.iSType) === 1 ? "梯形" : null) : null,
317   - sOffset: item.sSOffset,
318   - sQuantity: item.iSQuantity,
319   - cLength: item.iCLength,
320   - cWidth: item.iCWidth,
321   - cType: item.iCType,
322   - cTypeName: item.iCType !== null ? (Number(item.iCType) === 0 ? "矩形" : Number(item.iCType) === 1 ? "梯形" : null) : null,
323   - cOffset: item.sCOffset,
324   - cQuantity: item.iCQuantity,
325   - });
  308 + if (x !== -1) {
  309 + Object.assign(newBoxList[x], {
  310 + value: item.iValue,
  311 + type: item.sTypes,
  312 + showName: item.sName,
  313 + selectImage: item.sMakeUpPath,
  314 + sName: titleList1[i].name,
  315 + sAssignFormula: item.sAssignFormula,
  316 + bVisible: item.bVisible,
  317 + sLength: item.iSLength,
  318 + sWidth: item.iSWidth,
  319 + sType: item.iSType,
  320 + sTypeName: item.iSType !== null ? shapeList[item.iSType] : null,
  321 + sOffset: item.sSOffset,
  322 + sQuantity: item.iSQuantity,
  323 + cLength: item.iCLength,
  324 + cWidth: item.iCWidth,
  325 + cType: item.iCType,
  326 + cTypeName: item.iCType !== null ? shapeList[item.iCType] : null,
  327 + cOffset: item.sCOffset,
  328 + cQuantity: item.iCQuantity,
  329 + showNames: upViewPropsAll?.find(x => x.sName === item.sCode)?.showName
  330 + });
  331 + }
  332 +
326 333 }
327 334 });
328 335 } else {
... ... @@ -351,17 +358,17 @@ const BoxDesignCompontent = baseProps => {
351 358 const orderLength = slaveData.find(item => item.sCode === "dCHC")?.iValue;
352 359 const orderWidth = slaveData.find(item => item.sCode === "dCHK")?.iValue;
353 360 newBoxList.forEach((item, index) => {
354   - if (item.sName.trim() === "盒身" || item.sName.trim() === "Box Body") {
  361 + if (item.sName?.trim() === "盒身" || item.sName?.trim() === "Box Body") {
355 362 newBoxList[index].value = masterData.sBoxBody;
356 363 newBoxList[index].selectImage = masterData.sMakeUpPath;
357 364 newBoxList[index].type = masterData.sTypes;
358   - } else if (item.sName.trim() === "盒长" || item.sName.trim() === "Box Length") {
  365 + } else if (item.sName?.trim() === "盒长" || item.sName?.trim() === "Box Length") {
359 366 newBoxList[index].value = masterData.dBoxLength;
360   - } else if (item.sName.trim() === "盒宽" || item.sName.trim() === "Box Width") {
  367 + } else if (item.sName?.trim() === "盒宽" || item.sName?.trim() === "Box Width") {
361 368 newBoxList[index].value = masterData.dBoxWidth;
362   - } else if (item.sName.trim() === "盒高" || item.sName.trim() === "Box Height") {
  369 + } else if (item.sName?.trim() === "盒高" || item.sName?.trim() === "Box Height") {
363 370 newBoxList[index].value = masterData.dBoxHeight;
364   - } else if (item.sName === "盒型名称" || item.sName.trim() === "Box Name") {
  371 + } else if (item.sName === "盒型名称" || item.sName?.trim() === "Box Name") {
365 372 newBoxList[index].value = masterData.sName;
366 373 } else if (item.sName === "首盒长") {
367 374 newBoxList[index].value = headLength;
... ... @@ -386,7 +393,7 @@ const BoxDesignCompontent = baseProps => {
386 393 return arr1.every((item, index) => item.sName === arr2[index].sName);
387 394 };
388 395 useEffect(() => {
389   - const type = boxList.find(item => item.sName === "盒身")?.type;
  396 + const type = boxList.find(item => item.sName === boxBodyList[0]?.showName)?.type;
390 397 const updateLists = () => {
391 398 const topBoxFilter = item => item.sName === "上方盒舌" || item.sName === "盒底组件" || item.sName === "下方盒舌";
392 399  
... ... @@ -452,7 +459,7 @@ const BoxDesignCompontent = baseProps => {
452 459  
453 460 updateLists();
454 461 }, [boxList]);
455   - const boxType = boxList.find(item => item.sName === "盒身")?.type;
  462 + const boxType = boxList.find(item => item.sName === boxBodyList[0]?.showName)?.type;
456 463 // 监听盒身类型
457 464 useEffect(() => {
458 465 if (!boxType) return;
... ... @@ -552,10 +559,10 @@ const BoxDesignCompontent = baseProps => {
552 559 const handleSelects = (name, selectConfig, index, type, doubleType) => {
553 560 let updatedBoxList = [...boxList];
554 561 if (doubleType === 0) {
555   - updatedBoxList[index].sTypeName = Number(name) === 0 ? "矩形" : "梯形";
  562 + updatedBoxList[index].sTypeName = shapeList[Number(name)];
556 563 updatedBoxList[index].sType = Number(name)
557 564 } else {
558   - updatedBoxList[index].cTypeName = Number(name) === 0 ? "矩形" : "梯形";
  565 + updatedBoxList[index].cTypeName = shapeList[Number(name)];
559 566 updatedBoxList[index].cType = Number(name)
560 567 }
561 568 setBoxList(updatedBoxList);
... ... @@ -603,6 +610,9 @@ const BoxDesignCompontent = baseProps => {
603 610 ...props,
604 611 boxList,
605 612 showNew: 0,
  613 + tableColum,
  614 + boxBodyList,
  615 + tableDataList
606 616 // dSvgBoxWidth: 500,
607 617 // dSvgBoxHeight: 250,
608 618 };
... ... @@ -617,7 +627,7 @@ const BoxDesignCompontent = baseProps => {
617 627 // 判断是新增还是修改
618 628  
619 629 // 存储子表数据
620   - const boxTypes = boxList.find(item => item.sName === "盒身" || item.sName.trim() === 'Box Body')?.type;
  630 + const boxTypes = boxList.find(item => item.sName === boxBodyList[0]?.showName)?.type;
621 631 const findList = boxTypes === "8" ? doubleTitlieList1 : titleList1;
622 632 boxList.forEach((item, index) => {
623 633 const i = findList.findIndex(i => i.name === item.sName);
... ... @@ -640,13 +650,13 @@ const BoxDesignCompontent = baseProps => {
640 650 iSLength: !item.sLength ? 0 : item.sLength,
641 651 iSWidth: !item.sWidth ? 0 : item.sWidth,
642 652 iSType: !item.sType ? 0 : item.sType,
643   - iSTypeName: item.sType !== null ? (Number(item.sType) === 0 ? "矩形" : Number(item.sType) === 1 ? "梯形" : null) : null,
  653 + iSTypeName: item.sType !== null ? shapeList[item.iSType] : null,
644 654 sSOffset: !item.sOffset ? 0 : item.sOffset,
645 655 iSQuantity: !item.sQuantity ? 0 : item.sQuantity,
646 656 iCLength: !item.cLength ? 0 : item.cLength,
647 657 iCWidth: !item.cWidth ? 0 : item.cWidth,
648 658 iCType: !item.cType ? 0 : item.cType,
649   - iCTypeName: item.cType !== null ? (Number(item.cType) === 0 ? "矩形" : Number(item.cType) === 1 ? "梯形" : null) : null,
  659 + iCTypeName: item.cType !== null ? shapeList[item.iCType] : null,
650 660 sCOffset: !item.cOffset ? 0 : item.cOffset,
651 661 iCQuantity: !item.cQuantity ? 0 : item.cQuantity,
652 662 };
... ... @@ -668,12 +678,12 @@ const BoxDesignCompontent = baseProps => {
668 678 // 计算展长公式 sLengthFormula
669 679 let sLengthFormula = "";
670 680 let sWidthFormula = "";
671   - const boxType = boxList.find(item => item.sName === "盒身"|| item.sName.trim() === "Box Body")?.type;
  681 + const boxType = boxList.find(item => item.sName === boxBodyList[0]?.showName)?.type;
672 682 if (boxType === "8") {
673 683 } else {
674   - const boxLength = Number(boxList.find(item => item.sName === "盒长"|| item.sName.trim() === "Box Length")?.value);
675   - const boxWidth = Number(boxList.find(item => item.sName === "盒宽"|| item.sName.trim() === "Box Width")?.value);
676   - const boxHeight = Number(boxList.find(item => item.sName === "盒高"|| item.sName.trim() === "Box Height")?.value);
  684 + const boxLength = Number(boxList.find(item => item.sName === "盒长" || item.sName?.trim() === "Box Length")?.value);
  685 + const boxWidth = Number(boxList.find(item => item.sName === "盒宽" || item.sName?.trim() === "Box Width")?.value);
  686 + const boxHeight = Number(boxList.find(item => item.sName === "盒高" || item.sName?.trim() === "Box Height")?.value);
677 687 const zxcw = boxList.find(x => x.sName === "左(下)插位组件");
678 688 const zscw = boxList.find(x => x.sName === "左(上)插位组件");
679 689 const yscw = boxList.find(x => x.sName === "右(上)插位组件");
... ... @@ -994,15 +1004,16 @@ const BoxDesignCompontent = baseProps => {
994 1004  
995 1005 // const sDoubleSize = JSON.stringify([headLength,headWidth,orderLength,orderWidth])
996 1006 // 存储盒身数据 主表
  1007 + // boxList.find(item => item.sName === boxBodyList[0]?.showName)?.type;
997 1008 const newMasterData = {
998 1009 ...masterData,
999   - sBoxBody: boxList.find(item => item.sName === "盒身" || item.sName.trim() === "Box Body")?.value || "",
1000   - dBoxLength: boxList.find(item => item.sName === "盒长" || item.sName.trim() === "Box Length")?.value || "",
1001   - dBoxWidth: boxList.find(item => item.sName === "盒宽" || item.sName.trim() === "Box Width")?.value || "",
1002   - dBoxHeight: boxList.find(item => item.sName === "盒高" || item.sName.trim() === "Box Height")?.value || "",
1003   - sName: boxList.find(item => item.sName === "盒型名称" || item.sName.trim() === "Box Name")?.value || "",
1004   - sMakeUpPath: boxList.find(item => item.sName === "盒身" || item.sName.trim() === "Box Body") ?.selectImage || "",
1005   - sTypes: boxList.find(item => item.sName === "盒身" || item.sName.trim() === "Box Body")?.type || "",
  1010 + sBoxBody: boxList.find(item => item.sName.trim() === boxBodyList[0]?.showName)?.value || "",
  1011 + dBoxLength: boxList.find(item => item.sName?.trim() === tableDataList[0].showName)?.value || "",
  1012 + dBoxWidth: boxList.find(item => item.sName?.trim() === tableDataList[1].showName)?.value || "",
  1013 + dBoxHeight: boxList.find(item => item.sName?.trim() === tableDataList[2].showName)?.value || "",
  1014 + sName: boxList.find(item => item.sName?.trim() === tableColum[0].showName)?.value || "",
  1015 + sMakeUpPath: boxList.find(item => item.sName === boxBodyList[0]?.showName)?.selectImage || "",
  1016 + sTypes: boxList.find(item => item.sName.trim() === boxBodyList[0]?.showName)?.type || "",
1006 1017 sLengthFormula: masterData.sLengthFormula || sLengthFormula,
1007 1018 sWidthFormula: masterData.sWidthFormula || sWidthFormula,
1008 1019 };
... ... @@ -1041,7 +1052,7 @@ const BoxDesignCompontent = baseProps => {
1041 1052 title={title}
1042 1053 visible={boxVisible}
1043 1054 onCancel={onCancel}
1044   - okText="创建"
  1055 + okText={btnName}
1045 1056 onOk={submit}
1046 1057 bodyStyle={{
1047 1058 height: "calc(95vh - 105px)",
... ... @@ -1060,7 +1071,7 @@ const BoxDesignCompontent = baseProps => {
1060 1071 {boxType !== "8" &&
1061 1072 topBoxList.map((topItem, index) => (
1062 1073 <div key={index} className={styles.boxFlex} style={{ display: topItem.show ? "block" : "none" }}>
1063   - <div className={styles.boxTitle}>{topItem.sName}</div>
  1074 + <div className={styles.boxTitle}>{topItem.showNames}</div>
1064 1075 {topItem?.selectImage ? (
1065 1076 <img
1066 1077 // src={topItem?.selectImage}
... ... @@ -1075,7 +1086,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1075 1086 <Select
1076 1087 optionLabelProp="label"
1077 1088 className="mySelects"
1078   - style={{ width: 180 ,height:'100%'}}
  1089 + style={{ width: 180 }}
1079 1090 defaultValue={options.length ? options[0].value : ""}
1080 1091 onSelect={(value, option) => handleSelect(value, option, index, 0)}
1081 1092 onDropdownVisibleChange={async open => {
... ... @@ -1089,8 +1100,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1089 1100 {topItem.type && topItem.type.includes("09") ? (
1090 1101 <div>
1091 1102 <div className={styles.boxInput}>
1092   - <div className={styles.text} style={{ width: " 100%" }}>
1093   - 层1{" "}
  1103 + <div className={styles.text} style={{ width: 61 }}>
  1104 + {doublePrompt[0].showName}
1094 1105 </div>
1095 1106 <Input
1096 1107 value={topItem?.sLength}
... ... @@ -1098,8 +1109,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1098 1109 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1099 1110 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1100 1111 readOnly={!topItem?.isEditable}
1101   - style={{ width: " 80%" }}
1102   - placeholder="长"
  1112 + style={{ width: 60 }}
  1113 + placeholder={doublePrompt[2].showName}
1103 1114 />
1104 1115 <Input
1105 1116 value={topItem?.sWidth}
... ... @@ -1107,15 +1118,15 @@ const BoxDesignCompontent = baseProps =&gt; {
1107 1118 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1108 1119 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1109 1120 readOnly={!topItem?.isEditable}
1110   - style={{ width: " 80%" }}
1111   - placeholder="宽"
  1121 + style={{ width: 60 }}
  1122 + placeholder={doublePrompt[3].showName}
1112 1123 />
1113 1124 </div>
1114 1125 <div className={styles.boxInput}>
1115 1126 <Select
1116 1127 optionLabelProp="label"
1117 1128 className="mySelectsDouble"
1118   - style={{ width: 180, color: "#000",height:'100%' }}
  1129 + style={{ width: 60.8, color: "#000" }}
1119 1130 defaultValue={options.length ? options[0].value : ""}
1120 1131 value={topItem?.sTypeName || ""}
1121 1132 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 0)}
... ... @@ -1133,8 +1144,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1133 1144 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1134 1145 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1135 1146 readOnly={!topItem?.isEditable}
1136   - style={{ width: " 80%" }}
1137   - placeholder="个数"
  1147 + style={{ width: 60 }}
  1148 + placeholder={doublePrompt[4].showName}
1138 1149 />
1139 1150 <Input
1140 1151 value={topItem?.sOffset}
... ... @@ -1142,13 +1153,13 @@ const BoxDesignCompontent = baseProps =&gt; {
1142 1153 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1143 1154 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1144 1155 readOnly={!topItem?.isEditable}
1145   - style={{ width: " 80%" }}
1146   - placeholder="偏移"
  1156 + style={{ width: 60 }}
  1157 + placeholder={doublePrompt[5].showName}
1147 1158 />
1148 1159 </div>
1149 1160 <div className={styles.boxInput}>
1150   - <div className={styles.text} style={{ width: " 100%" }}>
1151   - 层2{" "}
  1161 + <div className={styles.text} style={{ width: 61 }}>
  1162 + {doublePrompt[1].showName}
1152 1163 </div>
1153 1164 <Input
1154 1165 value={topItem?.cLength}
... ... @@ -1156,8 +1167,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1156 1167 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1157 1168 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1158 1169 readOnly={!topItem?.isEditable}
1159   - style={{ width: " 80%" }}
1160   - placeholder="长"
  1170 + style={{ width: 60 }}
  1171 + placeholder={doublePrompt[2].showName}
1161 1172 />
1162 1173 <Input
1163 1174 value={topItem?.cWidth}
... ... @@ -1165,15 +1176,15 @@ const BoxDesignCompontent = baseProps =&gt; {
1165 1176 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1166 1177 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1167 1178 readOnly={!topItem?.isEditable}
1168   - style={{ width: " 80%" }}
1169   - placeholder="宽"
  1179 + style={{ width: 60 }}
  1180 + placeholder={doublePrompt[3].showName}
1170 1181 />
1171 1182 </div>
1172 1183 <div className={styles.boxInput}>
1173 1184 <Select
1174 1185 optionLabelProp="label"
1175 1186 className="mySelectsDouble"
1176   - style={{ width: 180, color: "#000" ,height:'100%'}}
  1187 + style={{ width: 60.8, color: "#000" }}
1177 1188 defaultValue={options.length ? options[0].value : ""}
1178 1189 value={topItem?.cTypeName || ""}
1179 1190 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(topItem.sName), 0, 1)}
... ... @@ -1191,8 +1202,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1191 1202 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1192 1203 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1193 1204 readOnly={!topItem?.isEditable}
1194   - style={{ width: " 80%" }}
1195   - placeholder="个数"
  1205 + style={{ width: 60 }}
  1206 + placeholder={doublePrompt[4].showName}
1196 1207 />
1197 1208 <Input
1198 1209 value={topItem?.cOffset}
... ... @@ -1200,8 +1211,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1200 1211 onFocus={e => handleFocus(e, findIndexBySname(topItem.sName))}
1201 1212 onBlur={e => handleBlur(e, findIndexBySname(topItem.sName))}
1202 1213 readOnly={!topItem?.isEditable}
1203   - style={{ width: " 80%" }}
1204   - placeholder="偏移"
  1214 + style={{ width: 60 }}
  1215 + placeholder={doublePrompt[5].showName}
1205 1216 />
1206 1217 </div>
1207 1218 </div>
... ... @@ -1246,7 +1257,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1246 1257 <Select
1247 1258 optionLabelProp="label"
1248 1259 className="mySelects"
1249   - style={{ width: 180,height:'100%' }}
  1260 + style={{ width: 180 }}
1250 1261 defaultValue={options.length ? options[0].value : ""}
1251 1262 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1252 1263 onDropdownVisibleChange={async open => {
... ... @@ -1282,12 +1293,12 @@ const BoxDesignCompontent = baseProps =&gt; {
1282 1293 {boxType !== "8" &&
1283 1294 leftBoxList.map((item, index) => (
1284 1295 <div key={index + 3} className={styles.boxFlex} style={{ display: item?.show ? "block" : "none" }}>
1285   - <div className={styles.boxTitle}>{titleList[index + 3]}</div>
  1296 + <div className={styles.boxTitle}>{item.showNames}</div>
1286 1297  
1287 1298 <Select
1288 1299 optionLabelProp="label"
1289 1300 className="mySelects"
1290   - style={{ width: 180 ,height:'100%'}}
  1301 + style={{ width: 180 }}
1291 1302 defaultValue={options.length ? options[0].value : ""}
1292 1303 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1293 1304 onDropdownVisibleChange={async open => {
... ... @@ -1320,7 +1331,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1320 1331 {item.type && item.type.includes("09") ? (
1321 1332 <div>
1322 1333 <div className={styles.boxInput}>
1323   - <div className={styles.text} style={{ width: " 100%" }}>
  1334 + <div className={styles.text} style={{ width: 61 }}>
1324 1335 层1{" "}
1325 1336 </div>
1326 1337 <Input
... ... @@ -1329,8 +1340,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1329 1340 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1330 1341 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1331 1342 readOnly={!item?.isEditable}
1332   - style={{ width: " 80%" }}
1333   - placeholder="长"
  1343 + style={{ width: 60 }}
  1344 + placeholder={doublePrompt[2].showName}
1334 1345 />
1335 1346 <Input
1336 1347 value={item?.sWidth}
... ... @@ -1338,15 +1349,15 @@ const BoxDesignCompontent = baseProps =&gt; {
1338 1349 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1339 1350 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1340 1351 readOnly={!item?.isEditable}
1341   - style={{ width: " 80%" }}
1342   - placeholder="宽"
  1352 + style={{ width: 60 }}
  1353 + placeholder={doublePrompt[3].showName}
1343 1354 />
1344 1355 </div>
1345 1356 <div className={styles.boxInput}>
1346 1357 <Select
1347 1358 optionLabelProp="label"
1348 1359 className="mySelectsDouble"
1349   - style={{ width: 180, color: "#000",height:'100%' }}
  1360 + style={{ width: 60.8, color: "#000" }}
1350 1361 defaultValue={options.length ? options[0].value : ""}
1351 1362 value={item?.sTypeName || ""}
1352 1363 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
... ... @@ -1364,8 +1375,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1364 1375 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1365 1376 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1366 1377 readOnly={!item?.isEditable}
1367   - style={{ width: " 80%" }}
1368   - placeholder="个数"
  1378 + style={{ width: 60 }}
  1379 + placeholder={doublePrompt[4].showName}
1369 1380 />
1370 1381 <Input
1371 1382 value={item?.sOffset}
... ... @@ -1373,12 +1384,12 @@ const BoxDesignCompontent = baseProps =&gt; {
1373 1384 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1374 1385 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1375 1386 readOnly={!item?.isEditable}
1376   - style={{ width: " 80%" }}
1377   - placeholder="偏移"
  1387 + style={{ width: 60 }}
  1388 + placeholder={doublePrompt[5].showName}
1378 1389 />
1379 1390 </div>
1380 1391 <div className={styles.boxInput}>
1381   - <div className={styles.text} style={{ width: " 100%" }}>
  1392 + <div className={styles.text} style={{ width: 61 }}>
1382 1393 层2{" "}
1383 1394 </div>
1384 1395 <Input
... ... @@ -1387,8 +1398,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1387 1398 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1388 1399 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1389 1400 readOnly={!item?.isEditable}
1390   - style={{ width: " 80%" }}
1391   - placeholder="长"
  1401 + style={{ width: 60 }}
  1402 + placeholder={doublePrompt[2].showName}
1392 1403 />
1393 1404 <Input
1394 1405 value={item?.cWidth}
... ... @@ -1396,15 +1407,15 @@ const BoxDesignCompontent = baseProps =&gt; {
1396 1407 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1397 1408 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1398 1409 readOnly={!item?.isEditable}
1399   - style={{ width: " 80%" }}
1400   - placeholder="宽"
  1410 + style={{ width: 60 }}
  1411 + placeholder={doublePrompt[3].showName}
1401 1412 />
1402 1413 </div>
1403 1414 <div className={styles.boxInput}>
1404 1415 <Select
1405 1416 optionLabelProp="label"
1406 1417 className="mySelectsDouble"
1407   - style={{ width: 180, color: "#000" ,height:'100%'}}
  1418 + style={{ width: 60.8, color: "#000" }}
1408 1419 defaultValue={options.length ? options[0].value : ""}
1409 1420 value={item?.cTypeName || ""}
1410 1421 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
... ... @@ -1422,8 +1433,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1422 1433 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1423 1434 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1424 1435 readOnly={!item?.isEditable}
1425   - style={{ width: " 80%" }}
1426   - placeholder="个数"
  1436 + style={{ width: 60 }}
  1437 + placeholder={doublePrompt[4].showName}
1427 1438 />
1428 1439 <Input
1429 1440 value={item?.cOffset}
... ... @@ -1431,8 +1442,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1431 1442 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1432 1443 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1433 1444 readOnly={!item?.isEditable}
1434   - style={{ width: " 80%" }}
1435   - placeholder="偏移"
  1445 + style={{ width: 60 }}
  1446 + placeholder={doublePrompt[5].showName}
1436 1447 />
1437 1448 </div>
1438 1449 </div>
... ... @@ -1468,7 +1479,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1468 1479 <Select
1469 1480 optionLabelProp="label"
1470 1481 className="mySelects"
1471   - style={{ width: 180 ,height:'100%'}}
  1482 + style={{ width: 180 }}
1472 1483 defaultValue={options.length ? options[0].value : ""}
1473 1484 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1474 1485 onDropdownVisibleChange={async open => {
... ... @@ -1525,12 +1536,12 @@ const BoxDesignCompontent = baseProps =&gt; {
1525 1536 {boxType !== "8" &&
1526 1537 rightBoxList.map((item, index) => (
1527 1538 <div key={findIndexBySname(item.sName)} className={styles.boxFlex} style={{ display: item?.show ? "block" : "none" }}>
1528   - <div className={styles.boxTitle}>{titleList[findIndexBySname(item.sName)]}</div>
  1539 + <div className={styles.boxTitle}>{item.showNames}</div>
1529 1540  
1530 1541 <Select
1531 1542 optionLabelProp="label"
1532 1543 className="mySelects"
1533   - style={{ width: 180 ,height:'100%'}}
  1544 + style={{ width: 180 }}
1534 1545 defaultValue={options.length ? options[0].value : ""}
1535 1546 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1536 1547 onDropdownVisibleChange={async open => {
... ... @@ -1563,7 +1574,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1563 1574 {item.type && item.type.includes("09") ? (
1564 1575 <div>
1565 1576 <div className={styles.boxInput}>
1566   - <div className={styles.text} style={{ width: " 100%" }}>
  1577 + <div className={styles.text} style={{ width: 61 }}>
1567 1578 层1{" "}
1568 1579 </div>
1569 1580 <Input
... ... @@ -1572,8 +1583,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1572 1583 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1573 1584 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1574 1585 readOnly={!item?.isEditable}
1575   - style={{ width: " 80%" }}
1576   - placeholder="长"
  1586 + style={{ width: 60 }}
  1587 + placeholder={doublePrompt[2].showName}
1577 1588 />
1578 1589 <Input
1579 1590 value={item?.sWidth}
... ... @@ -1581,15 +1592,15 @@ const BoxDesignCompontent = baseProps =&gt; {
1581 1592 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1582 1593 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1583 1594 readOnly={!item?.isEditable}
1584   - style={{ width: " 80%" }}
1585   - placeholder="宽"
  1595 + style={{ width: 60 }}
  1596 + placeholder={doublePrompt[3].showName}
1586 1597 />
1587 1598 </div>
1588 1599 <div className={styles.boxInput}>
1589 1600 <Select
1590 1601 optionLabelProp="label"
1591 1602 className="mySelectsDouble"
1592   - style={{ width: 180, color: "#000" ,height:'100%'}}
  1603 + style={{ width: 60.8, color: "#000" }}
1593 1604 defaultValue={options.length ? options[0].value : ""}
1594 1605 value={item?.sTypeName || ""}
1595 1606 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 0)}
... ... @@ -1607,8 +1618,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1607 1618 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1608 1619 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1609 1620 readOnly={!item?.isEditable}
1610   - style={{ width: " 80%" }}
1611   - placeholder="个数"
  1621 + style={{ width: 60 }}
  1622 + placeholder={doublePrompt[4].showName}
1612 1623 />
1613 1624 <Input
1614 1625 value={item?.sOffset}
... ... @@ -1616,12 +1627,12 @@ const BoxDesignCompontent = baseProps =&gt; {
1616 1627 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1617 1628 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1618 1629 readOnly={!item?.isEditable}
1619   - style={{ width: " 80%" }}
1620   - placeholder="偏移"
  1630 + style={{ width: 60 }}
  1631 + placeholder={doublePrompt[5].showName}
1621 1632 />
1622 1633 </div>
1623 1634 <div className={styles.boxInput}>
1624   - <div className={styles.text} style={{ width: " 100%" }}>
  1635 + <div className={styles.text} style={{ width: 61 }}>
1625 1636 层2{" "}
1626 1637 </div>
1627 1638 <Input
... ... @@ -1630,8 +1641,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1630 1641 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1631 1642 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1632 1643 readOnly={!item?.isEditable}
1633   - style={{ width: " 80%" }}
1634   - placeholder="长"
  1644 + style={{ width: 60 }}
  1645 + placeholder={doublePrompt[2].showName}
1635 1646 />
1636 1647 <Input
1637 1648 value={item?.cWidth}
... ... @@ -1639,15 +1650,15 @@ const BoxDesignCompontent = baseProps =&gt; {
1639 1650 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1640 1651 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1641 1652 readOnly={!item?.isEditable}
1642   - style={{ width: " 80%" }}
1643   - placeholder="宽"
  1653 + style={{ width: 60 }}
  1654 + placeholder={doublePrompt[3].showName}
1644 1655 />
1645 1656 </div>
1646 1657 <div className={styles.boxInput}>
1647 1658 <Select
1648 1659 optionLabelProp="label"
1649 1660 className="mySelectsDouble"
1650   - style={{ width: 180, color: "#000" ,height:'100%'}}
  1661 + style={{ width: 60.8, color: "#000" }}
1651 1662 defaultValue={options.length ? options[0].value : ""}
1652 1663 value={item?.cTypeName || ""}
1653 1664 onSelect={(value, option) => handleSelects(value, option, findIndexBySname(item.sName), 0, 1)}
... ... @@ -1665,8 +1676,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1665 1676 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1666 1677 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1667 1678 readOnly={!item?.isEditable}
1668   - style={{ width: " 80%" }}
1669   - placeholder="个数"
  1679 + style={{ width: 60 }}
  1680 + placeholder={doublePrompt[4].showName}
1670 1681 />
1671 1682 <Input
1672 1683 value={item?.cOffset}
... ... @@ -1674,8 +1685,8 @@ const BoxDesignCompontent = baseProps =&gt; {
1674 1685 onFocus={e => handleFocus(e, findIndexBySname(item.sName))}
1675 1686 onBlur={e => handleBlur(e, findIndexBySname(item.sName))}
1676 1687 readOnly={!item?.isEditable}
1677   - style={{ width: " 80%" }}
1678   - placeholder="偏移"
  1688 + style={{ width: 60 }}
  1689 + placeholder={doublePrompt[5].showName}
1679 1690 />
1680 1691 </div>
1681 1692 </div>
... ... @@ -1711,7 +1722,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1711 1722 <Select
1712 1723 optionLabelProp="label"
1713 1724 className="mySelects"
1714   - style={{ width: 180,height:'100%' }}
  1725 + style={{ width: 180 }}
1715 1726 defaultValue={options.length ? options[0].value : ""}
1716 1727 onSelect={(value, option) => handleSelect(value, option, findIndexBySname(item.sName), 0)}
1717 1728 onDropdownVisibleChange={async open => {
... ... @@ -1816,7 +1827,7 @@ const BoxDesignCompontent = baseProps =&gt; {
1816 1827 <Select
1817 1828 optionLabelProp="label"
1818 1829 className="mySelects"
1819   - style={{ width: "80%",height:'100%' }}
  1830 + style={{ width: "80%" }}
1820 1831 defaultValue={boxList[uniqueIndex]?.value}
1821 1832 onSelect={(value, option) => handleSelect(value, option, uniqueIndex, 1)}
1822 1833 onDropdownVisibleChange={async open => {
... ...
src/components/Common/BoxDesignCompontent/svg.js
... ... @@ -58,7 +58,9 @@ const SvgBox = props =&gt; {
58 58 const svgContainerRef = useRef(null);
59 59 const svgRef = useRef(null);
60 60 const [boxKey, setBoxKey] = useState(new Date().getTime());
61   - const { boxList, dSvgBoxWidth, dSvgBoxHeight, iFAngle } = props;
  61 + const { boxList, dSvgBoxWidth, dSvgBoxHeight, iFAngle, tableColum,
  62 + boxBodyList,
  63 + tableDataList, showNew } = props;
62 64 const [width, setWidth] = useState(0);
63 65 const [height, setHeight] = useState(0);
64 66 const [deep, setDeep] = useState(0);
... ... @@ -82,13 +84,28 @@ const SvgBox = props =&gt; {
82 84 svg.innerHTML = "";
83 85 if (!(boxList && boxList.length)) return;
84 86 // 获取盒型类型
85   - const svgTypes = boxList.find(x => x.sName === "盒身")?.type || 1;
86   - setSvgType(svgTypes);
87 87  
  88 + let svgTypes;
88 89 // 获取盒长、盒宽、盒高
89   - const boxLength = Number(boxList.find(x => x.sName === "盒长")?.value) || 0;
90   - const boxWidth = Number(boxList.find(x => x.sName === "盒宽")?.value) || 0;
91   - let boxHeight = Number(boxList.find(x => x.sName === "盒高")?.value) || 0;
  90 + let boxLength
  91 + let boxWidth
  92 + let boxHeight
  93 + if (showNew === 0) {
  94 + if (!(boxBodyList && boxBodyList.length)) return
  95 + svgTypes = boxList.find(x => x.sName?.trim() === boxBodyList[0].showName)?.type || 1
  96 + if (!(tableDataList && tableDataList.length)) return
  97 + boxLength = Number(boxList.find(x => x.sName?.trim() === tableDataList[0].showName)?.value) || 0;
  98 + boxWidth = Number(boxList.find(x => x.sName?.trim() === tableDataList[1].showName)?.value) || 0;
  99 + boxHeight = Number(boxList.find(x => x.sName?.trim() === tableDataList[2].showName)?.value) || 0;
  100 + } else {
  101 + svgTypes = boxList.find(x => x.sName === "盒身")?.type || 1
  102 + boxLength = Number(boxList.find(x => x.sName === "盒长")?.value) || 0;
  103 + boxWidth = Number(boxList.find(x => x.sName === "盒宽")?.value) || 0;
  104 + boxHeight = Number(boxList.find(x => x.sName === "盒高")?.value) || 0;
  105 + }
  106 +
  107 +
  108 + setSvgType(svgTypes);
92 109  
93 110 setWidth(boxLength);
94 111 setHeight(boxWidth);
... ... @@ -130,12 +147,13 @@ const SvgBox = props =&gt; {
130 147 // 展宽
131 148 if (boxList && boxList.length) {
132 149 // 如果存在部件和盒舌 取最大的
133   - const top = topOffect(boxList, boxLength, boxWidth, boxHeight);
134   - const bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight);
  150 + const top = topOffect(boxList, boxLength, boxWidth, boxHeight, props);
  151 + const bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight, props);
  152 + console.log("🚀 ~ initSVG ~ bottom:", top, bottom)
135 153 max = Number(top) + Number(bottom);
136 154 if (Number(svgType) === 8) {
137   - const top = topOffect(boxList, headLength, headWidth);
138   - const bottom = bottomOffect(boxList, orderLength, orderWidth);
  155 + const top = topOffect(boxList, headLength, headWidth, props);
  156 + const bottom = bottomOffect(boxList, orderLength, orderWidth, props);
139 157 max = Number(top) + Number(bottom);
140 158 }
141 159 }
... ... @@ -217,9 +235,12 @@ const SvgBox = props =&gt; {
217 235 }
218 236 viewBoxWidth = Number(boxLength) + leftValue + rightValue;
219 237 viewBoxHeight = Number(boxWidth) + topValue + bottomValue;
  238 +
220 239 } else if (Number(svgType) === 5) {
221   - viewBoxWidth = (boxHeight + boxWidth) * 2 + dYTBW + dZTBW +doubleTotal
  240 + viewBoxWidth = (boxHeight + boxWidth) * 2 + dYTBW + dZTBW + doubleTotal
222 241 viewBoxHeight = boxLength + max;
  242 + console.log("🚀 ~ initSVG ~ viewBoxHeight:", viewBoxHeight, boxLength, max)
  243 +
223 244 } else if (Number(svgType) === 6) {
224 245 viewBoxWidth = boxWidth + 2;
225 246 viewBoxHeight = boxLength + 2;
... ... @@ -333,19 +354,19 @@ const SvgBox = props =&gt; {
333 354 const heightScale = (dSvgBoxHeight ? dSvgBoxHeight : 250) / viewBoxHeight;
334 355 scale = Math.min(widthScale, heightScale);
335 356 let ySvg = dSvgBoxHeight
336   - ? topOffect(boxList, boxLength, boxWidth, boxHeight) * scale
337   - : topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
  357 + ? topOffect(boxList, boxLength, boxWidth, boxHeight, props) * scale
  358 + : topOffect(boxList, boxLength, boxWidth, boxHeight, props) * scale;
338 359 let bottom = 0;
339 360 let xSvg = 0;
340 361 if (Number(svgType) !== 8) {
341   - bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight);
  362 + bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight, props);
342 363 } else {
343   - bottom = bottomOffect(boxList, orderLength, orderWidth);
  364 + bottom = bottomOffect(boxList, orderLength, orderWidth, props);
344 365 }
345 366 if (Number(svgType) === 4) {
346   - // ySvg = ySvg + boxHeight * scale;
  367 +
347 368 } else if (Number(svgType) === 8) {
348   - ySvg = topOffect(boxList, headLength, headWidth) * scale;
  369 + ySvg = topOffect(boxList, headLength, headWidth, props) * scale;
349 370 }
350 371 ySvg = ySvg + 50 * scale;
351 372  
... ... @@ -392,7 +413,7 @@ const SvgBox = props =&gt; {
392 413 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
393 414 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
394 415 } else if (Number(svgType) === 4) {
395   - xSvg = ((boxHeight * 2 + boxLength) / 2) * scale;
  416 + xSvg = (boxHeight * 2 + boxLength) / 2;
396 417 } else {
397 418 xSvg = zbtb?.value;
398 419 }
... ... @@ -410,13 +431,13 @@ const SvgBox = props =&gt; {
410 431 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`;
411 432 } else {
412 433 scale = 0.5;
413   - let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
  434 + let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight, props) * scale;
414 435 if (Number(svgType) === 4) {
415   - // ySvg = ySvg + boxHeight;
  436 +
416 437 } else if (Number(svgType) === 8) {
417   - ySvg = topOffect(boxList, headLength, headWidth) * scale;
  438 + ySvg = topOffect(boxList, headLength, headWidth, props) * scale;
418 439 }
419   - ySvg = ySvg + 50 * scale;
  440 + ySvg = Number(ySvg) + 50 * scale;
420 441 let xSvg = 0;
421 442 if (Number(svgType) === 7) {
422 443 xSvg = scaledWidth + dZXCW * scale;
... ... @@ -461,7 +482,7 @@ const SvgBox = props =&gt; {
461 482 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
462 483 xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
463 484 } else if (Number(svgType) === 4) {
464   - xSvg = (scaledDeep * 2 + scaledWidth) / 2;
  485 + xSvg = (boxHeight * 2 + boxLength) / 2;
465 486 } else {
466 487 xSvg = zbtb?.value;
467 488 }
... ... @@ -479,7 +500,7 @@ const SvgBox = props =&gt; {
479 500 svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`;
480 501 }
481 502 } else if (props.showNew === 1) {
482   - let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
  503 + let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight, props) * scale;
483 504 let leftSize = 0;
484 505 let topSize = 0;
485 506 if (Number(svgType) === 4) {
... ... @@ -547,7 +568,7 @@ const SvgBox = props =&gt; {
547 568 );
548 569 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
549 570 leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength));
550   - ySvg = topOffect(boxList, headLength, headWidth);
  571 + ySvg = topOffect(boxList, headLength, headWidth, props);
551 572 } else {
552 573 leftSize = zbtb?.value;
553 574 if (zbtb?.type === "8009") {
... ... @@ -573,7 +594,7 @@ const SvgBox = props =&gt; {
573 594 // svgContainerRef.current.style.transform = 'translate(-50%, -50%)';
574 595 } else if (props.showNew === 2) {
575 596 // g.setAttribute("transform", `rotate(${iFAngle, dSvgBoxWidth/2,dSvgBoxHeight*2})`);
576   - let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
  597 + let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight, props) * scale;
577 598 let leftSize = 0;
578 599 let topSize = 0;
579 600 if (Number(svgType) === 4) {
... ... @@ -638,7 +659,7 @@ const SvgBox = props =&gt; {
638 659 );
639 660 const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
640 661 leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength));
641   - ySvg = topOffect(boxList, headLength, headWidth);
  662 + ySvg = topOffect(boxList, headLength, headWidth, props);
642 663 } else {
643 664 leftSize = zbtb?.value;
644 665 }
... ... @@ -4945,7 +4966,7 @@ const SvgBox = props =&gt; {
4945 4966 // 将分组添加到 SVG
4946 4967 svg.appendChild(g);
4947 4968 } else {
4948   - pathList.push(createFull(ysbj?.type, scaledHeight, scaledHeight, dYSCW * scale, scaledWidth, 0));
  4969 + pathList.push(createFull(ysbj?.type, scaledWidth, scaledHeight, dYSCW * scale, scaledWidth, 0));
4949 4970 }
4950 4971 // 左边
4951 4972 if (zxbj?.type && zxbj?.type === "4009") {
... ... @@ -5023,7 +5044,7 @@ const SvgBox = props =&gt; {
5023 5044 // 将分组添加到 SVG
5024 5045 svg.appendChild(g);
5025 5046 } else {
5026   - pathList.push(createFull(zxbj?.type, scaledHeight, -scaledHeight, -dZXCW * scale, 0, 0));
  5047 + pathList.push(createFull(zxbj?.type, scaledWidth, -scaledHeight, -dZXCW * scale, 0, 0));
5027 5048 }
5028 5049  
5029 5050 pathList.forEach(x => {
... ... @@ -5162,13 +5183,23 @@ const SvgBox = props =&gt; {
5162 5183 }
5163 5184 };
5164 5185 // 计算头部偏移
5165   - const topOffect = (list, length, width, height) => {
  5186 + const topOffect = (list, length, width, height, props) => {
5166 5187 const val = list.filter(x => x.type);
5167 5188 const sfhs = val.find(x => x.sName === "上方盒舌");
5168 5189 const zscw = val.find(x => x.sName === "左(上)插位组件");
5169 5190 const yscw = val.find(x => x.sName === "右(上)插位组件");
5170   - const box = val.find(x => x.sName === "盒身");
  5191 + const { boxBodyList, showNew } = props
  5192 + let box
  5193 + if (showNew === 0) {
  5194 + if (!(boxBodyList && boxBodyList.length)) return
  5195 + box = list.find(x => x.sName?.trim() === boxBodyList[0].showName) || null
  5196 +
  5197 + } else {
  5198 + box = list.find(x => x.sName === "盒身") || null
  5199 +
  5200 + }
5171 5201 const svg = Number(box?.type);
  5202 + console.log("🚀 ~ topOffect ~ svg:", svg, showNew)
5172 5203 if (svg === 6) return 0;
5173 5204  
5174 5205 const dZ = Number(zscw?.value) || 0;
... ... @@ -5236,17 +5267,25 @@ const SvgBox = props =&gt; {
5236 5267 }
5237 5268 top = sfhs?.value || 0;
5238 5269 }
5239   -
5240   - if (svg === 4) top += height;
5241   - return isNaN(top) ? 0 : top;
  5270 + // if (svg === 4) top = Number(top) + Number(height);
  5271 + return isNaN(top) ? 0 : Number(top);
5242 5272 };
5243   - const bottomOffect = (list, length, width, height) => {
  5273 + const bottomOffect = (list, length, width, height, props) => {
5244 5274 const val = list.filter(x => x.type);
5245 5275 const sfhs = val.find(x => x.sName === "下方盒舌");
5246 5276 const zscw = val.find(x => x.sName === "左(下)插位组件");
5247 5277 const yscw = val.find(x => x.sName === "右(下)插位组件");
5248 5278 const hdzj = val.find(x => x.sName === "盒底组件");
5249   - const box = val.find(x => x.sName === "盒身");
  5279 + const { boxBodyList, showNew } = props
  5280 + let box
  5281 + if (showNew === 0) {
  5282 + if (!(boxBodyList && boxBodyList.length)) return
  5283 + box = list.find(x => x.sName?.trim() === boxBodyList[0].showName) || null
  5284 +
  5285 + } else {
  5286 + box = list.find(x => x.sName === "盒身") || null
  5287 +
  5288 + }
5250 5289 const svg = Number(box?.type);
5251 5290  
5252 5291 if (svg === 6) return 0;
... ... @@ -5327,7 +5366,7 @@ const SvgBox = props =&gt; {
5327 5366 top = sfhs?.value || 0;
5328 5367 }
5329 5368  
5330   - if (svg === 4) top += height;
  5369 + // if (svg === 4) top = Number(top) + Number(height);
5331 5370 return isNaN(top) ? 0 : top;
5332 5371 };
5333 5372 // 上方盒舌左边
... ...
src/components/Common/CommonTable/index.js
... ... @@ -7135,7 +7135,7 @@ class CommonTableRc extends React.Component {
7135 7135 expandedRowRender: this.props.setExpandedRowRender === 'Y' ? expandedRow : null,
7136 7136 defaultExpandAllRows: this.props.defaultExpandAllRows || null,
7137 7137 }}
7138   - scroll={{ x: this.scrollX, y: commonUtils.isNotEmptyObject(autoHeight) ? autoHeight : 544 }}
  7138 + scroll={{ x: this.scrollX, y: commonUtils.isNotEmptyNumber(autoHeight) ? autoHeight : 544 }}
7139 7139 summary={this.genFooter}
7140 7140 size="small"
7141 7141 sticky={this.sticky}
... ...
src/components/QuickQuote/index.css
... ... @@ -77,7 +77,7 @@
77 77 .quickQuote .content .rightContent .viewTable :global .ant-form-item-control,
78 78 .quickQuote .content .rightContent .viewTable1 :global .ant-form-item-control {
79 79 flex: 1;
80   - max-width: calc(100% - 70x);
  80 + max-width: calc(100% - 70px);
81 81 }
82 82 .quickQuote .content .rightContent .viewTable :global .viewStyle .ant-input-number,
83 83 .quickQuote .content .rightContent .viewTable1 :global .viewStyle .ant-input-number {
... ... @@ -101,6 +101,14 @@
101 101 .quickQuote .content .rightContent .viewTableDownView1 :global .viewStyle .ant-form-item-control {
102 102 max-width: calc(100% - 95px);
103 103 }
  104 +.quickQuote .content .rightContent .viewTableDownView :global .ant-form-item-required,
  105 +.quickQuote .content .rightContent .viewTableDownView1 :global .ant-form-item-required {
  106 + color: #ff4d4f !important;
  107 +}
  108 +.quickQuote .content .rightContent .viewTableDownView :global .ant-form-item-required::before,
  109 +.quickQuote .content .rightContent .viewTableDownView1 :global .ant-form-item-required::before {
  110 + content: '' !important;
  111 +}
104 112 .quickQuote .content .rightContent .viewTableDownView .subViewTable,
105 113 .quickQuote .content .rightContent .viewTableDownView1 .subViewTable {
106 114 width: 100%;
... ... @@ -299,15 +307,17 @@
299 307 flex-basis: 50px !important;
300 308 }
301 309 .quickQuote .content .rightContent .materialsLine .materialsBtns {
302   - width: 80px;
  310 + width: 10%;
303 311 display: flex;
304 312 align-items: center;
305 313 justify-content: space-around;
  314 + padding-bottom: 10px;
306 315 }
307 316 .quickQuote .content .rightContent .materialsLine .materialsBtns :global button {
308 317 padding: 0;
309 318 width: 16px;
310 319 height: 16px;
  320 + line-height: 12px;
311 321 }
312 322 .quickQuote .content .rightContent .materialsLine .materialsBtns :global button > span {
313 323 font-size: 10px;
... ... @@ -316,6 +326,14 @@
316 326 background-color: #53b637;
317 327 border-color: #53b637;
318 328 }
  329 +.quickQuote .content .rightContent .productNameBtns {
  330 + position: absolute;
  331 + top: 1px;
  332 + right: 2px;
  333 +}
  334 +.quickQuote .content .rightContent .productNameBtns :global button {
  335 + width: 20px;
  336 +}
319 337 .leftTree,
320 338 .boxTree {
321 339 width: 250px;
... ... @@ -391,18 +409,20 @@
391 409 }
392 410 .downOperations :global button {
393 411 padding: 0;
394   - width: 16px;
  412 + width: 16px !important;
395 413 height: 16px;
  414 + line-height: 12px;
396 415 }
397 416 .downOperations :global button > span {
398 417 font-size: 10px;
399 418 }
400 419 .sParamConfig :global .ant-form-item-label label::before {
401   - content: "";
402   - display: block;
403   - width: 5px;
404   - height: 5px;
405   - border-radius: 50%;
406   - background-color: #ff4d4f;
407   - margin-right: 2px;
  420 + content: "" !important;
  421 + display: block !important;
  422 + width: 5px !important;
  423 + min-width: 5px;
  424 + height: 5px !important;
  425 + border-radius: 50% !important;
  426 + background-color: #ff4d4f !important;
  427 + margin-right: 2px !important;
408 428 }
... ...
src/components/QuickQuote/index.less
... ... @@ -407,7 +407,7 @@
407 407 padding: 0;
408 408 width: 16px;
409 409 height: 16px;
410   -
  410 + line-height: 12px;
411 411 >span {
412 412 font-size: 10px;
413 413 }
... ... @@ -539,9 +539,9 @@
539 539 :global {
540 540 button {
541 541 padding: 0;
542   - width: 16px;
  542 + width: 16px !important;
543 543 height: 16px;
544   -
  544 + line-height: 12px;
545 545 >span {
546 546 font-size: 10px;
547 547 }
... ...