From d658432254b52fb41adb2a21244e7e09c0ef2604 Mon Sep 17 00:00:00 2001 From: "2782522198@qq.com" <2782522198@qq.com> Date: Thu, 28 Mar 2024 11:45:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=A1=E6=A0=B8=E3=80=81=E8=AF=84?= =?UTF-8?q?=E5=88=86=E5=B1=95=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/components/menu/JudgeMenu.tsx | 2 +- src/pages/reviewList/index.tsx | 46 ++++++++++++-------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/pages/home/components/menu/JudgeMenu.tsx b/src/pages/home/components/menu/JudgeMenu.tsx index d933fe3..47d6d2a 100644 --- a/src/pages/home/components/menu/JudgeMenu.tsx +++ b/src/pages/home/components/menu/JudgeMenu.tsx @@ -22,7 +22,7 @@ function JudgeMenu(props: any) { 比赛入口 }> - 比赛评审 + 比赛审核 ) diff --git a/src/pages/reviewList/index.tsx b/src/pages/reviewList/index.tsx index f86e4d8..fca3ff1 100644 --- a/src/pages/reviewList/index.tsx +++ b/src/pages/reviewList/index.tsx @@ -47,10 +47,9 @@ function ReviewList() { }, 100) navigate('/review') } - console.log(res.data.data); + // console.log(res.data.data); const programList = res.data.data.list - console.log(programList); if (role === 'approver') { let scoreCount = 0 @@ -68,20 +67,23 @@ function ReviewList() { setIsApproveCount(scoreCount) } else { - let passCount = 0 - let _isPass; + let judgeCount = 0 for (let i = 0; i < programList.length; i++) { - console.log(programList); - - programList[i]?.isPass ? _isPass = true : _isPass = false - programList[i].isPass = _isPass - if (_isPass) { - passCount++ + console.log(programList[i]); + if (programList[i]?.isPass === true) { + judgeCount++; + result.list[i].isJudge = true + result.list[i].isPass = '通过' + } else if (programList[i]?.isPass === false) { + judgeCount++; + result.list[i].isJudge = true + result.list[i].isPass = '未通过' + } else { + result.list[i].isJudge = false + result.list[i].isPass = '' } - result.list[i].isPass = result.list[i].isPass === true ? '通过' : '未通过' - console.log(programList[i].isApprove) } - setIsApproveCount(passCount) + setIsApproveCount(judgeCount) } setProgramList(programList) setDataList(result) @@ -206,11 +208,19 @@ const ProgramList: React.FC = (props: any) => { title: '状态', dataIndex: role === 'approver' ? 'isApprove' : 'isJudge', render: (data) => { - return - - {data ? "已评审" : "未评审"} - - + if (role === 'approver') { + return + + {data ? "已评分" : "未评分"} + + + } else { + return ( + + {data ? "已审核" : "未审核"} + + ) + } } }, {