diff --git a/src/military/competition.js b/src/military/competition.js index 797f0397..e4520745 100644 --- a/src/military/competition.js +++ b/src/military/competition.js @@ -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' ?
  • { current_user && current_user.login ? !applyStatus && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名
  • :
  • - { current_user && current_user.login ? !applyStatus&& ( enrollStatus && !enrollStatus.enroll_status ) && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名 + 1) && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus&& ( enrollStatus && enrollStatus.status<2 ) && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名
  • } {competitionId === 'qz2022' ?
  • diff --git a/src/military/competition/apply/ccks.jsx b/src/military/competition/apply/ccks.jsx index 695236f8..17213b4e 100644 --- a/src/military/competition/apply/ccks.jsx +++ b/src/military/competition/apply/ccks.jsx @@ -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 ( diff --git a/src/military/competition/rank/index.jsx b/src/military/competition/rank/index.jsx index 66aab4af..b09fc8f3 100644 --- a/src/military/competition/rank/index.jsx +++ b/src/military/competition/rank/index.jsx @@ -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 ?
    : i + 1 + return text < 4 ?
    : 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 }) {
    - +
    { setKeyword(value) }} + onSearch={(value) => { setKeyword(value);setCurPage(1) }} />
    - row.id || i} dataSource={list} columns={columns} - /> + /> */} + + setCurPage(page)} + current={curPage} + pageSize={20} /> diff --git a/src/military/competition/rank/index.scss b/src/military/competition/rank/index.scss index c778f04d..d9ec4ead 100644 --- a/src/military/competition/rank/index.scss +++ b/src/military/competition/rank/index.scss @@ -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; + } } diff --git a/src/military/competition/refer/index.scss b/src/military/competition/refer/index.scss index 62ffb5d3..5cf290ff 100644 --- a/src/military/competition/refer/index.scss +++ b/src/military/competition/refer/index.scss @@ -126,7 +126,7 @@ .rang-bg { position: relative; - background-color: #f1f7fc; + background-color: #f7f7f7; padding:40px 0 70px; .rank_bg1{