|
|
@ -60,10 +60,6 @@ export default class Analysis extends Component { |
|
|
this.setState({ |
|
|
this.setState({ |
|
|
rangePickerValue, |
|
|
rangePickerValue, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
this.props.dispatch({ |
|
|
|
|
|
type: 'chart/fetchSalesData', |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
selectDate = (type) => { |
|
|
selectDate = (type) => { |
|
|
@ -88,7 +84,7 @@ export default class Analysis extends Component { |
|
|
salesTypeData, |
|
|
salesTypeData, |
|
|
salesTypeDataOnline, |
|
|
salesTypeDataOnline, |
|
|
salesTypeDataOffline, |
|
|
salesTypeDataOffline, |
|
|
} = chart; |
|
|
} = chart; |
|
|
|
|
|
|
|
|
const salesPieData = salesType === 'all' ? |
|
|
const salesPieData = salesType === 'all' ? |
|
|
salesTypeData |
|
|
salesTypeData |
|
|
@ -144,6 +140,8 @@ export default class Analysis extends Component { |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const activeKey = currentTabKey || (offlineData[0] && offlineData[0].name); |
|
|
|
|
|
|
|
|
const CustomTab = ({ data, currentTabKey: currentKey }) => ( |
|
|
const CustomTab = ({ data, currentTabKey: currentKey }) => ( |
|
|
<Row gutter={8} style={{ width: 138, margin: '8px 28px' }}> |
|
|
<Row gutter={8} style={{ width: 138, margin: '8px 28px' }}> |
|
|
<Col span={12}> |
|
|
<Col span={12}> |
|
|
@ -156,7 +154,7 @@ export default class Analysis extends Component { |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={12} style={{ paddingTop: 36 }}> |
|
|
<Col span={12} style={{ paddingTop: 36 }}> |
|
|
<Pie |
|
|
<Pie |
|
|
animate={(currentKey === data.name)} |
|
|
animate={false} |
|
|
color={(currentKey !== data.name) && '#99d5fd'} |
|
|
color={(currentKey !== data.name) && '#99d5fd'} |
|
|
inner={0.55} |
|
|
inner={0.55} |
|
|
tooltip={false} |
|
|
tooltip={false} |
|
|
@ -365,13 +363,13 @@ export default class Analysis extends Component { |
|
|
style={{ marginTop: 24 }} |
|
|
style={{ marginTop: 24 }} |
|
|
> |
|
|
> |
|
|
<Tabs |
|
|
<Tabs |
|
|
activeKey={currentTabKey || (offlineData[0] && offlineData[0].name)} |
|
|
activeKey={activeKey} |
|
|
onChange={this.handleTabChange} |
|
|
onChange={this.handleTabChange} |
|
|
> |
|
|
> |
|
|
{ |
|
|
{ |
|
|
offlineData.map(shop => ( |
|
|
offlineData.map(shop => ( |
|
|
<TabPane |
|
|
<TabPane |
|
|
tab={<CustomTab data={shop} currentTabKey={currentTabKey} />} |
|
|
tab={<CustomTab data={shop} currentTabKey={activeKey} />} |
|
|
key={shop.name} |
|
|
key={shop.name} |
|
|
> |
|
|
> |
|
|
<div style={{ padding: '0 24px' }}> |
|
|
<div style={{ padding: '0 24px' }}> |
|
|
|