Skip to content

Commit

Permalink
fix:审核、评分展示bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NJUPTlay committed Mar 28, 2024
1 parent 2bc1b0c commit d658432
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/pages/home/components/menu/JudgeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function JudgeMenu(props: any) {
比赛入口
</Menu.Item>
<Menu.Item key="/review" icon={<SettingOutlined />}>
比赛评审
比赛审核
</Menu.Item>
</Menu>
)
Expand Down
46 changes: 28 additions & 18 deletions src/pages/reviewList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -206,11 +208,19 @@ const ProgramList: React.FC<IProgramList> = (props: any) => {
title: '状态',
dataIndex: role === 'approver' ? 'isApprove' : 'isJudge',
render: (data) => {
return <Space>
<Tag color={data ? "green" : "red"} key={data}>
{data ? "已评审" : "未评审"}
</Tag>
</Space>
if (role === 'approver') {
return <Space>
<Tag color={data ? "green" : "red"} key={data}>
{data ? "已评分" : "未评分"}
</Tag>
</Space>
} else {
return (<Space>
<Tag color={data ? "green" : "red"} key={data}>
{data ? "已审核" : "未审核"}
</Tag>
</Space>)
}
}
},
{
Expand Down

0 comments on commit d658432

Please sign in to comment.