|
|
|
@ -2,7 +2,7 @@ import { useContext, useEffect, useState } from 'react';
|
|
|
|
|
import { stores_Context } from './../config';
|
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
|
import { Row, Col, Tabs, Spin } from 'antd';
|
|
|
|
|
import { flush, isEmpty, objectMapper } from './../utils/commons';
|
|
|
|
|
import { flush, isEmpty, objectMapper, pick } from './../utils/commons';
|
|
|
|
|
import { KPIObjects } from './../libs/ht';
|
|
|
|
|
import ObjectPanel from '../components/kpi/ObjectPanel';
|
|
|
|
|
import OverviewPanel from './../components/kpi/OverviewPanel';
|
|
|
|
@ -19,12 +19,12 @@ const objectComponents = {
|
|
|
|
|
'country': ObjectPanel,
|
|
|
|
|
};
|
|
|
|
|
const objectFilterKey = {
|
|
|
|
|
'bu': 'HTBusinessUnits',
|
|
|
|
|
'dept': 'DepartmentList',
|
|
|
|
|
'bu': ['HTBusinessUnits'],
|
|
|
|
|
'dept': ['DepartmentList'],
|
|
|
|
|
// 'du': 'du',
|
|
|
|
|
// 'operator': 'operator',
|
|
|
|
|
// 'destination': 'destination',
|
|
|
|
|
'country': 'country',
|
|
|
|
|
'destination': ['city', ],
|
|
|
|
|
'country': ['country'],
|
|
|
|
|
};
|
|
|
|
|
export default observer((props) => {
|
|
|
|
|
const { KPIStore, DictDataStore, date_picker_store: searchFormStore } = useContext(stores_Context);
|
|
|
|
@ -80,11 +80,9 @@ export default observer((props) => {
|
|
|
|
|
// KPIStore.getList(getkpiParam).then((data) => {
|
|
|
|
|
// // setDataSource(data);
|
|
|
|
|
if (objectFilterKey?.[curObject]) {
|
|
|
|
|
const selectItem = searchFormStore.formValues[objectFilterKey[curObject]];
|
|
|
|
|
if (selectItem) {
|
|
|
|
|
selectItem.value = selectItem.key;
|
|
|
|
|
}
|
|
|
|
|
setRetObjects(flush([selectItem]));
|
|
|
|
|
const selectItems = Object.values(pick(searchFormStore.formValues, objectFilterKey[curObject]));
|
|
|
|
|
const _selectItems = flush(selectItems).map((ele) => ({ ...ele, value: ele.key }));
|
|
|
|
|
setRetObjects(_selectItems);
|
|
|
|
|
}
|
|
|
|
|
// });
|
|
|
|
|
};
|
|
|
|
|