Commit 2e2a2b3b361d2c57360a2eacdd6eb03237f4d636

Authored by 陈鑫涛
1 parent e56240a9

双盒

src/components/Common/BoxDesignCompontent/index.js
... ... @@ -197,6 +197,10 @@ const BoxDesignCompontent = baseProps => {
197 197 { name: "右偏移", value: "dYPY" },
198 198 { name: "右插位组件", value: "dYCW" },
199 199 { name: "右下插位组件", value: "dYXCW" },
  200 + { name: "首盒长", value: "dSHC" },
  201 + { name: "首盒宽", value: "dSHK" },
  202 + { name: "次盒长", value: "dCHC" },
  203 + { name: "次盒宽", value: "dCHK" },
200 204 ];
201 205 const newBoxList = [];
202 206  
... ... @@ -269,8 +273,10 @@ const BoxDesignCompontent = baseProps => {
269 273 }
270 274 // 盒身信息
271 275 if (masterData) {
272   - console.log(masterData,'masterData');
273   -
  276 + const headLength = slaveData.find(item => item.sCode === "dSHC")?.iValue
  277 + const headWidth = slaveData.find(item => item.sCode === "dSHK")?.iValue
  278 + const orderLength = slaveData.find(item => item.sCode === "dCHC")?.iValue
  279 + const orderWidth = slaveData.find(item => item.sCode === "dCHK")?.iValue
274 280 newBoxList.forEach((item, index) => {
275 281 if (item.sName === "盒身") {
276 282 newBoxList[index].value = masterData.sBoxBody;
... ... @@ -285,13 +291,13 @@ const BoxDesignCompontent = baseProps => {
285 291 } else if (item.sName === "盒型名称") {
286 292 newBoxList[index].value = masterData.sName;
287 293 } else if (item.sName === "首盒长") {
288   - // newBoxList[index].value = masterData.sName;
  294 + newBoxList[index].value = headLength;
289 295 } else if (item.sName === "首盒宽") {
290   - // newBoxList[index].value = masterData.sName;
  296 + newBoxList[index].value = headWidth;
291 297 } else if (item.sName === "次盒长") {
292   - // newBoxList[index].value = masterData.sName;
  298 + newBoxList[index].value = orderLength;
293 299 } else if (item.sName === "次盒宽") {
294   - // newBoxList[index].value = masterData.sName;
  300 + newBoxList[index].value = orderWidth;
295 301 }
296 302 });
297 303 }
... ... @@ -530,6 +536,7 @@ const BoxDesignCompontent = baseProps => {
530 536 let sWidthFormula = "";
531 537 const boxType = boxList.find(item => item.sName === "盒身")?.type;
532 538 if (boxType === "8") {
  539 +
533 540 } else {
534 541 const boxLength = Number(boxList.find(item => item.sName === "盒长")?.value);
535 542 const boxWidth = Number(boxList.find(item => item.sName === "盒宽")?.value);
... ... @@ -852,6 +859,7 @@ const BoxDesignCompontent = baseProps => {
852 859 }
853 860 }
854 861  
  862 + // const sDoubleSize = JSON.stringify([headLength,headWidth,orderLength,orderWidth])
855 863 // 存储盒身数据 主表
856 864 const newMasterData = {
857 865 ...masterData,
... ...
src/components/Common/BoxDesignCompontent/svg.js
... ... @@ -127,9 +127,15 @@ const SvgBox = props => {
127 127 // 展宽
128 128 if (boxList && boxList.length) {
129 129 // 如果存在部件和盒舌 取最大的
  130 +
130 131 const top = topOffect(boxList, boxLength, boxWidth, boxHeight);
131 132 const bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight);
132 133 max = Number(top) + Number(bottom);
  134 + if (Number(svgType) === 8) {
  135 + const top = topOffect(boxList, headLength, headWidth);
  136 + const bottom = bottomOffect(boxList, orderLength, orderWidth);
  137 + max = Number(top) + Number(bottom);
  138 + }
133 139 }
134 140  
135 141 let viewBoxHeight = Number(boxHeight) + max;
... ... @@ -262,11 +268,40 @@ const SvgBox = props => {
262 268 // viewBoxWidth = boxWidth + leftValue + rightValue;
263 269 // viewBoxHeight = boxLength + dZSCW + dYXCW;
264 270 } else if (Number(svgType) === 8) {
265   - const top = topOffect(boxList, headLength, headWidth);
266   - viewBoxWidth = Number(headLength);
267   - viewBoxHeight = Number(headWidth) + Number(orderWidth) + top;
268   - console.log("🚀 ~ initSVG ~ viewBoxHeight:", viewBoxHeight);
  271 + const getTop = (item, offset = 0) => {
  272 + const map = {
  273 + 10001: headWidth + Number(item?.value),
  274 + 10002: Number(item?.value),
  275 + 10003: Number(item?.value),
  276 + 10004: Number(item?.value) + headWidth * 2,
  277 + 10005: headWidth * 2,
  278 + 10006: Number(item?.value) + headWidth,
  279 + 10007: Number(item?.value) + headWidth,
  280 + };
  281 + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理
  282 + };
  283 +
  284 + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件"));
  285 + const topRight = getTop(
  286 + boxList.find(x => x.sName === "右上插位组件"),
  287 + 2000
  288 + );
  289 + const topLength = headLength + topLeft + topRight;
  290 + const bottomLeft = getTop(
  291 + boxList.find(x => x.sName === "左插位组件"),
  292 + 3000
  293 + );
  294 + const bottomRight = getTop(
  295 + boxList.find(x => x.sName === "右插位组件"),
  296 + 5000
  297 + );
  298 + const bottomLength = orderLength * 2 + bottomLeft + bottomRight;
  299 + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0;
  300 + const rightOffect = boxList.find(x => x.sName === "右偏移")?.value || 0;
  301 + viewBoxWidth = Math.max(topLength, bottomLength) + Number(leftOffect) + Number(rightOffect);
  302 + viewBoxHeight = Number(headWidth) + Number(orderWidth) + max;
269 303 }
  304 +
270 305 // 计算缩放比例
271 306 let scale = 1;
272 307 if (props.showNew === 0) {
... ... @@ -277,7 +312,12 @@ const SvgBox = props => {
277 312 let ySvg = dSvgBoxHeight
278 313 ? topOffect(boxList, boxLength, boxWidth, boxHeight) * scale
279 314 : topOffect(boxList, boxLength, boxWidth, boxHeight) * scale;
280   - const bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight);
  315 + let bottom = 0;
  316 + if (Number(svgType) !== 8) {
  317 + bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight);
  318 + } else {
  319 + bottom = bottomOffect(boxList, orderLength, orderWidth);
  320 + }
281 321 if (Number(svgType) === 4) {
282 322 ySvg = ySvg + boxHeight * scale;
283 323 } else if (Number(svgType) === 8) {
... ... @@ -285,8 +325,31 @@ const SvgBox = props => {
285 325 }
286 326 ySvg = ySvg + 50 * scale;
287 327 let xSvg = 0;
288   - if (Number(svgType === 7)) {
  328 + if (Number(svgType) === 7) {
289 329 xSvg = scaledWidth + dZXCW * scale;
  330 + } else if (Number(svgType) === 8) {
  331 + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0;
  332 + // 计算首盒部件与次盒部件尺寸
  333 + const getTop = (item, offset = 0) => {
  334 + const map = {
  335 + 10001: headWidth + Number(item?.value),
  336 + 10002: Number(item?.value),
  337 + 10003: Number(item?.value),
  338 + 10004: Number(item?.value) + headWidth * 2,
  339 + 10005: headWidth * 2,
  340 + 10006: Number(item?.value) + headWidth,
  341 + 10007: Number(item?.value) + headWidth,
  342 + };
  343 + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理
  344 + };
  345 + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件"));
  346 + const topLength = headLength + topLeft;
  347 + const bottomLeft = getTop(
  348 + boxList.find(x => x.sName === "左插位组件"),
  349 + 3000
  350 + );
  351 + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
  352 + xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
290 353 } else {
291 354 xSvg = zbtb?.value;
292 355 }
... ... @@ -310,12 +373,34 @@ const SvgBox = props => {
310 373 }
311 374 ySvg = ySvg + 50 * scale;
312 375 let xSvg = 0;
313   - if (Number(svgType === 7)) {
  376 + if (Number(svgType) === 7) {
314 377 xSvg = scaledWidth + dZXCW * scale;
  378 + } else if (Number(svgType) === 8) {
  379 + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0;
  380 + // 计算首盒部件与次盒部件尺寸
  381 + const getTop = (item, offset = 0) => {
  382 + const map = {
  383 + 10001: headWidth + Number(item?.value),
  384 + 10002: Number(item?.value),
  385 + 10003: Number(item?.value),
  386 + 10004: Number(item?.value) + headWidth * 2,
  387 + 10005: headWidth * 2,
  388 + 10006: Number(item?.value) + headWidth,
  389 + 10007: Number(item?.value) + headWidth,
  390 + };
  391 + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理
  392 + };
  393 + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件"));
  394 + const topLength = headLength + topLeft;
  395 + const bottomLeft = getTop(
  396 + boxList.find(x => x.sName === "左插位组件"),
  397 + 3000
  398 + );
  399 + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
  400 + xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength));
315 401 } else {
316 402 xSvg = zbtb?.value;
317 403 }
318   -
319 404 svg.setAttribute(
320 405 "viewBox",
321 406 `${-(dSvgBoxWidth ? xSvg : viewBoxWidth / 2)} ${dSvgBoxWidth ? -0 : -ySvg} ${dSvgBoxWidth ? dSvgBoxWidth : 500} ${
... ... @@ -359,9 +444,35 @@ const SvgBox = props => {
359 444 ySvg = topSize;
360 445 } else if (Number(svgType) === 6) {
361 446 leftSize = 0;
  447 + } else if (Number(svgType) === 8) {
  448 + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0;
  449 + // 计算首盒部件与次盒部件尺寸
  450 + const getTop = (item, offset = 0) => {
  451 + const map = {
  452 + 10001: headWidth + Number(item?.value),
  453 + 10002: Number(item?.value),
  454 + 10003: Number(item?.value),
  455 + 10004: Number(item?.value) + headWidth * 2,
  456 + 10005: headWidth * 2,
  457 + 10006: Number(item?.value) + headWidth,
  458 + 10007: Number(item?.value) + headWidth,
  459 + };
  460 + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理
  461 + };
  462 + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件"));
  463 + const topLength = topLeft;
  464 + const bottomLeft = getTop(
  465 + boxList.find(x => x.sName === "左插位组件"),
  466 + 3000
  467 + );
  468 + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
  469 + leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength));
  470 + ySvg = topOffect(boxList, headLength, headWidth);
362 471 } else {
363 472 leftSize = zbtb?.value;
364 473 }
  474 + console.log(viewBoxWidth, viewBoxHeight, "viewBoxHeight");
  475 +
365 476 svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth + 2} ${viewBoxHeight + 2}`);
366 477 svg.setAttribute("width", `${viewBoxWidth}px`);
367 478 svg.setAttribute("height", `${viewBoxHeight}px`);
... ... @@ -410,6 +521,30 @@ const SvgBox = props => {
410 521 ySvg = topSize;
411 522 } else if (Number(svgType) === 6) {
412 523 leftSize = 0;
  524 + } else if (Number(svgType) === 8) {
  525 + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0;
  526 + // 计算首盒部件与次盒部件尺寸
  527 + const getTop = (item, offset = 0) => {
  528 + const map = {
  529 + 10001: headWidth + Number(item?.value),
  530 + 10002: Number(item?.value),
  531 + 10003: Number(item?.value),
  532 + 10004: Number(item?.value) + headWidth * 2,
  533 + 10005: headWidth * 2,
  534 + 10006: Number(item?.value) + headWidth,
  535 + 10007: Number(item?.value) + headWidth,
  536 + };
  537 + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理
  538 + };
  539 + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件"));
  540 + const topLength = topLeft;
  541 + const bottomLeft = getTop(
  542 + boxList.find(x => x.sName === "左插位组件"),
  543 + 3000
  544 + );
  545 + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect);
  546 + leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength));
  547 + ySvg = topOffect(boxList, headLength, headWidth);
413 548 } else {
414 549 leftSize = zbtb?.value;
415 550 }
... ... @@ -1286,13 +1421,17 @@ const SvgBox = props => {
1286 1421  
1287 1422 if (svg === 8) {
1288 1423 const scw = val.find(x => x.sName === "上插位组件");
1289   - let tops = 0;
1290   - if (scw?.type === "11001") {
1291   - tops = width + Number(scw.value);
1292   - }
1293   - return tops;
  1424 + const topsMap = {
  1425 + 11001: width + Number(scw?.value),
  1426 + 11002: Number(scw?.value),
  1427 + 11003: Number(scw?.value),
  1428 + 11004: Number(scw?.value) + width * 2,
  1429 + 11005: width * 2,
  1430 + 11006: Number(scw?.value) + width,
  1431 + 11007: Number(scw?.value) + width,
  1432 + };
  1433 + return topsMap[scw?.type] ?? 0;
1294 1434 }
1295   -
1296 1435 const one = ["6001", "3001", "4001", "7001", "3006", "4006", "6006", "7006", "3007", "4007", "6007", "7007"];
1297 1436 const four = ["6004", "3004", "4004", "7004"];
1298 1437 const five = ["6005", "3005", "4005", "7005"];
... ... @@ -1337,7 +1476,29 @@ const SvgBox = props => {
1337 1476  
1338 1477 const dZ = Number(zscw?.value) || 0;
1339 1478 const dY = Number(yscw?.value) || 0;
1340   -
  1479 + if (svg === 8) {
  1480 + const zxcw = val.find(x => x.sName === "左下插位组件");
  1481 + const yxcw = val.find(x => x.sName === "右下插位组件");
  1482 + const topsMap = {
  1483 + 14001: width + Number(zxcw?.value),
  1484 + 14002: Number(zxcw?.value),
  1485 + 14003: Number(zxcw?.value),
  1486 + 14004: Number(zxcw?.value) + width * 2,
  1487 + 14005: width * 2,
  1488 + 14006: Number(zxcw?.value) + width,
  1489 + 14007: Number(zxcw?.value) + width,
  1490 + };
  1491 + const topsMapRight = {
  1492 + 16001: width + Number(yxcw?.value),
  1493 + 16002: Number(yxcw?.value),
  1494 + 16003: Number(yxcw?.value),
  1495 + 16004: Number(yxcw?.value) + width * 2,
  1496 + 16005: width * 2,
  1497 + 16006: Number(yxcw?.value) + width,
  1498 + 16007: Number(yxcw?.value) + width,
  1499 + };
  1500 + return Math.max(topsMap[zxcw?.type], topsMapRight[yxcw?.type]) ?? 0;
  1501 + }
1341 1502 const one = ["6001", "3001", "4001", "7001", "3006", "4006", "6006", "7006", "3007", "4007", "6007", "7007"];
1342 1503 const four = ["6004", "3004", "4004", "7004"];
1343 1504 const five = ["6005", "3005", "4005", "7005"];
... ...
src/components/Common/CommonComponent/index.js
... ... @@ -23,7 +23,16 @@ import {
23 23 Tooltip,
24 24 Modal,
25 25 } from "antd-v4";
26   -import {DeleteOutlined, EyeOutlined, FilePdfOutlined, FileWordOutlined, FileExcelOutlined, FileOutlined, RightOutlined, PlaySquareOutlined } from "@ant-design/icons";
  26 +import {
  27 + DeleteOutlined,
  28 + EyeOutlined,
  29 + FilePdfOutlined,
  30 + FileWordOutlined,
  31 + FileExcelOutlined,
  32 + FileOutlined,
  33 + RightOutlined,
  34 + PlaySquareOutlined,
  35 +} from "@ant-design/icons";
27 36 import * as commonUtils from "@/utils/utils";
28 37 import styles from "@/index.less";
29 38 import Provinces from "@/assets/provinces.json";
... ... @@ -1282,26 +1291,26 @@ export default class CommonComponent extends Component {
1282 1291 showUploadList: false,
1283 1292 openFileDialogOnClick: this.props.enabled,
1284 1293 };
1285   - const imageUrl = sName === "sPackPath" ? this.props.record.sPackPath : sName === "sPackDetailPathUpLoad" ? this.props.record.sPackDetailPathUpLoad : this.props.record.sSvgPath;
  1294 + const imageUrl =
  1295 + sName === "sPackPath"
  1296 + ? this.props.record.sPackPath
  1297 + : sName === "sPackDetailPathUpLoad"
  1298 + ? this.props.record.sPackDetailPathUpLoad
  1299 + : this.props.record.sSvgPath;
1286 1300 return (
1287 1301 <div>
1288   - <Upload {...uploadProps}>
1289   - {imageUrl ? (
1290   - <Image
1291   - key={imageUrl}
1292   - src={imageUrl}
1293   - alt="avatar"
1294   - style={{ width: '100%' }}
1295   - preview={!this.props.enabled}
1296   - />
1297   -
  1302 + <Upload {...uploadProps}>
  1303 + {imageUrl ? (
  1304 + <Image key={imageUrl} src={imageUrl} alt="avatar" style={{ width: "100%" }} preview={!this.props.enabled} />
1298 1305 ) : (
1299 1306 <div>
1300 1307 <div style={{ marginTop: 8 }}>上传</div>
1301 1308 </div>
1302 1309 )}
1303   - </Upload>
1304   - <Button {...this.getUploadButtonProps()}><DeleteOutlined /></Button>
  1310 + </Upload>
  1311 + <Button {...this.getUploadButtonProps()}>
  1312 + <DeleteOutlined />
  1313 + </Button>
1305 1314 </div>
1306 1315 );
1307 1316 }
... ... @@ -1326,10 +1335,28 @@ export default class CommonComponent extends Component {
1326 1335 { name: "右贴边位", value: "dYTBW" },
1327 1336 { name: "右(下)插位组件", value: "dYXCW" },
1328 1337 ];
1329   - slaveData.forEach(x => {
  1338 + const doubleTitlieList1 = [
  1339 + { name: "左上插位组件", value: "dZSCW" },
  1340 + { name: "上插位组件", value: "dSCW" },
  1341 + { name: "右上插位组件", value: "dYSCW" },
  1342 + { name: "左偏移", value: "dZPY" },
  1343 + { name: "左插位组件", value: "dZCW" },
  1344 + { name: "左下插位组件", value: "dZXCW" },
  1345 + { name: "右偏移", value: "dYPY" },
  1346 + { name: "右插位组件", value: "dYCW" },
  1347 + { name: "右下插位组件", value: "dYXCW" },
  1348 + { name: "首盒长", value: "dSHC" },
  1349 + { name: "首盒宽", value: "dSHK" },
  1350 + { name: "次盒长", value: "dCHC" },
  1351 + { name: "次盒宽", value: "dCHK" },
  1352 + ];
  1353 + const boxTypes = this.props.record.sTypes;
  1354 + const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1;
  1355 +
  1356 + slaveData.forEach(x =>
1330 1357 boxList.push({
1331 1358 value: x.iValue,
1332   - sName: titleList1.find(item => item.value === x.sCode)?.name || "",
  1359 + sName: srcList.find(item => item.value === x.sCode)?.name || "",
1333 1360 isEditable: true,
1334 1361 isSelect: false,
1335 1362 selectValue: null,
... ... @@ -1337,9 +1364,10 @@ export default class CommonComponent extends Component {
1337 1364 selectImage: null,
1338 1365 type: x.sTypes || null,
1339 1366 show: true,
1340   - showName: x.sName, // 参数名称
1341   - });
1342   - });
  1367 + showName: x.sName,
  1368 + })
  1369 + );
  1370 +
1343 1371 tables.forEach(x => {
1344 1372 boxList.push({
1345 1373 value: x.value,
... ... @@ -1354,6 +1382,23 @@ export default class CommonComponent extends Component {
1354 1382 showName: x.name, // 参数名称
1355 1383 });
1356 1384 });
  1385 + // if (sDoubleSizeList && sDoubleSizeList.length) {
  1386 + // const titles = ["首盒长", "首盒宽", "次盒长", "次盒宽"];
  1387 + // sDoubleSizeList.forEach((x, i) => {
  1388 + // boxList.push({
  1389 + // value: x,
  1390 + // sName: titles[i],
  1391 + // isEditable: true,
  1392 + // isSelect: false,
  1393 + // selectValue: null,
  1394 + // selectLabel: "",
  1395 + // selectImage: null,
  1396 + // type: null,
  1397 + // show: true,
  1398 + // showName: titles[i], // 参数名称
  1399 + // });
  1400 + // });
  1401 + // }
1357 1402 const svgProps = {
1358 1403 ...this.props,
1359 1404 boxList,
... ... @@ -1361,6 +1406,8 @@ export default class CommonComponent extends Component {
1361 1406 dSvgBoxHeight: 100,
1362 1407 showNew: 1,
1363 1408 };
  1409 + console.log(boxList,'boxList');
  1410 +
1364 1411 return (
1365 1412 <div style={{ width: "100px", height: "100px" }}>
1366 1413 <SvgBox {...svgProps} />
... ... @@ -2928,7 +2975,7 @@ export default class CommonComponent extends Component {
2928 2975 const [changeData] = dropDownDataNew.filter(item => (!commonUtils.isEmpty(res) ? item[res] : item.sId) === value.toString());
2929 2976 if (!commonUtils.isEmpty(sAssignField)) {
2930 2977 /* 赋值数组 */
2931   -
  2978 +
2932 2979 const sAssignFieldObj = sAssignField.split(",");
2933 2980 if (commonUtils.isNotEmptyObject(changeData)) {
2934 2981 for (const child of sAssignFieldObj) {
... ... @@ -3526,7 +3573,7 @@ export default class CommonComponent extends Component {
3526 3573 ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}`
3527 3574 : picAddr[0]; /* 缩略图 */
3528 3575 // const dataPriviewUrl = `${commonConfig.server_host}file/download?savePathStr=${picAddr}&width=800&&height=500&sModelsId=100&token=${token}`; /* 预览 */
3529   - const officeFileTypeList = ['PDF', 'DOCX', 'XLSX', 'MP4', 'WEBM', 'OGG'];
  3576 + const officeFileTypeList = ["PDF", "DOCX", "XLSX", "MP4", "WEBM", "OGG"];
3530 3577 const imgTypeList = ["PNG", "SVG", "JPG", "JPEG", "GIF", "BMP", "TIFF", "ICO"];
3531 3578 const officeFileType = picAddr[0].split(".").pop().toUpperCase();
3532 3579 let fileIcon = <FilePdfOutlined />;
... ... @@ -3534,7 +3581,7 @@ export default class CommonComponent extends Component {
3534 3581 fileIcon = <FileWordOutlined />;
3535 3582 } else if (officeFileType === "XLSX") {
3536 3583 fileIcon = <FileExcelOutlined />;
3537   - } else if (['MP4', 'WEBM', 'OGG'].includes(officeFileType)) {
  3584 + } else if (["MP4", "WEBM", "OGG"].includes(officeFileType)) {
3538 3585 fileIcon = <PlaySquareOutlined />;
3539 3586 }
3540 3587 let imgBox1 = "";
... ...
src/components/Common/Typesetting/typesetting.js
... ... @@ -143,6 +143,22 @@ const Typesetting = props =&gt; {
143 143 { name: "右贴边位", value: "dYTBW" },
144 144 { name: "右(下)插位组件", value: "dYXCW" },
145 145 ];
  146 + const doubleTitlieList1 = [
  147 + { name: "左上插位组件", value: "dZSCW" },
  148 + { name: "上插位组件", value: "dSCW" },
  149 + { name: "右上插位组件", value: "dYSCW" },
  150 + { name: "左偏移", value: "dZPY" },
  151 + { name: "左插位组件", value: "dZCW" },
  152 + { name: "左下插位组件", value: "dZXCW" },
  153 + { name: "右偏移", value: "dYPY" },
  154 + { name: "右插位组件", value: "dYCW" },
  155 + { name: "右下插位组件", value: "dYXCW" },
  156 + { name: "首盒长", value: "dSHC" },
  157 + { name: "首盒宽", value: "dSHK" },
  158 + { name: "次盒长", value: "dCHC" },
  159 + { name: "次盒宽", value: "dCHK" },
  160 + ];
  161 + const srcList = Number(slaveRowData.sTypes) === 8 ? doubleTitlieList1 : titleList1;
146 162 slaveNewData.forEach(x => {
147 163 let key = 0;
148 164 if (x.sAssignFormula) {
... ... @@ -152,7 +168,7 @@ const Typesetting = props =&gt; {
152 168 }
153 169 boxList.push({
154 170 value: key,
155   - sName: titleList1.find(item => item.value === x.sName)?.name || "",
  171 + sName: srcList.find(item => item.value === x.sName)?.name || "",
156 172 isEditable: true,
157 173 isSelect: false,
158 174 selectValue: null,
... ... @@ -160,7 +176,7 @@ const Typesetting = props =&gt; {
160 176 selectImage: null,
161 177 type: x.sTypes || null,
162 178 show: true,
163   - sCode: titleList1.find(item => item.value === x.sName)?.value || "",
  179 + sCode: srcList.find(item => item.value === x.sName)?.value || "",
164 180 showName: x.showName, // 参数名称
165 181 });
166 182 });
... ... @@ -455,12 +471,12 @@ const Typesetting = props =&gt; {
455 471 const calculateLeftPosition = (col, reference, isVertical, leftPosition, dYBJJ, dSLengthOffset) => {
456 472 if (isVertical) {
457 473 if (reference) {
458   - return col === 0 ? leftPosition : leftPosition + (dYBJJ * col);
  474 + return col === 0 ? leftPosition : leftPosition + dYBJJ * col;
459 475 }
460 476 return col === 0 ? leftPosition : leftPosition + (boxLengthOffset + dYBJJ) * col;
461 477 } else {
462 478 if (reference) {
463   - return col === 0 ? leftPosition : leftPosition + (dYBJJ * col);
  479 + return col === 0 ? leftPosition : leftPosition + dYBJJ * col;
464 480 }
465 481 return col === 0 ? leftPosition : leftPosition + (boxLengthOffset + dYBJJ) * col + dSLengthOffset * col;
466 482 }
... ... @@ -549,9 +565,8 @@ const Typesetting = props =&gt; {
549 565 leftPosition = cols * (innerWidthCombined + boxLengthOffset);
550 566 } else {
551 567 topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset);
552   -
553   - leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset+dYBJJ) ;
554 568  
  569 + leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset + dYBJJ);
555 570 }
556 571 innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon));
557 572 }
... ... @@ -576,7 +591,9 @@ const Typesetting = props =&gt; {
576 591 // 判断列是否是单独的
577 592  
578 593 const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长
579   - const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0)).toFixed(2);
  594 + const newMaterialWidth = parseFloat(
  595 + propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0)
  596 + ).toFixed(2);
580 597  
581 598 // 计算开数
582 599 let dSinglePQty = isVertical
... ... @@ -1085,7 +1102,7 @@ const Typesetting = props =&gt; {
1085 1102 width: `${modalWidth}`,
1086 1103 padding: "1px",
1087 1104 }}
1088   - style={{top: 0}}
  1105 + style={{ top: 0 }}
1089 1106 onCancel={handleCancel}
1090 1107 >
1091 1108 <div
... ...
src/components/QuickQuote/index.jsx
... ... @@ -2269,6 +2269,7 @@ const BoxComponent = props =&gt; {
2269 2269 { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null },
2270 2270 { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null },
2271 2271 ];
  2272 + const boxTypes = slaveRowData.sTypes;
2272 2273 const titleList1 = [
2273 2274 { name: "上方盒舌", value: "dSFHS" },
2274 2275 { name: "盒底组件", value: "dHDC" },
... ... @@ -2280,6 +2281,22 @@ const BoxComponent = props =&gt; {
2280 2281 { name: "右贴边位", value: "dYTBW" },
2281 2282 { name: "右(下)插位组件", value: "dYXCW" },
2282 2283 ];
  2284 + const doubleTitlieList1 = [
  2285 + { name: "左上插位组件", value: "dZSCW" },
  2286 + { name: "上插位组件", value: "dSCW" },
  2287 + { name: "右上插位组件", value: "dYSCW" },
  2288 + { name: "左偏移", value: "dZPY" },
  2289 + { name: "左插位组件", value: "dZCW" },
  2290 + { name: "左下插位组件", value: "dZXCW" },
  2291 + { name: "右偏移", value: "dYPY" },
  2292 + { name: "右插位组件", value: "dYCW" },
  2293 + { name: "右下插位组件", value: "dYXCW" },
  2294 + { name: "首盒长", value: "dSHC" },
  2295 + { name: "首盒宽", value: "dSHK" },
  2296 + { name: "次盒长", value: "dCHC" },
  2297 + { name: "次盒宽", value: "dCHK" },
  2298 + ];
  2299 + const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1;
2283 2300 const evaluateFormula = (formula, variables) => {
2284 2301 if (!formula) return 0; // 如果公式为空,返回0
2285 2302 try {
... ... @@ -2322,7 +2339,7 @@ const BoxComponent = props =&gt; {
2322 2339 }
2323 2340 boxList.push({
2324 2341 value: key,
2325   - sName: titleList1.find(item => item.value === x.sName)?.name || "",
  2342 + sName: srcList.find(item => item.value === x.sName)?.name || "",
2326 2343 isEditable: true,
2327 2344 isSelect: false,
2328 2345 selectValue: null,
... ... @@ -2348,7 +2365,6 @@ const BoxComponent = props =&gt; {
2348 2365 });
2349 2366 });
2350 2367 }
2351   -
2352 2368 const svgProps = {
2353 2369 ...props,
2354 2370 boxList,
... ... @@ -3194,10 +3210,26 @@ const BoxModelSelectedModal = props =&gt; {
3194 3210 { name: "右贴边位", value: "dYTBW" },
3195 3211 { name: "右(下)插位组件", value: "dYXCW" },
3196 3212 ];
  3213 + const doubleTitlieList1 = [
  3214 + { name: "左上插位组件", value: "dZSCW" },
  3215 + { name: "上插位组件", value: "dSCW" },
  3216 + { name: "右上插位组件", value: "dYSCW" },
  3217 + { name: "左偏移", value: "dZPY" },
  3218 + { name: "左插位组件", value: "dZCW" },
  3219 + { name: "左下插位组件", value: "dZXCW" },
  3220 + { name: "右偏移", value: "dYPY" },
  3221 + { name: "右插位组件", value: "dYCW" },
  3222 + { name: "右下插位组件", value: "dYXCW" },
  3223 + { name: "首盒长", value: "dSHC" },
  3224 + { name: "首盒宽", value: "dSHK" },
  3225 + { name: "次盒长", value: "dCHC" },
  3226 + { name: "次盒宽", value: "dCHK" },
  3227 + ];
  3228 + const srcList = Number(sTypes) === 8 ? doubleTitlieList1 : titleList1;
3197 3229 slaveData.forEach(x => {
3198 3230 boxList.push({
3199 3231 value: x.iValue || x.sDefault,
3200   - sName: titleList1.find(item => item.value === x.sCode || item.value === x.sName)?.name || "",
  3232 + sName: srcList.find(item => item.value === x.sCode || item.value === x.sName)?.name || "",
3201 3233 isEditable: true,
3202 3234 isSelect: false,
3203 3235 selectValue: null,
... ... @@ -3229,6 +3261,8 @@ const BoxModelSelectedModal = props =&gt; {
3229 3261 dSvgBoxHeight: 100,
3230 3262 showNew: 1,
3231 3263 };
  3264 + console.log(boxList,srcList,'getSvgProps');
  3265 +
3232 3266 return svgProps;
3233 3267 };
3234 3268 const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected));
... ... @@ -3551,6 +3585,7 @@ const GetBestAlgorithm = props =&gt; {
3551 3585 { name: "盒宽", value: W, type: null },
3552 3586 { name: "盒高", value: D, type: null },
3553 3587 ];
  3588 + const boxTypes = slaveRowData.sTypes;
3554 3589 const titleList1 = [
3555 3590 { name: "上方盒舌", value: "dSFHS" },
3556 3591 { name: "盒底组件", value: "dHDC" },
... ... @@ -3562,6 +3597,22 @@ const GetBestAlgorithm = props =&gt; {
3562 3597 { name: "右贴边位", value: "dYTBW" },
3563 3598 { name: "右(下)插位组件", value: "dYXCW" },
3564 3599 ];
  3600 + const doubleTitlieList1 = [
  3601 + { name: "左上插位组件", value: "dZSCW" },
  3602 + { name: "上插位组件", value: "dSCW" },
  3603 + { name: "右上插位组件", value: "dYSCW" },
  3604 + { name: "左偏移", value: "dZPY" },
  3605 + { name: "左插位组件", value: "dZCW" },
  3606 + { name: "左下插位组件", value: "dZXCW" },
  3607 + { name: "右偏移", value: "dYPY" },
  3608 + { name: "右插位组件", value: "dYCW" },
  3609 + { name: "右下插位组件", value: "dYXCW" },
  3610 + { name: "首盒长", value: "dSHC" },
  3611 + { name: "首盒宽", value: "dSHK" },
  3612 + { name: "次盒长", value: "dCHC" },
  3613 + { name: "次盒宽", value: "dCHK" },
  3614 + ];
  3615 + const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1;
3565 3616 slaveNewData.forEach(x => {
3566 3617 let key = 0;
3567 3618 if (x.sAssignFormula) {
... ... @@ -3571,7 +3622,7 @@ const GetBestAlgorithm = props =&gt; {
3571 3622 }
3572 3623 boxList.push({
3573 3624 value: key,
3574   - sName: titleList1.find(item => item.value === x.sName)?.name || "",
  3625 + sName: srcList.find(item => item.value === x.sName)?.name || "",
3575 3626 isEditable: true,
3576 3627 isSelect: false,
3577 3628 selectValue: null,
... ... @@ -3579,7 +3630,7 @@ const GetBestAlgorithm = props =&gt; {
3579 3630 selectImage: null,
3580 3631 type: x.sTypes || null,
3581 3632 show: true,
3582   - sCode: titleList1.find(item => item.value === x.sName)?.value || "",
  3633 + sCode: srcList.find(item => item.value === x.sName)?.value || "",
3583 3634 showName: x.showName, // 参数名称
3584 3635 });
3585 3636 });
... ...