From 4267014e81e3940b70c0e98de64a421307f4a88a Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Fri, 25 Jul 2025 10:42:45 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20map=20=E5=9F=8E=E5=B8=82=20to=20[{id:?= =?UTF-8?q?=201,=20name:=20''}]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Detail/ProductInfoForm.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/views/products/Detail/ProductInfoForm.jsx b/src/views/products/Detail/ProductInfoForm.jsx index f2c15f3..143762a 100644 --- a/src/views/products/Detail/ProductInfoForm.jsx +++ b/src/views/products/Detail/ProductInfoForm.jsx @@ -413,6 +413,16 @@ const formValuesMapper = (values) => { { key: 'city_id', transform: (value) => value?.value || value?.key || '' }, { key: 'city_name', transform: (value) => value?.label || '' }, ], + 'city_list': [ + { key: 'city_list', transform: (value) => { + return value.map(option => { + return { + id: option?.value || option?.key || '', + name: option?.label || '' + } + }) + }}, + ], 'dept': { key: 'dept_id', transform: (value) => (typeof value === 'string' ? value : value?.value || value?.key || '') }, 'open_weekdays': { key: 'open_weekdays', transform: (value) => (Array.isArray(value) ? value.join(',') : value) }, // 'recommends_rate': { key: 'recommends_rate', transform: (value) => ((typeof value === 'string' || typeof value === 'number') ? value : value?.value || value?.key || '') },