import React, { useState, useEffect, useRef, Component } from 'react' import { connect } from 'dva' import { initFilter, addRuleAndGroups, guid, extendInclude, extendRule, extendOrder, extend, initQueryFilter } from "../../../utils/common" import { Table, Row, Col, Button, Select, DatePicker, message } from 'antd'; class NotificationTaskAnalysis extends React.Component { constructor(props) { super(props); this.state = { pagination: {}, showLoading: false, retData: [], }; }; componentDidMount() { let currentType = "1"; if (this.props.formParam != undefined || this.props.formParam != null) { currentType = this.props.formParam.type; } if (currentType == 2) { this.state.columns1 = [ { title: '序号', render: (text, record, index) => `${index + 1}` }, { title: '班组', dataIndex: 'NAME1', }, { title: '昨天', dataIndex: 'NAME2', }, { title: '今天', dataIndex: 'NAME3', }, { title: '明天', dataIndex: 'NAME4', }, { title: '后天', dataIndex: 'NAME5', }, ] this.loadData1(); } else { this.state.columns1 = [ { title: '序号', render: (text, record, index) => `${index + 1}` }, { title: '模块', dataIndex: 'NAME1', }, { title: '表单名称', dataIndex: 'NAME2', }, { title: '待办数', dataIndex: 'NAME3', sorter: (a, b) => a.NAME3 - b.NAME3, }, { title: '完成数', dataIndex: 'NAME4', sorter: (a, b) => a.NAME4 - b.NAME4, }, { title: '完成率', dataIndex: 'NAME5', sorter: (a, b) => a.NAME5 - b.NAME5, render: (text, record) => ( {record.NAME5}{"%"} ), }, { title: '及时完成率', dataIndex: 'NAME6', sorter: (a, b) => a.NAME6 - b.NAME6, render: (text, record) => ( {record.NAME6}{"%"} ), }, { title: '总数', dataIndex: 'NAME7', sorter: (a, b) => a.NAME7 - b.NAME7, }, ] this.loadData(); } }; loadData = () => { const json = initFilter(this.props.login.OrgId); this.state.showLoading = true; json.Parameter1 = new Date().getFullYear() + "-01-01"; this.props.dispatch({ type: 'app/getDataByPost', url: 'BI/BIController/getNotificationTask', payload: json, onlyData: false, onComplete: (ret) => { if (ret) { this.state.showLoading = false; ret.Data.sort((a, b) => { if (a.NAME3 > b.NAME3) { return -1; } else if (a.NAME3 < b.NAME3) { return 1; } else { return 0; } }); this.state.retData = ret.Data } } }) } loadData1 = () => { const json = initFilter(this.props.login.OrgId); this.state.showLoading = true; this.props.dispatch({ type: 'app/getDataByPost', url: 'BI/BIController/getScheduling', payload: json, onlyData: false, onComplete: (ret) => { if (ret) { this.state.showLoading = false; this.state.retData = ret.Data } } }) } onChange = (type, value) => { this.setState({ [type]: value }) } paginationConfig = { pageSizeOptions: ['10', '20', '50', '100'], pageSize: 50, showSizeChanger: true, size: 'small', } render() { return (