From d3aba13a080c6df4e2b03a6e69ac763a419ceea0 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 24 Jul 2025 16:54:02 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=9D=E5=AD=98=E4=BA=A7=E5=93=81:?= =?UTF-8?q?=20=E4=BF=A1=E6=81=AF=E5=8F=98=E6=9B=B4=E5=AD=97=E6=AE=B5+?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E7=A7=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Detail/ProductInfo.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/products/Detail/ProductInfo.jsx b/src/views/products/Detail/ProductInfo.jsx index 43f19ab..ece520a 100644 --- a/src/views/products/Detail/ProductInfo.jsx +++ b/src/views/products/Detail/ProductInfo.jsx @@ -61,7 +61,7 @@ const ProductInfo = ({ ...props }) => { const onValuesChange = (changedValues) => { // console.log('onValuesChange', changedValues); - const changedKeys = objectMapper(changedValues, { 'city': 'city_id', 'dept': 'dept_id', 'product_title': 'title'}); + const changedKeys = objectMapper(changedValues, { 'city': 'city_id', 'dept': 'dept_id', 'product_title': 'title', 'lgc_details_mapped': 'lgc_details'}); setEditKeys(prev => unique([...prev, ...Object.keys(changedKeys)])); // const preValues = pick(editingProduct.info, editKeys); if ('product_title' in changedValues) { @@ -79,7 +79,8 @@ const ProductInfo = ({ ...props }) => { const onSave = async (err, values, forms) => { values.travel_agency_id = activeAgency.travel_agency_id; const editChanged = pick(editingProduct.info, editKeys); - // console.log("editKeys pre values", editKeys, editChanged); + (editKeys.includes('lgc_details') ? editChanged.lgc_details = editingProduct.lgc_details.map(l => l.lgc) : false); + // console.log("editKeys pre values", editKeys, editChanged, '\neditingProduct', ); const copyNewProduct = structuredClone(newProductRecord); const poster = {