From 503547de78c7e1800494f99979905617de4aa0d1 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 24 Oct 2024 16:59:06 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=89=80=E6=9C=89=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E3=80=90=E6=8A=A5=E4=BB=B7=E4=BF=A1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E3=80=91;=20=E9=BB=98=E8=AE=A4=20`=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=92=8C=E6=8A=A5=E4=BB=B7=E4=BF=A1=E9=83=BD=E8=A6=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useProductsSets.js | 8 ++++---- src/views/products/Detail/ProductInfoForm.jsx | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hooks/useProductsSets.js b/src/hooks/useProductsSets.js index cbd8357..612d8d4 100644 --- a/src/hooks/useProductsSets.js +++ b/src/hooks/useProductsSets.js @@ -105,14 +105,14 @@ export const useProductsTypesFieldsets = (type) => { const infoDisplay = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? ['display_to_c'] : []; const infoRecDisplay = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? ['recommends_rate'] : []; const infoTypesMap = { - '6': [[], []], - 'B': [['km'], []], + '6': [[...infoDisplay], []], + 'B': [['km', ...infoDisplay], []], 'J': [[...infoRecDisplay, 'duration', ...infoDisplay], ['description']], 'Q': [[...infoRecDisplay, 'duration', ...infoDisplay], ['description']], 'D': [[...infoRecDisplay, 'duration', ...infoDisplay], ['description']], - '7': [[...infoRecDisplay, 'duration', 'open_weekdays'], ['description']], + '7': [[...infoRecDisplay, 'duration', 'open_weekdays', ...infoDisplay], ['description']], 'R': [[...infoDisplay], ['description']], - '8': [[], []], + '8': [[...infoDisplay], []], }; const thisTypeFieldset = (_type) => { if (isEmpty(_type)) { diff --git a/src/views/products/Detail/ProductInfoForm.jsx b/src/views/products/Detail/ProductInfoForm.jsx index 1822321..de2a718 100644 --- a/src/views/products/Detail/ProductInfoForm.jsx +++ b/src/views/products/Detail/ProductInfoForm.jsx @@ -41,6 +41,7 @@ const InfoForm = ({ onSubmit, onReset, onValuesChange, editablePerm, infoEditabl const lgc_details_mapped = (editingProduct?.lgc_details || []).reduce((r, c) => ({ ...r, [c.lgc]: c }), {}); form.setFieldValue('lgc_details_mapped', lgc_details_mapped); form.setFieldValue('quotation', editingProduct?.quotation); + form.setFieldValue('display_to_c', editingProduct?.display_to_c || 0); setPickEditedInfo({ ...pickEditedInfo, product_title: editingProduct?.info?.product_title }); setFormEditable(infoEditable || priceEditable);