diff --git a/src/components/Common/BoxDesignCompontent/index.js b/src/components/Common/BoxDesignCompontent/index.js index cd3e858..837c82c 100644 --- a/src/components/Common/BoxDesignCompontent/index.js +++ b/src/components/Common/BoxDesignCompontent/index.js @@ -197,6 +197,10 @@ const BoxDesignCompontent = baseProps => { { name: "右偏移", value: "dYPY" }, { name: "右插位组件", value: "dYCW" }, { name: "右下插位组件", value: "dYXCW" }, + { name: "首盒长", value: "dSHC" }, + { name: "首盒宽", value: "dSHK" }, + { name: "次盒长", value: "dCHC" }, + { name: "次盒宽", value: "dCHK" }, ]; const newBoxList = []; @@ -269,8 +273,10 @@ const BoxDesignCompontent = baseProps => { } // 盒身信息 if (masterData) { - console.log(masterData,'masterData'); - + const headLength = slaveData.find(item => item.sCode === "dSHC")?.iValue + const headWidth = slaveData.find(item => item.sCode === "dSHK")?.iValue + const orderLength = slaveData.find(item => item.sCode === "dCHC")?.iValue + const orderWidth = slaveData.find(item => item.sCode === "dCHK")?.iValue newBoxList.forEach((item, index) => { if (item.sName === "盒身") { newBoxList[index].value = masterData.sBoxBody; @@ -285,13 +291,13 @@ const BoxDesignCompontent = baseProps => { } else if (item.sName === "盒型名称") { newBoxList[index].value = masterData.sName; } else if (item.sName === "首盒长") { - // newBoxList[index].value = masterData.sName; + newBoxList[index].value = headLength; } else if (item.sName === "首盒宽") { - // newBoxList[index].value = masterData.sName; + newBoxList[index].value = headWidth; } else if (item.sName === "次盒长") { - // newBoxList[index].value = masterData.sName; + newBoxList[index].value = orderLength; } else if (item.sName === "次盒宽") { - // newBoxList[index].value = masterData.sName; + newBoxList[index].value = orderWidth; } }); } @@ -530,6 +536,7 @@ const BoxDesignCompontent = baseProps => { let sWidthFormula = ""; const boxType = boxList.find(item => item.sName === "盒身")?.type; if (boxType === "8") { + } else { const boxLength = Number(boxList.find(item => item.sName === "盒长")?.value); const boxWidth = Number(boxList.find(item => item.sName === "盒宽")?.value); @@ -852,6 +859,7 @@ const BoxDesignCompontent = baseProps => { } } + // const sDoubleSize = JSON.stringify([headLength,headWidth,orderLength,orderWidth]) // 存储盒身数据 主表 const newMasterData = { ...masterData, diff --git a/src/components/Common/BoxDesignCompontent/svg.js b/src/components/Common/BoxDesignCompontent/svg.js index aaefb2b..af6dca0 100644 --- a/src/components/Common/BoxDesignCompontent/svg.js +++ b/src/components/Common/BoxDesignCompontent/svg.js @@ -127,9 +127,15 @@ const SvgBox = props => { // 展宽 if (boxList && boxList.length) { // 如果存在部件和盒舌 取最大的 + const top = topOffect(boxList, boxLength, boxWidth, boxHeight); const bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight); max = Number(top) + Number(bottom); + if (Number(svgType) === 8) { + const top = topOffect(boxList, headLength, headWidth); + const bottom = bottomOffect(boxList, orderLength, orderWidth); + max = Number(top) + Number(bottom); + } } let viewBoxHeight = Number(boxHeight) + max; @@ -262,11 +268,40 @@ const SvgBox = props => { // viewBoxWidth = boxWidth + leftValue + rightValue; // viewBoxHeight = boxLength + dZSCW + dYXCW; } else if (Number(svgType) === 8) { - const top = topOffect(boxList, headLength, headWidth); - viewBoxWidth = Number(headLength); - viewBoxHeight = Number(headWidth) + Number(orderWidth) + top; - console.log("🚀 ~ initSVG ~ viewBoxHeight:", viewBoxHeight); + const getTop = (item, offset = 0) => { + const map = { + 10001: headWidth + Number(item?.value), + 10002: Number(item?.value), + 10003: Number(item?.value), + 10004: Number(item?.value) + headWidth * 2, + 10005: headWidth * 2, + 10006: Number(item?.value) + headWidth, + 10007: Number(item?.value) + headWidth, + }; + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理 + }; + + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件")); + const topRight = getTop( + boxList.find(x => x.sName === "右上插位组件"), + 2000 + ); + const topLength = headLength + topLeft + topRight; + const bottomLeft = getTop( + boxList.find(x => x.sName === "左插位组件"), + 3000 + ); + const bottomRight = getTop( + boxList.find(x => x.sName === "右插位组件"), + 5000 + ); + const bottomLength = orderLength * 2 + bottomLeft + bottomRight; + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0; + const rightOffect = boxList.find(x => x.sName === "右偏移")?.value || 0; + viewBoxWidth = Math.max(topLength, bottomLength) + Number(leftOffect) + Number(rightOffect); + viewBoxHeight = Number(headWidth) + Number(orderWidth) + max; } + // 计算缩放比例 let scale = 1; if (props.showNew === 0) { @@ -277,7 +312,12 @@ const SvgBox = props => { let ySvg = dSvgBoxHeight ? topOffect(boxList, boxLength, boxWidth, boxHeight) * scale : topOffect(boxList, boxLength, boxWidth, boxHeight) * scale; - const bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight); + let bottom = 0; + if (Number(svgType) !== 8) { + bottom = bottomOffect(boxList, boxLength, boxWidth, boxHeight); + } else { + bottom = bottomOffect(boxList, orderLength, orderWidth); + } if (Number(svgType) === 4) { ySvg = ySvg + boxHeight * scale; } else if (Number(svgType) === 8) { @@ -285,8 +325,31 @@ const SvgBox = props => { } ySvg = ySvg + 50 * scale; let xSvg = 0; - if (Number(svgType === 7)) { + if (Number(svgType) === 7) { xSvg = scaledWidth + dZXCW * scale; + } else if (Number(svgType) === 8) { + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0; + // 计算首盒部件与次盒部件尺寸 + const getTop = (item, offset = 0) => { + const map = { + 10001: headWidth + Number(item?.value), + 10002: Number(item?.value), + 10003: Number(item?.value), + 10004: Number(item?.value) + headWidth * 2, + 10005: headWidth * 2, + 10006: Number(item?.value) + headWidth, + 10007: Number(item?.value) + headWidth, + }; + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理 + }; + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件")); + const topLength = headLength + topLeft; + const bottomLeft = getTop( + boxList.find(x => x.sName === "左插位组件"), + 3000 + ); + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); + xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength)); } else { xSvg = zbtb?.value; } @@ -310,12 +373,34 @@ const SvgBox = props => { } ySvg = ySvg + 50 * scale; let xSvg = 0; - if (Number(svgType === 7)) { + if (Number(svgType) === 7) { xSvg = scaledWidth + dZXCW * scale; + } else if (Number(svgType) === 8) { + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0; + // 计算首盒部件与次盒部件尺寸 + const getTop = (item, offset = 0) => { + const map = { + 10001: headWidth + Number(item?.value), + 10002: Number(item?.value), + 10003: Number(item?.value), + 10004: Number(item?.value) + headWidth * 2, + 10005: headWidth * 2, + 10006: Number(item?.value) + headWidth, + 10007: Number(item?.value) + headWidth, + }; + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理 + }; + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件")); + const topLength = headLength + topLeft; + const bottomLeft = getTop( + boxList.find(x => x.sName === "左插位组件"), + 3000 + ); + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); + xSvg = Math.max(Math.abs(bottomLength), Math.abs(topLength)); } else { xSvg = zbtb?.value; } - svg.setAttribute( "viewBox", `${-(dSvgBoxWidth ? xSvg : viewBoxWidth / 2)} ${dSvgBoxWidth ? -0 : -ySvg} ${dSvgBoxWidth ? dSvgBoxWidth : 500} ${ @@ -359,9 +444,35 @@ const SvgBox = props => { ySvg = topSize; } else if (Number(svgType) === 6) { leftSize = 0; + } else if (Number(svgType) === 8) { + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0; + // 计算首盒部件与次盒部件尺寸 + const getTop = (item, offset = 0) => { + const map = { + 10001: headWidth + Number(item?.value), + 10002: Number(item?.value), + 10003: Number(item?.value), + 10004: Number(item?.value) + headWidth * 2, + 10005: headWidth * 2, + 10006: Number(item?.value) + headWidth, + 10007: Number(item?.value) + headWidth, + }; + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理 + }; + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件")); + const topLength = topLeft; + const bottomLeft = getTop( + boxList.find(x => x.sName === "左插位组件"), + 3000 + ); + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); + leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength)); + ySvg = topOffect(boxList, headLength, headWidth); } else { leftSize = zbtb?.value; } + console.log(viewBoxWidth, viewBoxHeight, "viewBoxHeight"); + svg.setAttribute("viewBox", `${-(leftSize * scale) || 0} ${-ySvg} ${viewBoxWidth + 2} ${viewBoxHeight + 2}`); svg.setAttribute("width", `${viewBoxWidth}px`); svg.setAttribute("height", `${viewBoxHeight}px`); @@ -410,6 +521,30 @@ const SvgBox = props => { ySvg = topSize; } else if (Number(svgType) === 6) { leftSize = 0; + } else if (Number(svgType) === 8) { + const leftOffect = boxList.find(x => x.sName === "左偏移")?.value || 0; + // 计算首盒部件与次盒部件尺寸 + const getTop = (item, offset = 0) => { + const map = { + 10001: headWidth + Number(item?.value), + 10002: Number(item?.value), + 10003: Number(item?.value), + 10004: Number(item?.value) + headWidth * 2, + 10005: headWidth * 2, + 10006: Number(item?.value) + headWidth, + 10007: Number(item?.value) + headWidth, + }; + return map[item?.type - offset] ?? 0; // 根据偏移量统一处理 + }; + const topLeft = getTop(boxList.find(x => x.sName === "左上插位组件")); + const topLength = topLeft; + const bottomLeft = getTop( + boxList.find(x => x.sName === "左插位组件"), + 3000 + ); + const bottomLength = headLength / 2 - orderLength + -bottomLeft - Number(leftOffect); + leftSize = Math.max(Math.abs(bottomLength), Math.abs(topLength)); + ySvg = topOffect(boxList, headLength, headWidth); } else { leftSize = zbtb?.value; } @@ -1286,13 +1421,17 @@ const SvgBox = props => { if (svg === 8) { const scw = val.find(x => x.sName === "上插位组件"); - let tops = 0; - if (scw?.type === "11001") { - tops = width + Number(scw.value); - } - return tops; + const topsMap = { + 11001: width + Number(scw?.value), + 11002: Number(scw?.value), + 11003: Number(scw?.value), + 11004: Number(scw?.value) + width * 2, + 11005: width * 2, + 11006: Number(scw?.value) + width, + 11007: Number(scw?.value) + width, + }; + return topsMap[scw?.type] ?? 0; } - const one = ["6001", "3001", "4001", "7001", "3006", "4006", "6006", "7006", "3007", "4007", "6007", "7007"]; const four = ["6004", "3004", "4004", "7004"]; const five = ["6005", "3005", "4005", "7005"]; @@ -1337,7 +1476,29 @@ const SvgBox = props => { const dZ = Number(zscw?.value) || 0; const dY = Number(yscw?.value) || 0; - + if (svg === 8) { + const zxcw = val.find(x => x.sName === "左下插位组件"); + const yxcw = val.find(x => x.sName === "右下插位组件"); + const topsMap = { + 14001: width + Number(zxcw?.value), + 14002: Number(zxcw?.value), + 14003: Number(zxcw?.value), + 14004: Number(zxcw?.value) + width * 2, + 14005: width * 2, + 14006: Number(zxcw?.value) + width, + 14007: Number(zxcw?.value) + width, + }; + const topsMapRight = { + 16001: width + Number(yxcw?.value), + 16002: Number(yxcw?.value), + 16003: Number(yxcw?.value), + 16004: Number(yxcw?.value) + width * 2, + 16005: width * 2, + 16006: Number(yxcw?.value) + width, + 16007: Number(yxcw?.value) + width, + }; + return Math.max(topsMap[zxcw?.type], topsMapRight[yxcw?.type]) ?? 0; + } const one = ["6001", "3001", "4001", "7001", "3006", "4006", "6006", "7006", "3007", "4007", "6007", "7007"]; const four = ["6004", "3004", "4004", "7004"]; const five = ["6005", "3005", "4005", "7005"]; diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 91d8530..178bf16 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -23,7 +23,16 @@ import { Tooltip, Modal, } from "antd-v4"; -import {DeleteOutlined, EyeOutlined, FilePdfOutlined, FileWordOutlined, FileExcelOutlined, FileOutlined, RightOutlined, PlaySquareOutlined } from "@ant-design/icons"; +import { + DeleteOutlined, + EyeOutlined, + FilePdfOutlined, + FileWordOutlined, + FileExcelOutlined, + FileOutlined, + RightOutlined, + PlaySquareOutlined, +} from "@ant-design/icons"; import * as commonUtils from "@/utils/utils"; import styles from "@/index.less"; import Provinces from "@/assets/provinces.json"; @@ -1282,26 +1291,26 @@ export default class CommonComponent extends Component { showUploadList: false, openFileDialogOnClick: this.props.enabled, }; - const imageUrl = sName === "sPackPath" ? this.props.record.sPackPath : sName === "sPackDetailPathUpLoad" ? this.props.record.sPackDetailPathUpLoad : this.props.record.sSvgPath; + const imageUrl = + sName === "sPackPath" + ? this.props.record.sPackPath + : sName === "sPackDetailPathUpLoad" + ? this.props.record.sPackDetailPathUpLoad + : this.props.record.sSvgPath; return (
- - {imageUrl ? ( - avatar - + + {imageUrl ? ( + avatar ) : (
上传
)} -
- +
+
); } @@ -1326,10 +1335,28 @@ export default class CommonComponent extends Component { { name: "右贴边位", value: "dYTBW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; - slaveData.forEach(x => { + const doubleTitlieList1 = [ + { name: "左上插位组件", value: "dZSCW" }, + { name: "上插位组件", value: "dSCW" }, + { name: "右上插位组件", value: "dYSCW" }, + { name: "左偏移", value: "dZPY" }, + { name: "左插位组件", value: "dZCW" }, + { name: "左下插位组件", value: "dZXCW" }, + { name: "右偏移", value: "dYPY" }, + { name: "右插位组件", value: "dYCW" }, + { name: "右下插位组件", value: "dYXCW" }, + { name: "首盒长", value: "dSHC" }, + { name: "首盒宽", value: "dSHK" }, + { name: "次盒长", value: "dCHC" }, + { name: "次盒宽", value: "dCHK" }, + ]; + const boxTypes = this.props.record.sTypes; + const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1; + + slaveData.forEach(x => boxList.push({ value: x.iValue, - sName: titleList1.find(item => item.value === x.sCode)?.name || "", + sName: srcList.find(item => item.value === x.sCode)?.name || "", isEditable: true, isSelect: false, selectValue: null, @@ -1337,9 +1364,10 @@ export default class CommonComponent extends Component { selectImage: null, type: x.sTypes || null, show: true, - showName: x.sName, // 参数名称 - }); - }); + showName: x.sName, + }) + ); + tables.forEach(x => { boxList.push({ value: x.value, @@ -1354,6 +1382,23 @@ export default class CommonComponent extends Component { showName: x.name, // 参数名称 }); }); + // if (sDoubleSizeList && sDoubleSizeList.length) { + // const titles = ["首盒长", "首盒宽", "次盒长", "次盒宽"]; + // sDoubleSizeList.forEach((x, i) => { + // boxList.push({ + // value: x, + // sName: titles[i], + // isEditable: true, + // isSelect: false, + // selectValue: null, + // selectLabel: "", + // selectImage: null, + // type: null, + // show: true, + // showName: titles[i], // 参数名称 + // }); + // }); + // } const svgProps = { ...this.props, boxList, @@ -1361,6 +1406,8 @@ export default class CommonComponent extends Component { dSvgBoxHeight: 100, showNew: 1, }; + console.log(boxList,'boxList'); + return (
@@ -2928,7 +2975,7 @@ export default class CommonComponent extends Component { const [changeData] = dropDownDataNew.filter(item => (!commonUtils.isEmpty(res) ? item[res] : item.sId) === value.toString()); if (!commonUtils.isEmpty(sAssignField)) { /* 赋值数组 */ - + const sAssignFieldObj = sAssignField.split(","); if (commonUtils.isNotEmptyObject(changeData)) { for (const child of sAssignFieldObj) { @@ -3526,7 +3573,7 @@ export default class CommonComponent extends Component { ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` : picAddr[0]; /* 缩略图 */ // const dataPriviewUrl = `${commonConfig.server_host}file/download?savePathStr=${picAddr}&width=800&&height=500&sModelsId=100&token=${token}`; /* 预览 */ - const officeFileTypeList = ['PDF', 'DOCX', 'XLSX', 'MP4', 'WEBM', 'OGG']; + const officeFileTypeList = ["PDF", "DOCX", "XLSX", "MP4", "WEBM", "OGG"]; const imgTypeList = ["PNG", "SVG", "JPG", "JPEG", "GIF", "BMP", "TIFF", "ICO"]; const officeFileType = picAddr[0].split(".").pop().toUpperCase(); let fileIcon = ; @@ -3534,7 +3581,7 @@ export default class CommonComponent extends Component { fileIcon = ; } else if (officeFileType === "XLSX") { fileIcon = ; - } else if (['MP4', 'WEBM', 'OGG'].includes(officeFileType)) { + } else if (["MP4", "WEBM", "OGG"].includes(officeFileType)) { fileIcon = ; } let imgBox1 = ""; diff --git a/src/components/Common/Typesetting/typesetting.js b/src/components/Common/Typesetting/typesetting.js index 07498c8..aec3e59 100644 --- a/src/components/Common/Typesetting/typesetting.js +++ b/src/components/Common/Typesetting/typesetting.js @@ -143,6 +143,22 @@ const Typesetting = props => { { name: "右贴边位", value: "dYTBW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; + const doubleTitlieList1 = [ + { name: "左上插位组件", value: "dZSCW" }, + { name: "上插位组件", value: "dSCW" }, + { name: "右上插位组件", value: "dYSCW" }, + { name: "左偏移", value: "dZPY" }, + { name: "左插位组件", value: "dZCW" }, + { name: "左下插位组件", value: "dZXCW" }, + { name: "右偏移", value: "dYPY" }, + { name: "右插位组件", value: "dYCW" }, + { name: "右下插位组件", value: "dYXCW" }, + { name: "首盒长", value: "dSHC" }, + { name: "首盒宽", value: "dSHK" }, + { name: "次盒长", value: "dCHC" }, + { name: "次盒宽", value: "dCHK" }, + ]; + const srcList = Number(slaveRowData.sTypes) === 8 ? doubleTitlieList1 : titleList1; slaveNewData.forEach(x => { let key = 0; if (x.sAssignFormula) { @@ -152,7 +168,7 @@ const Typesetting = props => { } boxList.push({ value: key, - sName: titleList1.find(item => item.value === x.sName)?.name || "", + sName: srcList.find(item => item.value === x.sName)?.name || "", isEditable: true, isSelect: false, selectValue: null, @@ -160,7 +176,7 @@ const Typesetting = props => { selectImage: null, type: x.sTypes || null, show: true, - sCode: titleList1.find(item => item.value === x.sName)?.value || "", + sCode: srcList.find(item => item.value === x.sName)?.value || "", showName: x.showName, // 参数名称 }); }); @@ -455,12 +471,12 @@ const Typesetting = props => { const calculateLeftPosition = (col, reference, isVertical, leftPosition, dYBJJ, dSLengthOffset) => { if (isVertical) { if (reference) { - return col === 0 ? leftPosition : leftPosition + (dYBJJ * col); + return col === 0 ? leftPosition : leftPosition + dYBJJ * col; } return col === 0 ? leftPosition : leftPosition + (boxLengthOffset + dYBJJ) * col; } else { if (reference) { - return col === 0 ? leftPosition : leftPosition + (dYBJJ * col); + return col === 0 ? leftPosition : leftPosition + dYBJJ * col; } return col === 0 ? leftPosition : leftPosition + (boxLengthOffset + dYBJJ) * col + dSLengthOffset * col; } @@ -549,9 +565,8 @@ const Typesetting = props => { leftPosition = cols * (innerWidthCombined + boxLengthOffset); } else { topPosition = index * (innerHeightCombined + boxWidthOffset + dSWidthOffset); - - leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset+dYBJJ) ; + leftPosition = cols * (innerWidthCombined + boxLengthOffset + dSLengthOffset + dYBJJ); } innerDivs.push(createDiv(cols - 1, index, 3, leftPosition, topPosition, iFAngle, DisableMateriallIcon)); } @@ -576,7 +591,9 @@ const Typesetting = props => { // 判断列是否是单独的 const newMaterialLength = parseFloat(propsDataLeft + (remaining ? jInnerWidth : innerWidthCombined) + dZBLB + dYBLB).toFixed(2); // 原纸长 - const newMaterialWidth = parseFloat(propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0)).toFixed(2); + const newMaterialWidth = parseFloat( + propsDataTop + propsDataHeight + dSBLB + dXBLB - (isVertical ? 0 : rows >= 1 ? (remaining ? 0 : dXBJJ) : 0) + ).toFixed(2); // 计算开数 let dSinglePQty = isVertical @@ -1085,7 +1102,7 @@ const Typesetting = props => { width: `${modalWidth}`, padding: "1px", }} - style={{top: 0}} + style={{ top: 0 }} onCancel={handleCancel} >
{ { name: "盒宽", value: slaveRowData.dW ? slaveRowData.dW : masterData.dWidth ? Number(masterData.dWidth) : 0, type: null }, { name: "盒高", value: masterData.dHeight ? Number(masterData.dHeight) : 0, type: null }, ]; + const boxTypes = slaveRowData.sTypes; const titleList1 = [ { name: "上方盒舌", value: "dSFHS" }, { name: "盒底组件", value: "dHDC" }, @@ -2280,6 +2281,22 @@ const BoxComponent = props => { { name: "右贴边位", value: "dYTBW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; + const doubleTitlieList1 = [ + { name: "左上插位组件", value: "dZSCW" }, + { name: "上插位组件", value: "dSCW" }, + { name: "右上插位组件", value: "dYSCW" }, + { name: "左偏移", value: "dZPY" }, + { name: "左插位组件", value: "dZCW" }, + { name: "左下插位组件", value: "dZXCW" }, + { name: "右偏移", value: "dYPY" }, + { name: "右插位组件", value: "dYCW" }, + { name: "右下插位组件", value: "dYXCW" }, + { name: "首盒长", value: "dSHC" }, + { name: "首盒宽", value: "dSHK" }, + { name: "次盒长", value: "dCHC" }, + { name: "次盒宽", value: "dCHK" }, + ]; + const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1; const evaluateFormula = (formula, variables) => { if (!formula) return 0; // 如果公式为空,返回0 try { @@ -2322,7 +2339,7 @@ const BoxComponent = props => { } boxList.push({ value: key, - sName: titleList1.find(item => item.value === x.sName)?.name || "", + sName: srcList.find(item => item.value === x.sName)?.name || "", isEditable: true, isSelect: false, selectValue: null, @@ -2348,7 +2365,6 @@ const BoxComponent = props => { }); }); } - const svgProps = { ...props, boxList, @@ -3194,10 +3210,26 @@ const BoxModelSelectedModal = props => { { name: "右贴边位", value: "dYTBW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; + const doubleTitlieList1 = [ + { name: "左上插位组件", value: "dZSCW" }, + { name: "上插位组件", value: "dSCW" }, + { name: "右上插位组件", value: "dYSCW" }, + { name: "左偏移", value: "dZPY" }, + { name: "左插位组件", value: "dZCW" }, + { name: "左下插位组件", value: "dZXCW" }, + { name: "右偏移", value: "dYPY" }, + { name: "右插位组件", value: "dYCW" }, + { name: "右下插位组件", value: "dYXCW" }, + { name: "首盒长", value: "dSHC" }, + { name: "首盒宽", value: "dSHK" }, + { name: "次盒长", value: "dCHC" }, + { name: "次盒宽", value: "dCHK" }, + ]; + const srcList = Number(sTypes) === 8 ? doubleTitlieList1 : titleList1; slaveData.forEach(x => { boxList.push({ value: x.iValue || x.sDefault, - sName: titleList1.find(item => item.value === x.sCode || item.value === x.sName)?.name || "", + sName: srcList.find(item => item.value === x.sCode || item.value === x.sName)?.name || "", isEditable: true, isSelect: false, selectValue: null, @@ -3229,6 +3261,8 @@ const BoxModelSelectedModal = props => { dSvgBoxHeight: 100, showNew: 1, }; + console.log(boxList,srcList,'getSvgProps'); + return svgProps; }; const selectBoxList = boxData.filter(item => (boxTypeSelected === "全部" ? true : (item.sBoxType || "其它") === boxTypeSelected)); @@ -3551,6 +3585,7 @@ const GetBestAlgorithm = props => { { name: "盒宽", value: W, type: null }, { name: "盒高", value: D, type: null }, ]; + const boxTypes = slaveRowData.sTypes; const titleList1 = [ { name: "上方盒舌", value: "dSFHS" }, { name: "盒底组件", value: "dHDC" }, @@ -3562,6 +3597,22 @@ const GetBestAlgorithm = props => { { name: "右贴边位", value: "dYTBW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; + const doubleTitlieList1 = [ + { name: "左上插位组件", value: "dZSCW" }, + { name: "上插位组件", value: "dSCW" }, + { name: "右上插位组件", value: "dYSCW" }, + { name: "左偏移", value: "dZPY" }, + { name: "左插位组件", value: "dZCW" }, + { name: "左下插位组件", value: "dZXCW" }, + { name: "右偏移", value: "dYPY" }, + { name: "右插位组件", value: "dYCW" }, + { name: "右下插位组件", value: "dYXCW" }, + { name: "首盒长", value: "dSHC" }, + { name: "首盒宽", value: "dSHK" }, + { name: "次盒长", value: "dCHC" }, + { name: "次盒宽", value: "dCHK" }, + ]; + const srcList = Number(boxTypes) === 8 ? doubleTitlieList1 : titleList1; slaveNewData.forEach(x => { let key = 0; if (x.sAssignFormula) { @@ -3571,7 +3622,7 @@ const GetBestAlgorithm = props => { } boxList.push({ value: key, - sName: titleList1.find(item => item.value === x.sName)?.name || "", + sName: srcList.find(item => item.value === x.sName)?.name || "", isEditable: true, isSelect: false, selectValue: null, @@ -3579,7 +3630,7 @@ const GetBestAlgorithm = props => { selectImage: null, type: x.sTypes || null, show: true, - sCode: titleList1.find(item => item.value === x.sName)?.value || "", + sCode: srcList.find(item => item.value === x.sName)?.value || "", showName: x.showName, // 参数名称 }); });