|
|
|
@ -80,9 +80,14 @@ const ProductsTree = ({ onNodeSelect, ...props }) => {
|
|
|
|
|
key: ele.value,
|
|
|
|
|
children: (agencyProducts[ele.value] || []).reduce((arr, product) => {
|
|
|
|
|
const lgc_map = product.lgc_details.reduce((rlgc, clgc) => ({ ...rlgc, [clgc.lgc]: clgc }), {});
|
|
|
|
|
const combindCityList = product.info.city_list.indexOf(city => city.id === product.info.city_id) !== -1 ? product.info.city_list : [...product.info.city_list, { id: product.info.city_id, name: product.info.city_name }];
|
|
|
|
|
// const combindCityList = product.info.city_list.indexOf(city => city.id === product.info.city_id) !== -1 ? product.info.city_list : [...product.info.city_list, { id: product.info.city_id, name: product.info.city_name }];
|
|
|
|
|
// const cityListName = product.info.city_list.reduce((acc, city) => {
|
|
|
|
|
// return acc.concat([city.name]);
|
|
|
|
|
// }, []).join(',');
|
|
|
|
|
const hasCityList = !isEmpty(product.info.city_list) && product.info.city_list.some(cc => cc.id !== product.info.city_id) ? ` (含多城市)` : ``;
|
|
|
|
|
const combindCityList = [{ id: product.info.city_id, name: product.info.city_name }];
|
|
|
|
|
const flatCityP = combindCityList.map(city => ({
|
|
|
|
|
title: `【${city.name}】` + (product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || product.info.product_title || ''),
|
|
|
|
|
title: `【${city.name}${hasCityList}】` + (product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || product.info.product_title || ''),
|
|
|
|
|
// key: `${ele.value}-${product.info.id}`,
|
|
|
|
|
key: `${product.info.id}-${city.id}`,
|
|
|
|
|
_raw: product,
|
|
|
|
|