From 887c32fffed3b162755606f411b9db35f1371dd3 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Tue, 15 Jul 2025 15:19:13 +0800 Subject: [PATCH] 双盒盒型 --- src/components/Common/BoxDesignCompontent/compontents/doubleLayer.js | 1109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/components/Common/BoxDesignCompontent/index.js | 543 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 files changed, 580 insertions(+), 1072 deletions(-) diff --git a/src/components/Common/BoxDesignCompontent/compontents/doubleLayer.js b/src/components/Common/BoxDesignCompontent/compontents/doubleLayer.js index 3a252fd..db1da9a 100644 --- a/src/components/Common/BoxDesignCompontent/compontents/doubleLayer.js +++ b/src/components/Common/BoxDesignCompontent/compontents/doubleLayer.js @@ -1,5 +1,7 @@ /* eslint-disable */ import React, { useRef, useState, useEffect } from "react"; +import styles from "../index.less"; +import SvgBox from "../svg"; import { Select, Button, message, Input, Spin } from "antd-v4"; import { CompressOutlined, ExpandOutlined } from "@ant-design/icons"; import * as commonUtils from "@/utils/utils"; @@ -12,69 +14,9 @@ import CommonViewTable from "@/components/Common/CommonViewTable"; import StaticEditTable from "@/components/Common/CommonTable"; import jsPreviewPdf from "@js-preview/pdf"; import commonConfig from "@/utils/config"; -import SvgBox from "../svg"; -import styles from "./index.less"; -import DoubleLayerBox from "./compontents/doubleLayer"; -const BoxDesignEvent = props => { - const addState = {}; - const { formData = [], selectData = [], masterData, makeUpPDFRecord = {} } = props; - const [tableData, setTableData] = useState({}); - const [options, setOptions] = useState([]); - const [loading, setLoading] = useState(false); // 加载状态 - - addState.getSqlOptions = async type => { - setLoading(true); - const { app, token, makeConfig } = props; - // const quickQuoteConfig = config.gdsconfigformslave.find(item => item.sControlName === "BtnQuickQuote") || {}; - const { sId } = makeConfig; - if (!sId) return; - const url = `${commonConfig.server_host}business/getSelectLimit/${sId}?sModelsId=${sId}`; - const body = { - pageNum: 1, - pageSize: 20, - sKeyUpFilterName: "", - sSqlCondition: { - sType: type, - }, - }; - const data = await commonServices.postValueService(token, body, url); - if (data) { - const option = data.data.dataset.rows; - option.sort((a, b) => { - if (a.sCode === "") { - return -1; // 将 id 为 1 的元素排在前面 - } - if (b.sCode === "") { - return 1; - } - return 0; // 其他元素保持原顺序 - }); - setOptions(data.data.dataset.rows); - } - setLoading(false); - }; - - useEffect(() => { - if (!formData.length) return; - - const data = formData[0].gdsconfigformslave.filter(Item => Item.bVisible); - setTableData(data); - props.onSaveState(pre => ({ ...pre, data })); - }, [formData.length]); - - return { - ...props, - tableData, - ...addState, - options, - loading, - }; -}; -const BoxDesignCompontent = baseProps => { - const props = BoxDesignEvent(baseProps); +const DoubleLayerBox = props => { const { onCancel, onOk, title, loading, masterConfig, bFullScreen, tableData, options = [] } = props; const { slaveData = {}, masterData = {} } = props.state; - const { boxVisible } = baseProps; const [boxList, setBoxList] = useState([]); const [tableColum, setTableColum] = useState([]); // 盒身类型 const [tableDataList, setTableDataList] = useState([]); // 盒长 @@ -83,82 +25,85 @@ const BoxDesignCompontent = baseProps => { const [topBoxList, setTopBoxList] = useState([]); // 盒身信息 const [leftBoxList, setLeftBoxList] = useState([]); // 左边 const [rightBoxList, setRightBoxList] = useState([]); - const [boxKey, setBoxKey] = useState(new Date().getTime()); - if (!boxVisible) return ""; - useEffect(() => { - if (tableData && tableData.length) { - const newTableColum = tableData.map(item => { - return { - ...item, - isEditable: true, - isSelect: false, - selectImage: null, - value: "", - }; - }); - const newList = newTableColum.filter( - item => item.showName.includes("盒长") || item.showName.includes("盒高") || item.showName.includes("盒宽") - ); - const newLists = newTableColum.filter( - item => - !(item.showName.includes("盒长") || item.showName.includes("盒高") || item.showName.includes("盒宽") || item.showName.includes("盒身")) - ); - const bodyList = newTableColum.filter(item => item.showName.includes("盒身")); - newLists.forEach(x => { - if (x.showName === "盒型类别") { - x.showName = "盒型名称"; - } - }); - setTableColum(newLists); - setBoxBodyList(bodyList); - newList.forEach(item => { - let name = ""; - if (item.showName === "盒长") { - name = item.showName + "(L)"; - } else if (item.showName === "盒宽") { - name = item.showName + "(W)"; - } else if (item.showName === "盒高") { - name = item.showName + "(D)"; - } - item.sName = name; - }); - setTableDataList(newList); - } - }, [tableData]); + // useEffect(() => { + // if (tableData && tableData.length) { + // const newTableColum = tableData.map(item => { + // return { + // ...item, + // isEditable: true, + // isSelect: false, + // selectImage: null, + // value: "", + // }; + // }); + // const newList = newTableColum.filter( + // item => item.showName.includes("盒长") || item.showName.includes("盒高") || item.showName.includes("盒宽") + // ); + // const newLists = newTableColum.filter( + // item => + // !(item.showName.includes("盒长") || item.showName.includes("盒高") || item.showName.includes("盒宽") || item.showName.includes("盒身")) + // ); + // const bodyList = newTableColum.filter(item => item.showName.includes("盒身")); + // newLists.forEach(x => { + // if (x.showName === "盒型类别") { + // x.showName = "盒型名称"; + // } + // }); + // setTableColum(newLists); + // setBoxBodyList(bodyList); + // newList.forEach(item => { + // let name = ""; + // if (item.showName === "盒长") { + // name = item.showName + "(L)"; + // } else if (item.showName === "盒宽") { + // name = item.showName + "(W)"; + // } else if (item.showName === "盒高") { + // name = item.showName + "(D)"; + // } + // item.sName = name; + // }); + // setTableDataList(newList); + // } + // }, [tableData]); const titleList = [ - "上方盒舌", - "盒底组件", - "下方盒舌", "左(上)插位组件", - "左贴边位", - "左(下)插位组件", + "上插位组件", "右(上)插位组件", - "右贴边位", + "左偏移", + "左插位组件", + "左(下)插位组件", + "右偏移", + "右插位组件", "右(下)插位组件", + "盒型名称", + "盒身", + "个数", + "首盒长(L)", + "首盒宽(W)", + "次盒长(L)", + "次盒宽(W)", ]; const titleList1 = [ - { name: "上方盒舌", value: "dSFHS" }, - { name: "盒底组件", value: "dHDC" }, - { name: "下方盒舌", value: "dXFHS" }, { name: "左(上)插位组件", value: "dZSCW" }, - { name: "左贴边位", value: "dZTBW" }, - { name: "左(下)插位组件", value: "dZXCW" }, + { name: "上插位组件", value: "dSCW" }, { name: "右(上)插位组件", value: "dYSCW" }, - { name: "右贴边位", value: "dYTBW" }, + { name: "左偏移", value: "dZPY" }, + { name: "左插位组件", value: "dZCW" }, + { name: "左(下)插位组件", value: "dZXCW" }, + { name: "右偏移", value: "dYPY" }, + { name: "右插位组件", value: "dYCW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; + // tableColum.forEach(item => { + // titleList.push(item.showName); + // }); + // boxBodyList.forEach(item => { + // titleList.push(item.showName); + // }); + // tableDataList.forEach(item => { + // titleList.push(item.showName); + // }); const newBoxList = []; - - // const boxs = titleList.length + tableData.length; - tableColum.forEach(item => { - titleList.push(item.showName); - }); - boxBodyList.forEach(item => { - titleList.push(item.showName); - }); - tableDataList.forEach(item => { - titleList.push(item.showName); - }); // 盒身信息 titleList.forEach((item, index) => { newBoxList.push({ @@ -175,7 +120,6 @@ const BoxDesignCompontent = baseProps => { sAssignFormula: null, }); }); - // 部件信息 if (slaveData && slaveData.length) { slaveData.forEach((item, index) => { const i = titleList1.findIndex(i => { @@ -211,137 +155,21 @@ const BoxDesignCompontent = baseProps => { } }); } - // 有数据的时候 盒型设计需要赋值 - useEffect(() => { - if (newBoxList.length > 0 && !arraysAreEqual(boxList, newBoxList)) { - setBoxList(newBoxList); - } - }, [newBoxList]); - console.log(boxList, "boxList"); - const arraysAreEqual = (arr1, arr2) => { if (arr1.length !== arr2.length) return false; return arr1.every((item, index) => item.sName === arr2[index].sName); }; + // 有数据的时候 盒型设计需要赋值 useEffect(() => { - const type = boxList.find(item => item.sName === "盒身")?.type; - const updateLists = () => { - const topBoxFilter = item => item.sName === "上方盒舌" || item.sName === "盒底组件" || item.sName === "下方盒舌"; - - const leftBoxFilter = item => item.sName === "左(上)插位组件" || item.sName === "左贴边位" || item.sName === "左(下)插位组件"; - - const rightBoxFilter = item => item.sName === "右(上)插位组件" || item.sName === "右贴边位" || item.sName === "右(下)插位组件"; - - if (type === "2" || type === 2 || type === "4" || type === 4 || type === 3 || type === "3" || type === 5 || type === "5") { - const box = [...boxList]; - box.forEach(x => { - x.show = true; - }); - if (type === "2" || type === 2) { - box.forEach(x => x.sName === "盒底组件" && (x.show = false)); - } else if (type === "4" || type === 4) { - const title = ["盒底组件", "左贴边位", "右贴边位"]; - box.forEach(x => title.includes(x.sName) && (x.show = false)); - } else if (type === "3" || type === 3) { - const title = ["左(上)插位组件", "右(下)插位组件", "盒底组件"]; - box.forEach(x => title.includes(x.sName) && (x.show = false)); - } else if (type === "5" || type === 5) { - const title = ["盒底组件"]; - box.forEach(x => title.includes(x.sName) && (x.show = false)); - } - setTopBoxList(box.filter(topBoxFilter)); - setLeftBoxList(box.filter(leftBoxFilter)); - if (type === 3 || type === "3") { - setRightBoxList(box.filter(rightBoxFilter).reverse()); - } else { - setRightBoxList(box.filter(rightBoxFilter)); - } - } else if (type === "7" || type === 7) { - const box = [...boxList]; - box.forEach(x => { - x.show = true; - }); - const title = ["盒底组件", "左贴边位", "右贴边位", "上方盒舌", "下方盒舌"]; - box.forEach(x => title.includes(x.sName) && (x.show = false)); - setTopBoxList(box.filter(topBoxFilter)); - setLeftBoxList(box.filter(leftBoxFilter)); - setRightBoxList(box.filter(rightBoxFilter)); - } else { - const box = [...boxList]; - box.forEach(x => { - x.show = true; - }); - setTopBoxList(box.filter(topBoxFilter)); - setLeftBoxList(box.filter(leftBoxFilter)); - setRightBoxList(box.filter(rightBoxFilter)); - } - }; - - updateLists(); - }, [boxList]); - const boxType = boxList.find(item => item.sName === "盒身")?.type; - - const handleFocus = (e, index) => { - if (boxList && boxList.length) { - const updatedBoxList = [...boxList]; - updatedBoxList[index].isEditable = true; - setBoxList(updatedBoxList); - } - }; - - const handleBlur = (e, index) => { - if (boxList && boxList.length) { - const updatedBoxList = [...boxList]; - updatedBoxList[index].isEditable = false; - setBoxList(updatedBoxList); - } - }; - - const handleChange = (e, index) => { - const updatedBoxList = [...boxList]; - updatedBoxList[index].value = e.target.value; - setBoxList(updatedBoxList); - }; - - const handleChangeName = (e, index) => { - const updatedBoxList = [...boxList]; - updatedBoxList[index].showName = e.target.value; - setBoxList(updatedBoxList); - }; - - const handleSelect = (name, selectConfig, index, type) => { - let updatedBoxList = [...boxList]; - updatedBoxList[index].type = name; - updatedBoxList[index].selectImage = selectConfig.image; - // 选择盒身数据全部清空 - - const typeList = [1, 2, 3, 4]; - if (typeList.includes(type)) { - const table1 = tableColum.map(x => x.showName); - const table2 = boxBodyList.map(x => x.showName); - const table3 = tableDataList.map(x => x.showName); - const tableTitle = table1.concat(table2, table3); - updatedBoxList.forEach((x, i) => { - if (i !== index && !tableTitle.includes(x.sName)) { - x.value = ""; - x.type = null; - x.selectValue = null; - x.selectImage = null; - // x.showName = - } - }); - setIsDefaultValue(false); - updatedBoxList[index].value = selectConfig.label; + if (newBoxList.length > 0 && !arraysAreEqual(boxList, newBoxList)) { + setBoxList(newBoxList); } - setBoxList(updatedBoxList); - }; + }, [newBoxList]); const getImage = fileName => { // const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&sModelsId=100&token=${props.token}`; const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${fileName}&scale=0.1&sModelsId=100&token=${props.token}`; return imageUrl; }; - console.log(boxList, "boxList"); - // 下来框 const renderOptionWithImage = option => { return ( @@ -358,618 +186,191 @@ const BoxDesignCompontent = baseProps => { boxList, showNew: 0, }; - const dobuleProps = { - ...props, - renderOptionWithImage, - }; - // 计算展长展宽 - // 创建盒型 - const submit = () => { - const newSlaveData = []; - // 判断是新增还是修改 - - // 存储子表数据 - boxList.forEach((item, index) => { - const i = titleList1.findIndex(i => i.name === item.sName); - const slave = slaveData.find(z => z.sCode === titleList1[i]?.value); - if (i !== -1) { - const data = { - ...slaveData[0], - handleType: slave ? "update" : "add", - sName: item.showName, - sCode: titleList1[i].value, - iValue: item.value, - iOrder: index + 1, - iRowNum: index + 1, - sId: slave ? slave.sId : commonUtils.createSid(), - sMakeUpPath: item.selectImage, - sTypes: item.type, - bVisible: item.value ? true : false, - sParentId: masterData.sId, - sAssignFormula: item.sAssignFormula, - }; - // if (item.value !== "") { - newSlaveData.push(data); - // } - } - }); - const submitSlaveData = []; - slaveData.forEach(item => { - const i = newSlaveData.findIndex(x => x.scode === item.code); - if (i === -1) { - submitSlaveData.push({ ...item, handleType: "del" }); - } - }); - submitSlaveData.concat(newSlaveData); - - // 处理计算公式 - // 计算展长公式 sLengthFormula - let sLengthFormula = ""; - let sWidthFormula = ""; - const boxType = boxList.find(item => item.sName === "盒身")?.type; - const boxLength = Number(boxList.find(item => item.sName === "盒长")?.value); - const boxWidth = Number(boxList.find(item => item.sName === "盒宽")?.value); - const boxHeight = Number(boxList.find(item => item.sName === "盒高")?.value); - const zxcw = boxList.find(x => x.sName === "左(下)插位组件"); - const zscw = boxList.find(x => x.sName === "左(上)插位组件"); - const yscw = boxList.find(x => x.sName === "右(上)插位组件"); - const yxcw = boxList.find(x => x.sName === "右(下)插位组件"); - const hdzj = boxList.find(x => x.sName === "盒底组件"); - const zxcwType = zxcw?.type; - const zxcwValue = zxcw?.value; - const zscwType = zscw?.type; - const zscwValue = zscw?.value; - const yscwType = yscw?.type; - const yscwValue = yscw?.value; - const yxcwType = yxcw?.type; - const yxcwValue = yxcw?.value; - let leftTopValue = 0; - let leftTop = ""; - let rightTopValue = 0; - let rightTop = ""; - let leftBottomValue = 0; - let leftBottom = ""; - let rightBottomValue = 0; - let rightBottom = ""; - if (boxType && boxType === "1") { - // 四面盒 - const ztbw = boxList.find(x => x.sName === "左贴边位")?.type && boxList.find(x => x.sName === "左贴边位")?.value; - const ytbw = boxList.find(x => x.sName === "右贴边位")?.type && boxList.find(x => x.sName === "右贴边位")?.value; - sLengthFormula = (ztbw ? "dZTBW+ " : "") + "L * 2 + W * 2" + (ytbw ? " +dYTBW" : ""); - - if (zxcwType === "4001" || zxcwType === "4006" || zxcwType === "4007") { - leftBottomValue = Number(zxcwValue) + boxHeight; - leftBottom = " + dZXCW + W"; - } else if (zxcwType === "4002" || zxcwType === "4003") { - leftBottomValue = Number(zxcwValue); - leftBottom = " + dZXCW"; - } else if (zxcwType === "4004") { - leftBottomValue = Number(zxcwValue) + boxHeight * 2; - leftBottom = " + dZXCW + W * 2"; - } else if (zxcwType === "4005") { - leftBottomValue = boxHeight * 2; - leftBottom = "+ W * 2"; - } - if (yscwType === "6001" || yscwType === "6006" || yscwType === "6007") { - rightTopValue = Number(yscwValue) + boxHeight; - rightTop = "dYSCW + W + "; - } else if (yscwType === "6002" || yscwType === "6003") { - rightTopValue = Number(yscwValue); - rightTop = "dYSCW + "; - } else if (yscwType === "6004") { - rightTopValue = Number(yscwValue) + boxHeight * 2; - rightTop = "dYSCW + W * 2+ "; - } else if (yscwType === "6005") { - rightTopValue = boxHeight * 2; - rightTop = "W * 2+ "; - } - if (zscwType === "3001" || zscwType === "3006" || zscwType === "3007") { - leftTopValue = Number(zscwValue) + boxHeight; - leftTop = "dZSCW + W +"; - } else if (zscwType === "3002" || zscwType === "3003") { - leftTopValue = Number(zscwValue); - leftTop = "dZSCW +"; - } else if (zscwType === "3004") { - leftTopValue = Number(zscwValue) + boxHeight * 2; - leftTop = "dZSCW + W * 2 +"; - } else if (zscwType === "3005") { - leftTopValue = boxHeight * 2; - leftTop = "W * 2 +"; - } - if (yxcwType === "7001" || yxcwType === "7006" || yxcwType === "7007") { - rightBottomValue = Number(yxcwValue) + boxHeight; - rightBottom = "+ dYXCW + W"; - } else if (yxcwType === "7002" || yxcwType === "7003") { - rightBottomValue = Number(yxcwValue); - rightBottom = "+ dYXCW "; - } else if (yxcwType === "7004") { - rightBottomValue = Number(yxcwValue) + boxHeight * 2; - rightBottom = "+ dYXCW + W * 2"; - } else if (yxcwType === "7005") { - rightBottomValue = boxHeight * 2; - rightBottom = "+ W * 2"; - } - sWidthFormula = - (leftTopValue > rightTopValue ? leftTop : rightTop) + - "D" + - (hdzj ? " + dHDC" : leftBottomValue > rightBottomValue ? leftBottom : rightBottom); - } else if (boxType && boxType === "2") { - // 单折 - const ztbw = boxList.find(x => x.sName === "左贴边位")?.type && boxList.find(x => x.sName === "左贴边位")?.value; - const ytbw = boxList.find(x => x.sName === "右贴边位")?.type && boxList.find(x => x.sName === "右贴边位")?.value; - sLengthFormula = (ztbw ? "dZTBW+ " : "") + "L * 2 + W" + (ytbw ? " +dYTBW" : ""); - if (zxcwType === "4001" || zxcwType === "4006" || zxcwType === "4007") { - leftBottomValue = Number(zxcwValue) + boxHeight; - leftBottom = " + dZXCW + W"; - } else if (zxcwType === "4002" || zxcwType === "4003") { - leftBottomValue = Number(zxcwValue); - leftBottom = " + dZXCW"; - } else if (zxcwType === "4004") { - leftBottomValue = Number(zxcwValue) + boxHeight * 2; - leftBottom = " + dZXCW + W * 2"; - } else if (zxcwType === "4005") { - leftBottomValue = boxHeight * 2; - leftBottom = "+ W * 2"; - } - if (yscwType === "6001" || yscwType === "6006" || yscwType === "6007") { - rightTopValue = Number(yscwValue) + boxHeight; - rightTop = "dYSCW + W + "; - } else if (yscwType === "6002" || yscwType === "6003") { - rightTopValue = Number(yscwValue); - rightTop = "dYSCW + "; - } else if (yscwType === "6004") { - rightTopValue = Number(yscwValue) + boxHeight * 2; - rightTop = "dYSCW + W * 2+ "; - } else if (yscwType === "6005") { - rightTopValue = boxHeight * 2; - rightTop = "W * 2+ "; - } - if (zscwType === "3001" || zscwType === "3006" || zscwType === "3007") { - leftTopValue = Number(zscwValue) + boxHeight; - leftTop = "dZSCW + W +"; - } else if (zscwType === "3002" || zscwType === "3003") { - leftTopValue = Number(zscwValue); - leftTop = "dZSCW +"; - } else if (zscwType === "3004") { - leftTopValue = Number(zscwValue) + boxHeight * 2; - leftTop = "dZSCW + W * 2 +"; - } else if (zscwType === "3005") { - leftTopValue = boxHeight * 2; - leftTop = "W * 2 +"; - } - if (yxcwType === "7001" || yxcwType === "7006" || yxcwType === "7007") { - rightBottomValue = Number(yxcwValue) + boxHeight; - rightBottom = "+ dYXCW + W"; - } else if (yxcwType === "7002" || yxcwType === "7003") { - rightBottomValue = Number(yxcwValue); - rightBottom = "+ dYXCW "; - } else if (yxcwType === "7004") { - rightBottomValue = Number(yxcwValue) + boxHeight * 2; - rightBottom = "+ dYXCW + W * 2"; - } else if (yxcwType === "7005") { - rightBottomValue = boxHeight * 2; - rightBottom = "+ W * 2"; - } - sWidthFormula = (leftTopValue > rightTopValue ? leftTop : rightTop) + "D" + (leftBottomValue > rightBottomValue ? leftBottom : rightBottom); - } else if (boxType && boxType === "3") { - const ztbw = boxList.find(x => x.sName === "左贴边位")?.type && boxList.find(x => x.sName === "左贴边位")?.value; - const ytbw = boxList.find(x => x.sName === "右贴边位")?.type && boxList.find(x => x.sName === "右贴边位")?.value; - sLengthFormula = (ztbw ? "dZTBW+ " : "") + "L + W * 2" + (ytbw ? " +dYTBW" : ""); - if (zxcwType === "4001" || zxcwType === "4006" || zxcwType === "4007") { - leftBottomValue = Number(zxcwValue) + boxHeight; - leftBottom = " + dZXCW + W"; - } else if (zxcwType === "4002" || zxcwType === "4003") { - leftBottomValue = Number(zxcwValue); - leftBottom = " + dZXCW"; - } else if (zxcwType === "4004") { - leftBottomValue = Number(zxcwValue) + boxHeight * 2; - leftBottom = " + dZXCW + W * 2"; - } else if (zxcwType === "4005") { - leftBottomValue = boxHeight * 2; - leftBottom = "+ W * 2"; - } - if (yscwType === "6001" || yscwType === "6006" || yscwType === "6007") { - rightTopValue = Number(yscwValue) + boxHeight; - rightTop = "dYSCW + W + "; - } else if (yscwType === "6002" || yscwType === "6003") { - rightTopValue = Number(yscwValue); - rightTop = "dYSCW + "; - } else if (yscwType === "6004") { - rightTopValue = Number(yscwValue) + boxHeight * 2; - rightTop = "dYSCW + W * 2+ "; - } else if (yscwType === "6005") { - rightTopValue = boxHeight * 2; - rightTop = "W * 2+ "; - } - if (zscwType === "3001" || zscwType === "3006" || zscwType === "3007") { - leftTopValue = Number(zscwValue) + boxHeight; - leftTop = "dZSCW + W +"; - } else if (zscwType === "3002" || zscwType === "3003") { - leftTopValue = Number(zscwValue); - leftTop = "dZSCW +"; - } else if (zscwType === "3004") { - leftTopValue = Number(zscwValue) + boxHeight * 2; - leftTop = "dZSCW + W * 2 +"; - } else if (zscwType === "3005") { - leftTopValue = boxHeight * 2; - leftTop = "W * 2 +"; - } - if (yxcwType === "7001" || yxcwType === "7006" || yxcwType === "7007") { - rightBottomValue = Number(yxcwValue) + boxHeight; - rightBottom = "+ dYXCW + W"; - } else if (yxcwType === "7002" || yxcwType === "7003") { - rightBottomValue = Number(yxcwValue); - rightBottom = "+ dYXCW "; - } else if (yxcwType === "7004") { - rightBottomValue = Number(yxcwValue) + boxHeight * 2; - rightBottom = "+ dYXCW + W * 2"; - } else if (yxcwType === "7005") { - rightBottomValue = boxHeight * 2; - rightBottom = "+ W * 2"; - } - sWidthFormula = (leftTopValue > rightTopValue ? leftTop : rightTop) + "D" + (leftBottomValue > rightBottomValue ? leftBottom : rightBottom); - } else if (boxType && boxType === "4") { - // 天地盒 - const zxcw = boxList.find(x => x.sName === "左(下)插位组件"); - const zscw = boxList.find(x => x.sName === "左(上)插位组件"); - const yscw = boxList.find(x => x.sName === "右(上)插位组件"); - const yxcw = boxList.find(x => x.sName === "右(下)插位组件"); - const zxcwType = zxcw?.type; - const zxcwValue = zxcw?.value; - const zscwType = zscw?.type; - const zscwValue = zscw?.value; - const yscwType = yscw?.type; - const yscwValue = yscw?.value; - const yxcwType = yxcw?.type; - const yxcwValue = yxcw?.value; - let leftValue = ""; - let rightValue = ""; - let topValue = ""; - let bottomValue = ""; - if (zxcwType === "4001" || zxcwType === "4006" || zxcwType === "4007") { - // leftValue = leftValue + Number(zxcwValue) + boxHeight * 2; - leftValue = "dZXCW + D * 2 +"; - } else if (zxcwType === "4002" || zxcwType === "4003") { - leftValue = "dZXCW + D +"; - } else if (zxcwType === "4004") { - leftValue = "dZXCW + D * 3 +"; - } else if (zxcwType === "4005") { - leftValue = "D * 3 +"; - } - if (yscwType === "6001" || yscwType === "6006" || yscwType === "6007") { - rightValue = "+ dYSCW + D * 2"; - } else if (yscwType === "6002" || yscwType === "6003") { - rightValue = "+ dYSCW + D"; - } else if (yscwType === "6004") { - rightValue = "+ dYSCW + D * 3"; - } else if (yscwType === "6005") { - rightValue = " + D * 3"; - } - if (zscwType === "3001" || zscwType === "3006" || zscwType === "3007") { - topValue = "dZSCW + D * 2 +"; - } else if (zscwType === "3002" || zscwType === "3003") { - topValue = "dZSCW + D +"; - } else if (zscwType === "3004") { - topValue = "dZSCW + D * 3 +"; - } else if (zscwType === "3005") { - topValue = "D * 3+"; - } - if (yxcwType === "7001" || yxcwType === "7006" || yxcwType === "7007") { - bottomValue = "+ dYXCW + D * 2"; - } else if (yxcwType === "7002" || yxcwType === "7003") { - bottomValue = "+ dYXCW + D "; - } else if (yxcwType === "7004") { - bottomValue = "+ dYXCW + D * 3"; - } else if (yxcwType === "7005") { - bottomValue = "+ D * 3"; - } - // viewBoxWidth = Number(boxLength) + leftValue + rightValue; - // viewBoxHeight = Number(boxWidth) + topValue + bottomValue; - sLengthFormula = leftValue + "L" + rightValue; - sWidthFormula = topValue + "W" + bottomValue; - } else if (boxType && boxType === "5") { - // 飞机盒 - const ztbw = boxList.find(x => x.sName === "左贴边位")?.type && boxList.find(x => x.sName === "左贴边位")?.value; - const ytbw = boxList.find(x => x.sName === "右贴边位")?.type && boxList.find(x => x.sName === "右贴边位")?.value; - sLengthFormula = (ztbw ? "dZTBW+ " : "") + "D * 2 + W * 2" + (ytbw ? " +dYTBW" : ""); - if (zxcwType === "4001" || zxcwType === "4006" || zxcwType === "4007") { - leftBottomValue = Number(zxcwValue) + boxHeight; - leftBottom = " + dZXCW + D"; - } else if (zxcwType === "4002" || zxcwType === "4003") { - leftBottomValue = Number(zxcwValue); - leftBottom = " + dZXCW"; - } else if (zxcwType === "4004") { - leftBottomValue = Number(zxcwValue) + boxHeight * 2; - leftBottom = " + dZXCW + D * 2"; - } else if (zxcwType === "4005") { - leftBottomValue = boxHeight * 2; - leftBottom = "+ D * 2"; - } - if (yscwType === "6001" || yscwType === "6006" || yscwType === "6007") { - rightTopValue = Number(yscwValue) + boxHeight; - rightTop = "dYSCW + D + "; - } else if (yscwType === "6002" || yscwType === "6003") { - rightTopValue = Number(yscwValue); - rightTop = "dYSCW + "; - } else if (yscwType === "6004") { - rightTopValue = Number(yscwValue) + boxHeight * 2; - rightTop = "dYSCW + D * 2+ "; - } else if (yscwType === "6005") { - rightTopValue = boxHeight * 2; - rightTop = "D * 2+ "; - } - if (zscwType === "3001" || zscwType === "3006" || zscwType === "3007") { - leftTopValue = Number(zscwValue) + boxHeight; - leftTop = "dZSCW + D +"; - } else if (zscwType === "3002" || zscwType === "3003") { - leftTopValue = Number(zscwValue); - leftTop = "dZSCW +"; - } else if (zscwType === "3004") { - leftTopValue = Number(zscwValue) + boxHeight * 2; - leftTop = "dZSCW + D * 2 +"; - } else if (zscwType === "3005") { - leftTopValue = boxHeight * 2; - leftTop = "D * 2 +"; - } - if (yxcwType === "7001" || yxcwType === "7006" || yxcwType === "7007") { - rightBottomValue = Number(yxcwValue) + boxHeight; - rightBottom = "+ dYXCW + D"; - } else if (yxcwType === "7002" || yxcwType === "7003") { - rightBottomValue = Number(yxcwValue); - rightBottom = "+ dYXCW "; - } else if (yxcwType === "7004") { - rightBottomValue = Number(yxcwValue) + boxHeight * 2; - rightBottom = "+ dYXCW + D * 2"; - } else if (yxcwType === "7005") { - rightBottomValue = boxHeight * 2; - rightBottom = "+ D * 2"; - } - sWidthFormula = (leftTopValue > rightTopValue ? leftTop : rightTop) + "L" + (leftBottomValue > rightBottomValue ? leftBottom : rightBottom); - } - - // 存储盒身数据 主表 - const newMasterData = { - ...masterData, - sBoxBody: boxList.find(item => item.sName === "盒身")?.value || "", - dBoxLength: boxList.find(item => item.sName === "盒长")?.value || "", - dBoxWidth: boxList.find(item => item.sName === "盒宽")?.value || "", - dBoxHeight: boxList.find(item => item.sName === "盒高")?.value || "", - sName: boxList.find(item => item.sName === "盒型名称")?.value || "", - sMakeUpPath: boxList.find(item => item.sName === "盒身")?.selectImage || "", - sTypes: boxList.find(item => item.sName === "盒身")?.type || "", - sLengthFormula: masterData.sLengthFormula || sLengthFormula, - sWidthFormula: masterData.sWidthFormula || sWidthFormula, - }; - onOk({ slaveData: newSlaveData, masterData: newMasterData }); // 提交数据 - }; - const findIndexBySname = name => { - const i = boxList.findIndex(x => x.sName === name); - return i || 0; - }; + useEffect(() => { + if (!boxList.length) return; + const slicedArray = boxList.slice(9, 12); + // 处理盒型部分 + setBoxBodyList(slicedArray); + }, [boxList]); + console.log(tableDataList, "boxList"); - // 单独处理双层盒型 - if (boxType === "8") { - console.log(newBoxList, boxList, "topBoxList"); - } return ( - - {/* 盒身信息 */} +
+
+ {topBoxList.map((topItem, index) => ( +
+
{topItem.sName}
+ {topItem?.selectImage ? ( + {topItem.value} + ) : ( + "" + )} + + +
+ {/*
参数:
*/} + handleChangeName(e, index)} + onFocus={e => handleFocus(e, index)} + onBlur={e => handleBlur(e, index)} + readOnly={!topItem?.isEditable} + className={styles.text} + /> + handleChange(e, index)} + onFocus={e => handleFocus(e, index)} + onBlur={e => handleBlur(e, index)} + readOnly={!topItem?.isEditable} + style={{ width: " 80%" }} + /> +
+
+ ))} +
+
+ {leftBoxList.map((item, index) => ( +
+
{titleList[index + 3]}
-
-
- {topBoxList.map((topItem, index) => ( -
-
{topItem.sName}
- {topItem?.selectImage ? ( + +
+ {item?.selectImage ? ( {topItem.value} ) : ( "" )} - - -
- {/*
参数:
*/} - handleChangeName(e, index)} - onFocus={e => handleFocus(e, index)} - onBlur={e => handleBlur(e, index)} - readOnly={!topItem?.isEditable} - className={styles.text} - /> - handleChange(e, index)} - onFocus={e => handleFocus(e, index)} - onBlur={e => handleBlur(e, index)} - readOnly={!topItem?.isEditable} - style={{ width: " 80%" }} - /> -
+ handleChangeName(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + className={styles.text} + /> + handleChange(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + style={{ width: " 80%" }} + />
- ))} -
-
- {leftBoxList.map((item, index) => ( -
-
{titleList[index + 3]}
+
+ ))} +
+
+ {rightBoxList.map((item, index) => ( +
+
{titleList[findIndexBySname(item.sName)]}
- -
- {item?.selectImage ? ( - {item.value} - ) : ( - "" - )} - handleChangeName(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - className={styles.text} - /> - handleChange(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - style={{ width: " 80%" }} + +
+ {item?.selectImage ? ( + {item.value} -
-
- ))} -
-
- {rightBoxList.map((item, index) => ( -
-
{titleList[findIndexBySname(item.sName)]}
- - -
- {item?.selectImage ? ( - {item.value} - ) : ( - "" - )} + ) : ( + "" + )} - handleChangeName(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - className={styles.text} - /> - handleChange(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - style={{ width: " 80%" }} - /> -
+ handleChangeName(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + className={styles.text} + /> + handleChange(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + style={{ width: " 80%" }} + />
- ))} -
-
-
-
+ ))} +
+
+
+ +
+
- {tableColum && tableColum.length - ? tableColum.map((item, index) => { - const uniqueIndex = index + 9; - return ( -
-
-
- {item.showName} -
- handleChange(e, uniqueIndex)} - onFocus={e => handleFocus(e, uniqueIndex)} - onBlur={e => handleBlur(e, uniqueIndex)} - readOnly={!boxList[uniqueIndex]?.isEditable} - style={{ width: " 80%" }} - /> -
-
- ); - }) - : ""} {boxBodyList && boxBodyList.length ? boxBodyList.map((item, index) => { - const uniqueIndex = index + 9 + tableColum.length; - + const uniqueIndex = index + 9; return (
@@ -1005,32 +406,10 @@ const BoxDesignCompontent = baseProps => { ); }) : ""} -
- {tableDataList && tableDataList.length - ? tableDataList.map((item, index) => { - const uniqueIndex = index + 9 + tableColum.length + boxBodyList.length; - - return ( -
-
{item.sName}
- handleChange(e, uniqueIndex)} - onFocus={e => handleFocus(e, uniqueIndex)} - onBlur={e => handleBlur(e, uniqueIndex)} - readOnly={!boxList[uniqueIndex]?.isEditable} - style={{ width: " 60%" }} - /> -
- ); - }) - : ""} -
- +
); }; - -export default CommonBase(BoxDesignCompontent); +export default DoubleLayerBox; diff --git a/src/components/Common/BoxDesignCompontent/index.js b/src/components/Common/BoxDesignCompontent/index.js index 6773435..89f5b20 100644 --- a/src/components/Common/BoxDesignCompontent/index.js +++ b/src/components/Common/BoxDesignCompontent/index.js @@ -83,7 +83,9 @@ const BoxDesignCompontent = baseProps => { const [topBoxList, setTopBoxList] = useState([]); // 盒身信息 const [topDoubleBoxList, setTopDoubleBoxList] = useState([]); // 盒身信息 const [leftBoxList, setLeftBoxList] = useState([]); // 左边 + const [leftDoubleBoxList, setLeftDoubleBoxList] = useState([]); // 左边 const [rightBoxList, setRightBoxList] = useState([]); + const [rightDoubleBoxList, setRightDoubleBoxList] = useState([]); const [boxKey, setBoxKey] = useState(new Date().getTime()); const [doubleLayerList, setDoubleLayerList] = useState([]); if (!boxVisible) return ""; @@ -174,7 +176,17 @@ const BoxDesignCompontent = baseProps => { { name: "右贴边位", value: "dYTBW" }, { name: "右(下)插位组件", value: "dYXCW" }, ]; - + const doubleTitlieList = [ + "左上插位组件", + "上插位组件", + "右上插位组件", + "左偏移", + "左插位组件", + "左下插位组件", + "右偏移", + "右插位组件", + "右下插位组件", + ]; const newBoxList = []; // const boxs = titleList.length + tableData.length; @@ -188,7 +200,7 @@ const BoxDesignCompontent = baseProps => { titleList.push(item.showName); }); // 这里处理双盒的初始数据 - titleList.push(...["首盒长", "首盒宽", "次盒长", "次盒宽"]); + titleList.push(...["首盒长", "首盒宽", "次盒长", "次盒宽"], ...doubleTitlieList); // 盒身信息 titleList.forEach((item, index) => { newBoxList.push({ @@ -317,12 +329,10 @@ const BoxDesignCompontent = baseProps => { useEffect(() => { if (!boxType) return; if (boxType === "8") { - const doubleList = ["首盒长", "首盒宽", "次盒长", "次盒宽"]; - let box = []; - doubleList.forEach(item => { - box.push({ + const createBox = names => + names.map(sName => ({ value: "", - sName: item, + sName, isEditable: true, isSelect: false, selectValue: null, @@ -330,11 +340,13 @@ const BoxDesignCompontent = baseProps => { selectImage: null, type: null, show: true, - showName: item, // 参数名称 + showName: sName, sAssignFormula: null, - }); - }); - setDoubleLayerList(box); + })); + setDoubleLayerList(createBox(["首盒长", "首盒宽", "次盒长", "次盒宽"])); + setTopDoubleBoxList(createBox(["左上插位组件", "上插位组件", "右上插位组件"])); + setLeftDoubleBoxList(createBox(["左偏移", "左插位组件", "左下插位组件"])); + setRightDoubleBoxList(createBox(["右偏移", "右插位组件", "右下插位组件"])); } else { } }, [boxType]); @@ -832,217 +844,334 @@ const BoxDesignCompontent = baseProps => {
- {boxType !== '8' && topBoxList.map((topItem, index) => ( -
-
{topItem.sName}
- {topItem?.selectImage ? ( - {topItem.value} - ) : ( - "" - )} + {boxType !== "8" && + topBoxList.map((topItem, index) => ( +
+
{topItem.sName}
+ {topItem?.selectImage ? ( + {topItem.value} + ) : ( + "" + )} - -
- {/*
参数:
*/} - handleChangeName(e, index)} - onFocus={e => handleFocus(e, index)} - onBlur={e => handleBlur(e, index)} - readOnly={!topItem?.isEditable} - className={styles.text} - /> - handleChange(e, index)} - onFocus={e => handleFocus(e, index)} - onBlur={e => handleBlur(e, index)} - readOnly={!topItem?.isEditable} - style={{ width: " 80%" }} - /> + +
+ {/*
参数:
*/} + handleChangeName(e, index)} + onFocus={e => handleFocus(e, index)} + onBlur={e => handleBlur(e, index)} + readOnly={!topItem?.isEditable} + className={styles.text} + /> + handleChange(e, index)} + onFocus={e => handleFocus(e, index)} + onBlur={e => handleBlur(e, index)} + readOnly={!topItem?.isEditable} + style={{ width: " 80%" }} + /> +
-
- ))} - {boxType === '8' && topDoubleBoxList.map((topItem, index) => ( -
-
{topItem.sName}
- {topItem?.selectImage ? ( - {topItem.value} - ) : ( - "" - )} + ))} + {boxType === "8" && + topDoubleBoxList.map((topItem, index) => ( +
+
{topItem.sName}
+ {topItem?.selectImage ? ( + {topItem.value} + ) : ( + "" + )} - -
- {/*
参数:
*/} - handleChangeName(e, index)} - onFocus={e => handleFocus(e, index)} - onBlur={e => handleBlur(e, index)} - readOnly={!topItem?.isEditable} - className={styles.text} - /> - handleChange(e, index)} - onFocus={e => handleFocus(e, index)} - onBlur={e => handleBlur(e, index)} - readOnly={!topItem?.isEditable} - style={{ width: " 80%" }} - /> + +
+ {/*
参数:
*/} + handleChangeName(e, index)} + onFocus={e => handleFocus(e, index)} + onBlur={e => handleBlur(e, index)} + readOnly={!topItem?.isEditable} + className={styles.text} + /> + handleChange(e, index)} + onFocus={e => handleFocus(e, index)} + onBlur={e => handleBlur(e, index)} + readOnly={!topItem?.isEditable} + style={{ width: " 80%" }} + /> +
-
- ))} + ))}
- {leftBoxList.map((item, index) => ( -
-
{titleList[index + 3]}
+ {boxType !== "8" && + leftBoxList.map((item, index) => ( +
+
{titleList[index + 3]}
- -
- {item?.selectImage ? ( - {item.value} handleSelect(value, option, findIndexBySname(item.sName), 0)} + onDropdownVisibleChange={async open => { + if (open) { + props.getSqlOptions(findIndexBySname(item.sName) + 1); // 在下拉菜单打开时调用 getSqlOptions + } + }} + > + {!loading ? options.map(option => renderOptionWithImage(option)) : ""} + +
+ {item?.selectImage ? ( + {item.value} + ) : ( + "" + )} + handleChangeName(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + className={styles.text} /> - ) : ( - "" - )} - handleChangeName(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - className={styles.text} - /> - handleChange(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - style={{ width: " 80%" }} - /> + handleChange(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + style={{ width: " 80%" }} + /> +
-
- ))} + ))} + {boxType === "8" && + leftDoubleBoxList.map((item, index) => ( +
+
{doubleTitlieList[index + 3]}
+ + +
+ {item?.selectImage ? ( + {item.value} + ) : ( + "" + )} + handleChangeName(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + className={styles.text} + /> + handleChange(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + style={{ width: " 80%" }} + /> +
+
+ ))}
- {rightBoxList.map((item, index) => ( -
-
{titleList[findIndexBySname(item.sName)]}
+ {boxType !== "8" && + rightBoxList.map((item, index) => ( +
+
{titleList[findIndexBySname(item.sName)]}
- -
- {item?.selectImage ? ( - {item.value} handleSelect(value, option, findIndexBySname(item.sName), 0)} + onDropdownVisibleChange={async open => { + if (open) { + props.getSqlOptions(findIndexBySname(item.sName) + 1); // 在下拉菜单打开时调用 getSqlOptions + } + }} + > + {!loading ? options.map(option => renderOptionWithImage(option)) : ""} + +
+ {item?.selectImage ? ( + {item.value} + ) : ( + "" + )} + + handleChangeName(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + className={styles.text} /> - ) : ( - "" - )} + handleChange(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + style={{ width: " 80%" }} + /> +
+
+ ))} + {boxType === "8" && + rightDoubleBoxList.map((item, index) => ( +
+
{doubleTitlieList[index + 6]}
+ + +
+ {item?.selectImage ? ( + {item.value} + ) : ( + "" + )} - handleChangeName(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - className={styles.text} - /> - handleChange(e, findIndexBySname(item.sName))} - onFocus={e => handleFocus(e, findIndexBySname(item.sName))} - onBlur={e => handleBlur(e, findIndexBySname(item.sName))} - readOnly={!item?.isEditable} - style={{ width: " 80%" }} - /> + handleChangeName(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + className={styles.text} + /> + handleChange(e, findIndexBySname(item.sName))} + onFocus={e => handleFocus(e, findIndexBySname(item.sName))} + onBlur={e => handleBlur(e, findIndexBySname(item.sName))} + readOnly={!item?.isEditable} + style={{ width: " 80%" }} + /> +
-
- ))} + ))}
-- libgit2 0.22.2