perf(产品管理): 编辑: 产品树+【城市】

perf/export-docx
Lei OT 11 months ago
parent c101d6660c
commit 04552f3f00

@ -69,21 +69,21 @@ const ProductsTree = ({ onNodeSelect, ...props }) => {
children: (agencyProducts[ele.value] || []).map((product) => { children: (agencyProducts[ele.value] || []).map((product) => {
const lgc_map = product.lgc_details.reduce((rlgc, clgc) => ({...rlgc, [clgc.lgc]: clgc}), {}); const lgc_map = product.lgc_details.reduce((rlgc, clgc) => ({...rlgc, [clgc.lgc]: clgc}), {});
return { return {
title: product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || '', // title: product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || '',
// title: `${product.info.city_name}` + (product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || ''), title: `${product.info.city_name}` + (product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || ''),
// key: `${ele.value}-${product.info.id}`, // key: `${ele.value}-${product.info.id}`,
key: product.info.id, key: product.info.id,
_raw: product, _raw: product,
isLeaf: true, isLeaf: true,
}}), }}),
// `` // ``
_children: Object.keys(copyAgencyProducts[ele.value] || []).map(city => { // _children: Object.keys(copyAgencyProducts[ele.value] || []).map(city => {
return { // return {
title: city, // title: city,
key: `${ele.value}-${city}`, // key: `${ele.value}-${city}`,
children: copyAgencyProducts[ele.value][city], // children: copyAgencyProducts[ele.value][city],
}; // };
}), // }),
})); }));
setTreeData(_show); setTreeData(_show);
setRawTreeData(_show); setRawTreeData(_show);

Loading…
Cancel
Save