perf: 产品管理: 多城市 显示

main
Lei OT 2 months ago
parent a8fb0bbded
commit ad2e22e22d

@ -84,10 +84,10 @@ const ProductsTree = ({ onNodeSelect, ...props }) => {
// const cityListName = product.info.city_list.reduce((acc, city) => { // const cityListName = product.info.city_list.reduce((acc, city) => {
// return acc.concat([city.name]); // return acc.concat([city.name]);
// }, []).join(','); // }, []).join(',');
const hasCityList = !isEmpty(product.info.city_list) && product.info.city_list.some(cc => cc.id !== product.info.city_id) ? ` (含多城市)` : ``; 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 combindCityList = [{ id: product.info.city_id, name: product.info.city_name }];
const flatCityP = combindCityList.map(city => ({ const flatCityP = combindCityList.map(city => ({
title: `${city.name}${hasCityList}` + (product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || product.info.product_title || ''), title: `${city.name}` + (product.info.title || lgc_map?.['2']?.title || lgc_map?.['1']?.title || product.info.product_title || '') + `${hasCityList}`,
// key: `${ele.value}-${product.info.id}`, // key: `${ele.value}-${product.info.id}`,
key: `${product.info.id}-${city.id}`, key: `${product.info.id}-${city.id}`,
_raw: product, _raw: product,

Loading…
Cancel
Save