Commit 91ec52e25138454ffc776eac2a6ae21495642fc5

Authored by 陈鑫涛
1 parent af31c58f

功能页面拖拽排序

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