From fa71559c92ce8f7429971370ca4bd1139c903621 Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Wed, 27 May 2020 11:16:05 +0800
Subject: [PATCH] oa+用户中心
---
src/components/common/TopListTableView/index.jsx | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/src/components/common/TopListTableView/index.jsx b/src/components/common/TopListTableView/index.jsx
index 0b8423b..d607e53 100644
--- a/src/components/common/TopListTableView/index.jsx
+++ b/src/components/common/TopListTableView/index.jsx
@@ -7,7 +7,9 @@
/** 榜单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';
@@ -22,20 +24,32 @@
}
componentWillMount() {
- this.setState({
- topList: tagList
+ fetch({
+ url: `api/merits/queryMerits`
+ }).then(res => {
+ if( res) {
+ this.setState({
+ topList: [
+ { ...tag['latenessRanking'], dataSource: res['latenessRanking'] },
+ { ...tag['earlyRanking'], dataSource: res['earlyRanking'] },
+ // { ...tag['meritsRanking'], dataSource: res['meritsRanking'] },
+ { ...tag['defectRanking'], dataSource: res['defectRanking'] },
+ ]
+ })
+ }
})
}
componentDidMount() { }
- renderDom = ({ name, columns }) => {
- return <div className="top-list-table-view-main-table">
+ renderDom = ({ name, columns, dataSource }) => {
+ return <div className="top-list-table-view-main-table h-100">
<div className="top-list-table-view-main-table-title">{name}
- <span className="top-list-table-view-main-table-title-fuc">查看</span>
+ {/* <span className="top-list-table-view-main-table-title-fuc">查看</span> */}
</div>
<Table
- dataSource={[{ age: 1 }]}
+ scroll={{ y: 130 }}
+ dataSource={dataSource ? dataSource.map((a, idx) => ({ ...a, key: idx })) : []}
columns={columns}
size="small"
bordered={false}
@@ -51,7 +65,7 @@
<Row type="flex" gutter={12}>
{
topList.map((item, idx) => {
- return <Col span={24 / 3} key={idx}>{this.renderDom(item)}</Col>;
+ return <Col span={24 / topList.length} key={idx} >{this.renderDom(item)}</Col>;
})
}
</Row>
--
Gitblit v1.8.0