forked from Gitlink/forgeplus-react
ccks排行榜
This commit is contained in:
parent
45dde95b5f
commit
0c8de16bf9
|
@ -155,8 +155,7 @@ const Competition = (props) => {
|
|||
props.showNotification("报名信息被管理员驳回!");
|
||||
} else if (['ccks', 'zstp2022'].includes(competitionId) && enrollStatus && enrollStatus.status === 1) {
|
||||
props.showNotification("您的报名信息未通过审核!");
|
||||
} else if(['ccks', 'zstp2022'].includes(competitionId) && applyStatus){
|
||||
|
||||
} else if(['ccks', 'zstp2022'].includes(competitionId) && applyStatus ){
|
||||
}else{
|
||||
!referStatus ? props.showNotification(!referEnd ? `竞赛尚未开始提交作品,提交作品开始时间为:${qzDetail && qzDetail.enroll_date.substring(0, 10)}` : "比赛已结束") : "";
|
||||
}
|
||||
|
@ -193,7 +192,7 @@ const Competition = (props) => {
|
|||
{competitionId === 'qz2022' ? <li className={active === "apply" ? "active" : ""}>
|
||||
<Link to={{ pathname: applyStatus && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名</Link>
|
||||
</li> : <li className={active === "apply" ? "active" : ""}>
|
||||
<Link to={{ pathname: applyStatus||( enrollStatus && enrollStatus.enroll_status) && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus&& ( enrollStatus && !enrollStatus.enroll_status ) && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名</Link>
|
||||
<Link to={{ pathname: applyStatus||( enrollStatus && enrollStatus.status>1) && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus&& ( enrollStatus && enrollStatus.status<2 ) && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名</Link>
|
||||
</li>
|
||||
}
|
||||
{competitionId === 'qz2022' ? <li className={active === "refer" ? "active" : ""}>
|
||||
|
|
|
@ -44,7 +44,7 @@ export default Form.create()((props) => {
|
|||
const applyStatus = qzDetail
|
||||
? Date.parse(new Date()) < Date.parse(new Date(qzDetail.enroll_date))
|
||||
: true;
|
||||
if ((current_user && !current_user.login) || (!applyStatus && (enrollStatus && !enrollStatus.enroll_status))) {
|
||||
if ((current_user && !current_user.login) || (!applyStatus && (enrollStatus && enrollStatus.status<2))) {
|
||||
history.push(`/competition/${competitionId}`);
|
||||
}
|
||||
if (
|
||||
|
|
|
@ -2,21 +2,26 @@ import React, { useEffect, useState } from "react";
|
|||
import { Tabs, Input, Pagination, Table, Tooltip } from 'antd';
|
||||
import { rankingList } from '../api';
|
||||
import rank_start from "../image/rank_start.png";
|
||||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
import './index.scss';
|
||||
import '../index.scss';
|
||||
import { set } from "lodash";
|
||||
const { Search } = Input;
|
||||
function Rank({ isLocal, match }) {
|
||||
const { competitionId } = match.params;
|
||||
const [keyword, setKeyword] = useState('');
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [list, setList] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const columns = [{
|
||||
title: '排名',
|
||||
dataIndex: 'index',
|
||||
dataIndex: 'rank_num',
|
||||
className: 'ranking-num',
|
||||
render: (text, record, i) => {
|
||||
return i < 3 ? <div className={`rank-icon rank${i}`}></div> : i + 1
|
||||
return text < 4 ? <div className={`rank-icon rank${text}`}></div> : text
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -34,10 +39,12 @@ function Rank({ isLocal, match }) {
|
|||
{
|
||||
title: '三元组个数',
|
||||
dataIndex: 'other_score_1',
|
||||
className: 'textCenter',
|
||||
},
|
||||
{
|
||||
title: '分数',
|
||||
dataIndex: 'score',
|
||||
className: 'textCenter',
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -48,7 +55,8 @@ function Rank({ isLocal, match }) {
|
|||
keyword,
|
||||
}).then(res => {
|
||||
if (res && res.data && res.data.message == "success") {
|
||||
setList(res.data.data)
|
||||
setList(res.data.data);
|
||||
setTotal(res.data.count)
|
||||
}
|
||||
})
|
||||
}, [keyword, curPage])
|
||||
|
@ -65,20 +73,29 @@ function Rank({ isLocal, match }) {
|
|||
</div>
|
||||
|
||||
<div className="rank-list">
|
||||
<img className="ccks_start" src={rank_start}/>
|
||||
<img className="ccks_start" src={rank_start} />
|
||||
<div className="rank-search">
|
||||
<Search
|
||||
placeholder='请输入参赛单位/参赛队长姓名进行搜索'
|
||||
placeholder='参赛单位/参赛队长姓名'
|
||||
allowClear
|
||||
enterButton
|
||||
onSearch={(value) => { setKeyword(value) }}
|
||||
onSearch={(value) => { setKeyword(value);setCurPage(1) }}
|
||||
/>
|
||||
</div>
|
||||
<Table
|
||||
{/* <Table
|
||||
rowKey={(row, i) => row.id || i}
|
||||
dataSource={list}
|
||||
columns={columns}
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<PaginationTable
|
||||
loading={loading}
|
||||
dataSource={list}
|
||||
columns={columns}
|
||||
total={total}
|
||||
setCurPage={(page) => setCurPage(page)}
|
||||
current={curPage}
|
||||
pageSize={20} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.rang-bg {
|
||||
position: relative;
|
||||
background-color: #f1f7fc;
|
||||
background-color: #fcfcfc;
|
||||
padding: 20px 0 70px;
|
||||
|
||||
.rank_bg1 {
|
||||
|
@ -56,7 +56,7 @@
|
|||
.rank-search {
|
||||
text-align: right;
|
||||
margin: -15px auto 10px;
|
||||
.ant-input-group-wrapper{
|
||||
.ant-input-group-wrapper {
|
||||
width: 30%;
|
||||
}
|
||||
.ant-input {
|
||||
|
@ -84,27 +84,38 @@
|
|||
padding: 40px;
|
||||
border-radius: 10px;
|
||||
|
||||
.pagination-table .ant-table{
|
||||
border:0;
|
||||
}
|
||||
.ant-table-thead > tr > th {
|
||||
background: inherit;
|
||||
|
||||
.ant-table-column-title {
|
||||
color: #1d2f60;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-tbody > tr > td {
|
||||
border-bottom: 1px dashed #bed4ff;
|
||||
color: #485884;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
||||
.rank-icon {
|
||||
width: 36px;
|
||||
height: 35px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.rank0 {
|
||||
.rank1 {
|
||||
background-image: url("../image/rank_first.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.rank1 {
|
||||
.rank2 {
|
||||
background-image: url("../image/rank_second.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.rank2 {
|
||||
.rank3 {
|
||||
background-image: url("../image/rank_third.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
@ -113,11 +124,21 @@
|
|||
.ant-table-tbody > tr:nth-child(2n) > td {
|
||||
background: #f8faff;
|
||||
}
|
||||
// .ant-table-tbody > tr:nth-child(2) > td {
|
||||
// background: #fff;
|
||||
// }
|
||||
|
||||
.ccks_start{
|
||||
.ccks_start {
|
||||
position: absolute;
|
||||
width: 187px;
|
||||
top: -10px;
|
||||
left: -19px;
|
||||
}
|
||||
|
||||
.ranking-num {
|
||||
text-align: center;
|
||||
}
|
||||
.textCenter {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
|
||||
.rang-bg {
|
||||
position: relative;
|
||||
background-color: #f1f7fc;
|
||||
background-color: #f7f7f7;
|
||||
padding:40px 0 70px;
|
||||
|
||||
.rank_bg1{
|
||||
|
|
Loading…
Reference in New Issue