perf: 客服-酒店: 筛选结果: 城市名字

main
Lei OT 2 weeks ago
parent 12022a455c
commit d978f1e280

@ -157,9 +157,11 @@ class HotelCruise {
{} {}
); );
summaryDelta.RecommendRateDelta = queryParam.Compare === '0' ? undefined : fixTo2Decimals((summaryRow.RecommendRate - (summaryRow.CPRecommendRate || 0)) * 100); summaryDelta.RecommendRateDelta = queryParam.Compare === '0' ? undefined : fixTo2Decimals((summaryRow.RecommendRate - (summaryRow.CPRecommendRate || 0)) * 100);
const resfilter = resCP.map(row => ({text: row.CityName, value: row.CityName})).sort((a, b) => a.text.localeCompare(b.text));
runInAction(() => { runInAction(() => {
this.hotel.loading = false; this.hotel.loading = false;
this.hotel.dataSource = resCP; this.hotel.dataSource = resCP;
this.hotel.filters = resfilter;
this.hotel.summaryRow = { ...summaryRow, ...summaryDelta }; this.hotel.summaryRow = { ...summaryRow, ...summaryDelta };
}); });
} }
@ -181,8 +183,8 @@ class HotelCruise {
this.searchValuesToSub = obj; this.searchValuesToSub = obj;
} }
cruise = { loading: false, dataSource: [], summaryRow: {} }; cruise = { loading: false, dataSource: [], summaryRow: {}, filters: [] };
hotel = { loading: false, dataSource: [], summaryRow: {} }; hotel = { loading: false, dataSource: [], summaryRow: {}, filters: [] };
resetData = () => { resetData = () => {
this.results.loading = false; this.results.loading = false;
for (const key of Object.keys(this.results)) { for (const key of Object.keys(this.results)) {

@ -9,7 +9,7 @@ const { Text } = Typography;
export default observer((props) => { export default observer((props) => {
const { date_picker_store: searchFormStore } = useContext(stores_Context); const { date_picker_store: searchFormStore } = useContext(stores_Context);
const { date_picker_store, HotelCruiseStore } = useContext(stores_Context); const { date_picker_store, HotelCruiseStore } = useContext(stores_Context);
const { loading, dataSource, summaryRow } = HotelCruiseStore.hotel; const { loading, dataSource, summaryRow, filters } = HotelCruiseStore.hotel;
const { formValues, siderBroken } = searchFormStore; const { formValues, siderBroken } = searchFormStore;
@ -25,6 +25,9 @@ export default observer((props) => {
title: '目的地', title: '目的地',
sorter: (a, b) => a.CityName.localeCompare(b.CityName, 'zh-CN'), sorter: (a, b) => a.CityName.localeCompare(b.CityName, 'zh-CN'),
children: [{ title: summaryRow.CityName, dataIndex: 'CityName', key: 'CityName' }], children: [{ title: summaryRow.CityName, dataIndex: 'CityName', key: 'CityName' }],
filters: filters,
onFilter: (value, record) => record.CityName === value,
filterSearch: true,
}, },
{ {
title: '总间夜', title: '总间夜',

Loading…
Cancel
Save