import React, { Component } from 'react'; import moment from 'moment'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; import { Card, Modal, Button, message } from 'antd'; import { StandardTableList } from '../../../components/AXList'; import { renderStatus, addRowKey } from '../../../utils/utils'; const Message = message; @connect(({ loading, product }) => ({ product, loading: loading.models.product, })) export default class TrainingListPage extends Component { constructor(props) { super(props); const { state } = props.location; this.state = { UIParams: (state || {}).UIParams, // 组件的状态参数 Queryers: (state || {}).Queryers, // 查询的条件参数 }; } componentDidMount() { this.props.dispatch({ type: 'product/fetchTrainingList', payload: { ...this.state.Queryers }, }); } handleCreateOperation = () => { this.props.dispatch(routerRedux.push({ pathname: '/product/training/create', state: this.state, })); }; handleDeleteOperation = (item) => { Modal.confirm({ okText: '确定', cancelText: '取消', title: '你确定要删除该师训吗?', onOk: () => { this.props.dispatch({ type: 'product/deleteTrainingItem', payload: { id: item.id }, states: this.state, }); }, }); }; handleEditOperation = (item) => { this.props.dispatch(routerRedux.push({ pathname: `/product/training/edit/${item.pid}`, state: this.state, })); }; handleFilterOperation = (params, states) => { this.props.dispatch({ type: 'product/fetchTrainingList', payload: params, }); this.setState({ UIParams: states, Queryers: params, }); }; handleBatchOperation = () => { Message.info('暂不支持批量操作!'); }; render() { const { loading, product } = this.props; const { list, totalSize, pageSize, pageNo } = product; const renderOperation = (item) => { return (