|
|
@ -1,43 +1,30 @@
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import React, {useContext} from 'react';
|
|
|
|
import {Row, Col, Typography, Space, DatePicker, Button, Select, Table} from 'antd';
|
|
|
|
import { Row, Col, Typography, Space, DatePicker, Button, Select, Table } from 'antd';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
SearchOutlined,
|
|
|
|
SearchOutlined,
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
import {stores_Context} from '../config'
|
|
|
|
import { stores_Context } from '../config'
|
|
|
|
import * as config from "../config";
|
|
|
|
import * as config from "../config";
|
|
|
|
import {observer} from 'mobx-react';
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
import 'moment/locale/zh-cn';
|
|
|
|
import 'moment/locale/zh-cn';
|
|
|
|
import moment from "moment";
|
|
|
|
import moment from "moment";
|
|
|
|
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
|
|
|
|
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
|
|
|
|
|
|
|
|
|
|
|
|
class AgentList extends Component {
|
|
|
|
const AgentList = () => {
|
|
|
|
|
|
|
|
|
|
|
|
static contextType = stores_Context;
|
|
|
|
const { customerServicesStore } = useContext(stores_Context);
|
|
|
|
|
|
|
|
const agentList = customerServicesStore.agentList;
|
|
|
|
constructor(props) {
|
|
|
|
const agentListColumns = customerServicesStore.agentListColumns;
|
|
|
|
super(props);
|
|
|
|
const { startDate, endDate, dateType } = customerServicesStore;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleSearchClick() {
|
|
|
|
const handleSearchClick = () => {
|
|
|
|
const {customerServicesStore} = this.context;
|
|
|
|
|
|
|
|
customerServicesStore.fetchAgentList();
|
|
|
|
customerServicesStore.fetchAgentList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
const {customerServicesStore} = this.context;
|
|
|
|
|
|
|
|
const agentList = customerServicesStore.agentList;
|
|
|
|
|
|
|
|
const agentListColumns = customerServicesStore.agentListColumns;
|
|
|
|
|
|
|
|
const groupList = customerServicesStore.groupList;
|
|
|
|
|
|
|
|
const groupListColumns = customerServicesStore.groupListColumns;
|
|
|
|
|
|
|
|
const {startDate, endDate, dateType} = customerServicesStore;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Space direction="vertical" style={{width: '100%'}}>
|
|
|
|
<Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
<Row gutter={{md: 24}} justify="end">
|
|
|
|
<Row gutter={{ md: 24 }} justify="end">
|
|
|
|
<Col span={4}>
|
|
|
|
<Col span={4}>
|
|
|
|
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
|
|
|
|
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
|
|
|
|
<Select.Option key="1" value="startDate">
|
|
|
|
<Select.Option key="1" value="startDate">
|
|
|
@ -53,7 +40,7 @@ class AgentList extends Component {
|
|
|
|
format={config.DATE_FORMAT} locale={zhCNlocale}
|
|
|
|
format={config.DATE_FORMAT} locale={zhCNlocale}
|
|
|
|
allowClear={false}
|
|
|
|
allowClear={false}
|
|
|
|
value={[startDate, endDate]}
|
|
|
|
value={[startDate, endDate]}
|
|
|
|
onChange={(dates) => {customerServicesStore.selectDateRange(dates[0], dates[1])}}
|
|
|
|
onChange={(dates) => { customerServicesStore.selectDateRange(dates[0], dates[1]) }}
|
|
|
|
ranges={{
|
|
|
|
ranges={{
|
|
|
|
'本周': [moment().startOf('week'), moment().endOf('week')],
|
|
|
|
'本周': [moment().startOf('week'), moment().endOf('week')],
|
|
|
|
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
|
|
|
|
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
|
|
|
@ -72,7 +59,7 @@ class AgentList extends Component {
|
|
|
|
icon={<SearchOutlined />}
|
|
|
|
icon={<SearchOutlined />}
|
|
|
|
loading={false}
|
|
|
|
loading={false}
|
|
|
|
onClick={() => {
|
|
|
|
onClick={() => {
|
|
|
|
this.handleSearchClick();
|
|
|
|
handleSearchClick();
|
|
|
|
}}>
|
|
|
|
}}>
|
|
|
|
统计
|
|
|
|
统计
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
@ -95,7 +82,6 @@ class AgentList extends Component {
|
|
|
|
</Space>
|
|
|
|
</Space>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default observer(AgentList);
|
|
|
|
export default observer(AgentList);
|