|
@@ -1,182 +1,115 @@
|
|
|
|
+
|
|
import React, { Component } from 'react';
|
|
import React, { Component } from 'react';
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
-import { Card, Modal, Button, message } from 'antd';
|
|
|
|
-const Message = message;
|
|
|
|
|
|
+import { connect } from 'dva';
|
|
|
|
+import { Card, message, Badge } from 'antd';
|
|
|
|
+import { StandardTableList } from '../../../components/AXList';
|
|
|
|
+import { addRowKey, renderStatus } from '../../../utils/utils';
|
|
|
|
+
|
|
|
|
+@connect(({ loading, accounts }) => ({
|
|
|
|
+ accounts,
|
|
|
|
+ loading: loading.models.accounts,
|
|
|
|
+}))
|
|
|
|
|
|
export default class TotalListAccountsPage extends Component {
|
|
export default class TotalListAccountsPage extends Component {
|
|
constructor(props) {
|
|
constructor(props) {
|
|
super(props);
|
|
super(props);
|
|
|
|
+ const { state } = props.location;
|
|
|
|
+ this.state = {
|
|
|
|
+ UIParams: (state || {}).UIParams, // 组件的状态参数
|
|
|
|
+ Queryers: (state || {}).Queryers, // 查询的条件参数
|
|
|
|
+ };
|
|
}
|
|
}
|
|
- componentDidMount() {
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ componentWillMount() {
|
|
|
|
+ // 获取总的学校得数量
|
|
|
|
+ this.props.dispatch({
|
|
|
|
+ type: 'accounts/fetchCampusAmount'
|
|
|
|
+ })
|
|
|
|
+ // 获取总表数据
|
|
|
|
+ this.props.dispatch({
|
|
|
|
+ type: 'accounts/fetchTotalList',
|
|
|
|
+ payload: { ...this.state.Queryers }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ handleFilterOperation = (params, states) => {
|
|
|
|
+ this.setState({
|
|
|
|
+ UIParams: states,
|
|
|
|
+ Queryers: params,
|
|
|
|
+ });
|
|
|
|
+ this.props.dispatch({
|
|
|
|
+ type: 'accounts/fetchTerminalsList',
|
|
|
|
+ payload: {
|
|
|
|
+ ...params,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
|
+ const { loading,accounts } = this.props;
|
|
|
|
+ console.log('>>>>>>>>>>>>>this.props',this.props)
|
|
|
|
+ const { list, totalSize, pageSize, pageNo } = accounts;
|
|
|
|
+
|
|
|
|
+ const basicSearch = {
|
|
|
|
+ keys: [{
|
|
|
|
+ name: '终端编号',
|
|
|
|
+ field: 'code',
|
|
|
|
+ }],
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const pagination = {
|
|
|
|
+ pageNo,
|
|
|
|
+ pageSize,
|
|
|
|
+ totalSize,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const columns = [{
|
|
|
|
+ title: '校区类型',
|
|
|
|
+ key: 1,
|
|
|
|
+ dataIndex: 'merchantName',
|
|
|
|
+ width: '15%',
|
|
|
|
+ }, {
|
|
|
|
+ title: '校区名称',
|
|
|
|
+ key: 2,
|
|
|
|
+ dataIndex: 'campusName',
|
|
|
|
+ width: '20%',
|
|
|
|
+ }, {
|
|
|
|
+ title: '终端编号',
|
|
|
|
+ key: 3,
|
|
|
|
+ dataIndex: 'code',
|
|
|
|
+ width: '20%',
|
|
|
|
+ }, {
|
|
|
|
+ title: '终端名称',
|
|
|
|
+ key: 4,
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
+ width: '30%',
|
|
|
|
+ }, {
|
|
|
|
+ title: '课程状态',
|
|
|
|
+ key: 5,
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
+ render: text => renderStatus(text),
|
|
|
|
+ width: '15%',
|
|
|
|
+ }];
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<Card>
|
|
<Card>
|
|
- TotalListAccountsPage
|
|
|
|
|
|
+ <StandardTableList
|
|
|
|
+ columns={columns}
|
|
|
|
+ loading={loading}
|
|
|
|
+ dataSource={addRowKey(list)}
|
|
|
|
+ header={{
|
|
|
|
+ basicSearch,
|
|
|
|
+ onFilterClick: this.handleFilterOperation,
|
|
|
|
+ }}
|
|
|
|
+ footer={{
|
|
|
|
+ pagination,
|
|
|
|
+ }}
|
|
|
|
+ keepUIState={{ ...this.state.UIParams }}
|
|
|
|
+ showStatusSelect={false}
|
|
|
|
+ />
|
|
</Card>
|
|
</Card>
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-// import React, { Component } from 'react';
|
|
|
|
-// import moment from 'moment';
|
|
|
|
-// import { connect } from 'dva';
|
|
|
|
-// import { Card, message, Badge } from 'antd';
|
|
|
|
-// import { StandardTableList } from '../../../components/AXList';
|
|
|
|
-// import { addRowKey } from '../../../utils/utils';
|
|
|
|
-// import styles from './AccountsTerminals.less';
|
|
|
|
-// const Message = message;
|
|
|
|
-// const timestamp2Str = ts => moment(ts).format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
-
|
|
|
|
-// @connect(({ loading, accounts }) => ({
|
|
|
|
-// accounts,
|
|
|
|
-// loading: loading.models.terminal,
|
|
|
|
-// }))
|
|
|
|
-
|
|
|
|
-// export default class TerminalsAccountsPage extends Component {
|
|
|
|
-// constructor(props) {
|
|
|
|
-// super(props);
|
|
|
|
-// const { state } = props.location;
|
|
|
|
-// this.state = {
|
|
|
|
-// UIParams: (state || {}).UIParams, // 组件的状态参数
|
|
|
|
-// Queryers: (state || {}).Queryers, // 查询的条件参数
|
|
|
|
-// };
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// componentWillMount() {
|
|
|
|
-// console.log('TerminalsAccountsPage');
|
|
|
|
-
|
|
|
|
-// this.props.dispatch({
|
|
|
|
-// type: 'accounts/fetchTerminalsList',
|
|
|
|
-// payload: { ...this.state.Queryers }
|
|
|
|
-// })
|
|
|
|
-// }
|
|
|
|
-// handleDownloadOperation = () => {
|
|
|
|
-// this.props.dispatch({
|
|
|
|
-// type: 'accounts/fetchTerminalsExcel'
|
|
|
|
-// })
|
|
|
|
-// };
|
|
|
|
-// handleFilterOperation = (params, states) => {
|
|
|
|
-// this.setState({
|
|
|
|
-// UIParams: states,
|
|
|
|
-// Queryers: params,
|
|
|
|
-// });
|
|
|
|
-// this.props.dispatch({
|
|
|
|
-// type: 'accounts/fetchTerminalsList',
|
|
|
|
-// payload: {
|
|
|
|
-// ...params,
|
|
|
|
-// },
|
|
|
|
-// });
|
|
|
|
-// };
|
|
|
|
-
|
|
|
|
-// handleBatchOperation = () => {
|
|
|
|
-// Message.info('暂不支持批量操作!');
|
|
|
|
-// };
|
|
|
|
-// render() {
|
|
|
|
-// const { loading,accounts } = this.props;
|
|
|
|
-// const { list, totalSize, pageSize, pageNo } = accounts;
|
|
|
|
-// const batchActions = [{
|
|
|
|
-// key: 'delete',
|
|
|
|
-// name: '批量禁用',
|
|
|
|
-// }, {
|
|
|
|
-// key: 'recovery',
|
|
|
|
-// name: '批量解禁',
|
|
|
|
-// }, {
|
|
|
|
-// key: 'unbound',
|
|
|
|
-// name: '批量解绑',
|
|
|
|
-// }];
|
|
|
|
-
|
|
|
|
-// const basicSearch = {
|
|
|
|
-// keys: [{
|
|
|
|
-// name: '终端编号',
|
|
|
|
-// field: 'code',
|
|
|
|
-// }],
|
|
|
|
-// };
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// const pagination = {
|
|
|
|
-// pageNo,
|
|
|
|
-// pageSize,
|
|
|
|
-// totalSize,
|
|
|
|
-// };
|
|
|
|
-
|
|
|
|
-// const columns = [{
|
|
|
|
-// title: '终端编号',
|
|
|
|
-// key: 1,
|
|
|
|
-// dataIndex: 'ucode',
|
|
|
|
-// width: '15%',
|
|
|
|
-// }, {
|
|
|
|
-// title: '产品编号',
|
|
|
|
-// key: 2,
|
|
|
|
-// dataIndex: 'pcode',
|
|
|
|
-// width: '10%',
|
|
|
|
-// }, {
|
|
|
|
-// title: '产品名称',
|
|
|
|
-// key: 3,
|
|
|
|
-// dataIndex: 'pname',
|
|
|
|
-// width: '15%',
|
|
|
|
-// }, {
|
|
|
|
-// title: '权限有效期',
|
|
|
|
-// key: 4,
|
|
|
|
-// render: (_, record) => {
|
|
|
|
-// const { startTime, endTime } = record;
|
|
|
|
-// return (
|
|
|
|
-// <div className={styles.authDesc}>
|
|
|
|
-// <p><span>起始时间: </span>{`${timestamp2Str(startTime)}`}</p>
|
|
|
|
-// <p><span>到期时间: </span>{`${timestamp2Str(endTime)}`}</p>
|
|
|
|
-// </div>
|
|
|
|
-// );
|
|
|
|
-// },
|
|
|
|
-// dataIndex: 'cityName',
|
|
|
|
-// width: '30%',
|
|
|
|
-// align: 'center',
|
|
|
|
-// }, {
|
|
|
|
-// title: '权限有效时长',
|
|
|
|
-// key: 5,
|
|
|
|
-// dataIndex: 'endTime',
|
|
|
|
-// render: (text) => {
|
|
|
|
-// const day = moment(text).diff(moment(), 'days');
|
|
|
|
-// if (day < 0) {
|
|
|
|
-// return <Badge status="error" text="已到期" />;
|
|
|
|
-// }
|
|
|
|
-// return <span><span style={{ color: '#52c41a', fontWeight: 'bold' }}>{day}</span>天到期</span>;
|
|
|
|
-// },
|
|
|
|
-// width: '10%',
|
|
|
|
-// }, {
|
|
|
|
-// title: '联系电话',
|
|
|
|
-// key: 6,
|
|
|
|
-// dataIndex: 'campusContactWay',
|
|
|
|
-// width: '12%',
|
|
|
|
-// }, {
|
|
|
|
-// title: '联系人',
|
|
|
|
-// key: 7,
|
|
|
|
-// dataIndex: 'campusContactName',
|
|
|
|
-// width: '8%',
|
|
|
|
-// }, ];
|
|
|
|
-
|
|
|
|
-// return (
|
|
|
|
-// <Card>
|
|
|
|
-// <StandardTableList
|
|
|
|
-// columns={columns}
|
|
|
|
-// loading={loading}
|
|
|
|
-// dataSource={addRowKey(list)}
|
|
|
|
-// header={{
|
|
|
|
-// basicSearch,
|
|
|
|
-// onFilterClick: this.handleFilterOperation,
|
|
|
|
-// onDownload: this.handleDownloadOperation,
|
|
|
|
-// }}
|
|
|
|
-// footer={{
|
|
|
|
-// pagination,
|
|
|
|
-// batchActions,
|
|
|
|
-// onBatchClick: this.handleBatchOperation,
|
|
|
|
-// }}
|
|
|
|
-// keepUIState={{ ...this.state.UIParams }}
|
|
|
|
-// showStatusSelect={false}
|
|
|
|
-// />
|
|
|
|
-// </Card>
|
|
|
|
-// );
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|