forked from huge/frontEnd/hugeOA

1
liuwh
2020-04-06 12d561aea1143eae863d80edebf8b4cbe3cc85df
src/components/common/TopListTableView/index.jsx
@@ -7,7 +7,7 @@
/** 榜单table列表 */
import React, { ReactNode, ReactEventHandler, Component } from 'react';
import { Table, Row, Col } from 'antd';
import { tagList } from './tagList';
import { tagList, tag } from './tagList';
import fetch from '../../../api/request';
import './index.scss';
@@ -28,21 +28,25 @@
      url: `api/merits/queryMerits`
    }).then(res => {
      console.log('res', res);
    })
    this.setState({
      topList: tagList
      this.setState({
        topList: [
          { ...tag['latenessRanking'], dataSource: res['latenessRanking'] },
          { ...tag['meritsRanking'], dataSource: res['meritsRanking'] },
          { ...tag['defectRanking'], dataSource: res['defectRanking'] },
        ]
      })
    })
  }
  componentDidMount() { }
  renderDom = ({ name, columns }) => {
  renderDom = ({ name, columns, dataSource }) => {
    return <div className="top-list-table-view-main-table">
      <div className="top-list-table-view-main-table-title">{name}
        <span className="top-list-table-view-main-table-title-fuc">查看</span>
      </div>
      <Table
        dataSource={[{ age: 1 }]}
        dataSource={dataSource || []}
        columns={columns}
        size="small"
        bordered={false}
@@ -53,6 +57,7 @@
  render() {
    let { topList } = this.state;
    console.log(topList)
    return (
      <div className="top-list-table-view-main">
        <Row type="flex" gutter={12}>