子维度查询
parent
c7019a36db
commit
3558f0bf4c
@ -0,0 +1,104 @@
|
||||
import React, {Component} from 'react';
|
||||
import {Row, Col, Button, Tabs, Table} from 'antd';
|
||||
import {
|
||||
ContainerOutlined, CarryOutOutlined,
|
||||
SmileOutlined, TagsOutlined, GlobalOutlined,
|
||||
SearchOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import {stores_Context} from '../config'
|
||||
import {Line} from "@ant-design/charts";
|
||||
import SiteSelect from "../charts/SiteSelect";
|
||||
import {observer} from 'mobx-react';
|
||||
import DatePickerCharts from '../charts/DatePickerCharts'
|
||||
|
||||
class Orders_sub extends Component {
|
||||
|
||||
static contextType = stores_Context;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {ordertype, ordertype_sub} = this.props.match.params;
|
||||
const {orders_store} = this.context;
|
||||
const data_source = orders_store.orderCountData ? orders_store.orderCountData : [];
|
||||
const config = {
|
||||
data: data_source,
|
||||
padding: 'auto',
|
||||
xField: 'xField',
|
||||
yField: 'yField',
|
||||
seriesField: 'seriesField',
|
||||
xAxis: {
|
||||
type: 'timeCat',
|
||||
},
|
||||
label: {},//显示标签
|
||||
legend: {
|
||||
itemValue: {
|
||||
formatter: (text, item) => {
|
||||
const items = data_source.filter((d) => d.seriesField === item.value);//按站点筛选
|
||||
return items.length ? items.reduce((a, b) => a + b.yField, 0) : '';//计算总数
|
||||
},
|
||||
},
|
||||
},
|
||||
smooth: true,
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Row>
|
||||
<Col span={14}>
|
||||
</Col>
|
||||
<Col span={2}>
|
||||
<SiteSelect store={orders_store}/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<DatePickerCharts/>
|
||||
</Col>
|
||||
<Col span={2}>
|
||||
<Button type="primary" icon={<SearchOutlined/>} loading={orders_store.loading} onClick={() => {
|
||||
orders_store.getOrderCount();
|
||||
orders_store.onChange_Tabs(orders_store.active_tab_key);
|
||||
}}>统计</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={[16, {xs: 8, sm: 16, md: 24, lg: 32}]}>
|
||||
|
||||
<Col className="gutter-row" span={24}>
|
||||
<Line {...config} />
|
||||
</Col>
|
||||
|
||||
<Col className="gutter-row" span={24}>
|
||||
<Tabs activeKey={orders_store.active_tab_key}
|
||||
onChange={(active_key) => orders_store.onChange_Tabs(active_key)}>
|
||||
<Tabs.TabPane tab={<span><ContainerOutlined/>来源类型</span>} key="Form">
|
||||
<Table dataSource={orders_store.orderCountData_Form.dataSource}
|
||||
columns={orders_store.orderCountData_Form.columns} size="small"/>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane tab={<span><CarryOutOutlined/>产品类型</span>} key="Product">
|
||||
<Table dataSource={orders_store.orderCountData_Form.dataSource}
|
||||
columns={orders_store.orderCountData_Form.columns} size="small"/>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane tab={<span><SmileOutlined/>国籍</span>} key="Country">
|
||||
<Table dataSource={orders_store.orderCountData_Form.dataSource}
|
||||
columns={orders_store.orderCountData_Form.columns} size="small"/>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane tab={<span><TagsOutlined/>线路</span>} key="line">
|
||||
<Table dataSource={orders_store.orderCountData_Form.dataSource}
|
||||
columns={orders_store.orderCountData_Form.columns} size="small"/>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane tab={<span><GlobalOutlined/>目的地</span>} key="city">
|
||||
<Table dataSource={orders_store.orderCountData_Form.dataSource}
|
||||
columns={orders_store.orderCountData_Form.columns} size="small"/>
|
||||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
</Col>
|
||||
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default observer(Orders_sub);
|
Loading…
Reference in New Issue