From 31d680e09615b1c15a5222f691c46312b3844490 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Mon, 9 Jun 2025 15:07:34 +0800 Subject: [PATCH] 盒型设计新增图片 --- src/components/Common/BoxDesignCompontent/svg.js | 1 - src/components/Common/CommonComponent/index.js | 2 +- src/components/QuickQuote/index.jsx | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------- src/mobile/components/SelectInput.jsx | 6 +----- src/mobile/quotation/detailNew.jsx | 44 ++++++++++---------------------------------- 5 files changed, 94 insertions(+), 57 deletions(-) diff --git a/src/components/Common/BoxDesignCompontent/svg.js b/src/components/Common/BoxDesignCompontent/svg.js index 50f1926..832e17f 100644 --- a/src/components/Common/BoxDesignCompontent/svg.js +++ b/src/components/Common/BoxDesignCompontent/svg.js @@ -234,7 +234,6 @@ const SvgBox = props => { svgContainerRef.current.style.height = `${dSvgBoxHeight ? dSvgBoxHeight : 250}px`; } } else if (props.showNew === 1) { - console.log("🚀 ~ initSVG ~ props:", props) let ySvg = topOffect(boxList, boxLength, boxWidth, boxHeight) * scale; let leftSize = 0; let topSize = 0; diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 165c71b..b5d8fcd 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -1104,7 +1104,7 @@ export default class CommonComponent extends Component { if (sName === 'sIcon') { return (<>{this.getUploadContents()}); } - if (sName === 'sPackPath') { + if (sName === 'sPackPath' || sName === 'sPackDetailPathUpLoad') { const uploadProps = { listType: 'picture-card', className: 'avatar-uploader', diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 7f30edd..04fba44 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -906,7 +906,6 @@ const QuickQuoteEvent = props => { // 入口 const QuickQuote = baseProps => { const props = QuickQuoteEvent(baseProps); - console.log("🚀 ~ QuickQuote:", props) const [treeClassName, setTreeClassName] = useState(""); @@ -919,7 +918,6 @@ const QuickQuote = baseProps => { }, []); return ( -
{!props.hideBackBtn && ( @@ -1074,10 +1072,7 @@ const TreeComponent = props => { selectedNode: select.selectedNodes[0]?.treeNode || {}, masterData: { ...masterData, sProductName: sProductName || select.node.title, sProductUnit: sProductUnit || select.node.treeNode.sUnit }, }; - }); - console.log(props,'Tree'); - }} // defaultSelectedKeys={[activeTree]} defaultExpandAll={true} @@ -1093,7 +1088,6 @@ const ContentComponent = props => { const { selectedNode = {}, extraParts = {} } = props.state; const { showName } = selectedNode; const extraPartsList = extraParts[showName] || []; - console.log("🚀 ~ extraPartsList:", extraPartsList) let { sAllPartsName = "" } = selectedNode; let bEmpty = false; if (commonUtils.isEmptyObject(selectedNode)) { @@ -1104,7 +1098,6 @@ const ContentComponent = props => { } const boxModelList = sAllPartsName.split(","); - console.log("🚀 ~ boxModelList:", boxModelList) const [activeKey, setActiveKey] = useState(0); useEffect(() => { @@ -1166,7 +1159,6 @@ const ContentComponent = props => { } }; - console.log("🚀 ~ props:", props) return ( <> {/* 产品参数 */} @@ -1267,8 +1259,7 @@ const BoxComponent = props => { }; const getUpViewPropsByITag = iTag => { - console.log(slaveConfig,'slaveConfig1'); - + const config = slaveConfig.gdsconfigformslave.filter(item => { if (item.sName === "dSumPQty" && selectedNode.sTypeKey !== "huace") { return false; @@ -1518,10 +1509,10 @@ const BoxComponent = props => { materialWidth, bBox: true, // 快速报价盒型展示 }; + let boxList = []; if (slaveRowData.sColumnNameConfig && masterData.dLength && masterData.dWidth && masterData.dHeight) { const slaveNewData = JSON.parse(slaveRowData.sColumnNameConfig); - console.log("🚀 ~ slaveRowData:", slaveRowData) const tables = [ { name: "盒型类别", value: slaveRowData.sBoxType, type: null }, { name: "盒身", value: slaveRowData.sBoxBody, type: slaveRowData.sTypes }, @@ -1905,8 +1896,7 @@ const ManyComponent = props => { // 核价事件 const onCalcPrice = () => { - console.log(props,'propsprops'); - + const addState = { ...props.onGetAllDelData(), manyDataCache: [], @@ -2043,7 +2033,10 @@ const ManyComponent = props => { // 选择盒型弹窗 const BoxModelSelectedModal = props => { - const { boxModelSelectedModalVisible } = props; + const { dividerProps, state, boxModel, boxModelSelectedModalVisible } = props; + const { masterData = {}, slaveConfig, slaveData = [], selectedNode = {}, downAbleConfigs = [], finishedConfigs = [] } = state; + const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; + if (!boxModelSelectedModalVisible) return ""; const onCancel = () => { @@ -2066,10 +2059,10 @@ const BoxModelSelectedModal = props => { // ["sBoxId", "盒型ID"], ["sName", "名称", 119], ["sPackDetailPath", "刀线图", 300], + // ["sPackDetailPathUpLoad", "刀线图", 300], ["sPackPath", "3D图", 300], ["operation", "操作", 80], ]; - const config = { sId: commonUtils.createSid(), // bisMutiSelect: true, @@ -2129,6 +2122,67 @@ const BoxModelSelectedModal = props => { )), [boxTypeList.length] ); + const getSvgProps = svg => { + if (!svg) return; + const { sColumnNameConfig, sBoxType, sBoxBody, dBoxLength, dBoxWidth, dBoxHeight, sTypes } = svg; + const slaveData = JSON.parse(sColumnNameConfig); + const boxList = []; + const tables = [ + { name: "盒型类别", value: sBoxType, type: null }, + { name: "盒身", value: sBoxBody, type: sTypes }, + { name: "盒长", value: dBoxLength, type: null }, + { name: "盒宽", value: dBoxWidth, type: null }, + { name: "盒高", value: dBoxHeight, type: null }, + ]; + // const { slaveData = [] } = this.props; + const titleList1 = [ + { name: "上方盒舌", value: "dSFHS" }, + { name: "盒底组件", value: "dHDC" }, + { name: "下方盒舌", value: "dXFHS" }, + { name: "左(上)插位组件", value: "dZSCW" }, + { name: "左贴边位", value: "dZTBW" }, + { name: "左(下)插位组件", value: "dZXCW" }, + { name: "右(上)插位组件", value: "dYSCW" }, + { name: "右贴边位", value: "dYTBW" }, + { name: "右(下)插位组件", value: "dYXCW" }, + ]; + slaveData.forEach(x => { + boxList.push({ + value: x.iValue, + sName: titleList1.find(item => item.value === x.sCode)?.name || "", + isEditable: true, + isSelect: false, + selectValue: null, + selectLabel: "", + selectImage: null, + type: x.sTypes || null, + show: true, + showName: x.sName, // 参数名称 + }); + }); + tables.forEach(x => { + boxList.push({ + value: x.value, + sName: x.name, + isEditable: true, + isSelect: false, + selectValue: null, + selectLabel: "", + selectImage: null, + type: x.type || null, + show: true, + showName: x.name, // 参数名称 + }); + }); + const svgProps = { + ...props, + boxList, + dSvgBoxWidth: 100, + dSvgBoxHeight: 100, + showNew: 1, + }; + return svgProps; + }; const tableProps = { ...commonBusiness.getTableTypes("box", { @@ -2144,7 +2198,19 @@ const BoxModelSelectedModal = props => { columns .filter(item => item.dataIndex?.includes("Path")) .forEach(column => { - column.render = (value, record, index) => (value ? : "暂无图片"); + // (value ? (column.dataIndex === 'sPackDetailPath' ? (boxData[index].sPackPath ? : '') : ) : "暂无图片"); + column.render = (value, record, index) => + column.dataIndex === "sPackDetailPath" ? ( + boxData[index].sPackDetailPathUpLoad ? ( + + ) : ( + + ) + ) : value ? ( + + ) : ( + "暂无图片" + ); }); columns diff --git a/src/mobile/components/SelectInput.jsx b/src/mobile/components/SelectInput.jsx index 394be66..4dccd52 100644 --- a/src/mobile/components/SelectInput.jsx +++ b/src/mobile/components/SelectInput.jsx @@ -9,7 +9,6 @@ import styles from "./selectInput.less"; import debounce from "lodash/debounce"; const SelectInput = props => { - console.log("🚀 ~ selectInputValue:", props); const [value, setValue] = useState(props.sValue || ""); // 如果存在 name 属性,将其值赋值给 value const [values, setValues] = useState(""); const [searchValue, setSearchValue] = useState(""); @@ -24,7 +23,6 @@ const SelectInput = props => { // }, [props.sValue]); useEffect(() => { if (!itemDetail) return; - console.log(itemDetail, tableName, "viewRowNew"); const viewRowNew = itemDetail.sName ? viewRow?.[itemDetail.sName] : ""; setValue(viewRowNew || ""); // 动态更新 value @@ -35,7 +33,7 @@ const SelectInput = props => { const url = `${commonConfig.server_host}business/getSelectLimit/${sId}?sModelsId=${sModelsId}&sName=${""}`; const body = { sSqlCondition: { - sProductClassifyId: quotationData.sId, + sProductClassifyId: quotationData?quotationData.sId:'', }, sKeyUpFilterName: searchValue, pageNum: 1, @@ -82,8 +80,6 @@ const SelectInput = props => { debouncedChangeOption(val); }; useEffect(() => { - console.log("🚀 ~ useEffect ~ itemDetailssss:", itemDetail) - if (!visible) return; let { sDropDownType } = itemDetail; if (sDropDownType === "sql") { diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx index eee20dc..d6ecb4f 100644 --- a/src/mobile/quotation/detailNew.jsx +++ b/src/mobile/quotation/detailNew.jsx @@ -14,7 +14,6 @@ import Typesetting from "@/components/Common/Typesetting/typesetting"; import DynamicSVG from "@/components/Common/BoxDesignCompontent/svg"; import ShowImgM from "@/components/Common/BoxShowImgMaterial/indexNew"; const QuickQuoteEvent = props => { - console.log("🚀 ~ QuickQuoteEvent:", props); const { location } = props; const selectedNode = JSON.parse(location.state).quotationData; const addState = {}; @@ -81,7 +80,7 @@ const QuickQuoteEvent = props => { const sQuoConfig = commonUtils.convertStrToObj(props.masterData.sQuoConfig, {}); - const [state, setState] = useState(addState.onGetFilterState(sQuoConfig, true)); + const [state, setState] = useState(props.state); const { formData = [] } = state; const { bLinkFieledClick } = props; @@ -896,23 +895,18 @@ const QuickQuoteEvent = props => { masterConfig: masterConfig && masterConfig.length ? masterConfig[0] : {}, }; }; -const getProps = props => { - const { state } = props; - return { - ...props, - }; -}; const QuotationAllprogressDetail = baseProps => { + const { location } = baseProps; // const props = QuickQuoteEvent(baseProps); - const [state, setState] = useState(JsonData.state); + // const [state, setState] = useState(JsonData.state); const propss = { - ...baseProps, + // ...baseProps, + location, ...JsonData, - setState, - state, }; - const props = getProps(propss); + const props = QuickQuoteEvent(propss); + console.log("🚀 ~ QuotationAllprogressDetail:", props); return (
@@ -1296,8 +1290,8 @@ const BoxComponent = props => { viewRow: slaveRowData, tableName: `slaveDown${boxModel}`, }; - console.log(downViewProps,'downViewProps'); - + console.log(downViewProps, "downViewProps"); + const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []); const radioValue = calcMethodData[0]?.sCode; const [materialLength, setMaterialLength] = useState(0); @@ -1421,25 +1415,7 @@ const BoxComponent = props => { setBoxPopup(true); } }; - useEffect(() => { - // const boxModelData = slaveData.find(x => x.sBoxModel === boxModel); - // const selectListDetail = selectList.find(x => x.sName === boxModelData?.sName); - // const data = selectList.find(x => x.sId === selectListDetail.sId); - // if (!data) return; - // const slaveNewData = JSON.parse(data.sColumnNameConfig).map(x => { - // return { - // [x.sName]: x.sDefault, - // }; - // }); - // const slaveDataDetail = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; - // const rowData = { - // ...slaveDataDetail, - // ...data, - // ...Object.assign({}, ...slaveNewData), - // }; - // setSlaveRowData(rowData); - // setSelected(selectListDetail?.sBoxType); - }, [slaveData]); + return (