Skip to content

Commit

Permalink
Merge pull request #94 from NJUPT-SAST/love98-dev
Browse files Browse the repository at this point in the history
feat: 评委评价界面UI优化 & 字段修改 & rm 地理与生物信息学院
  • Loading branch information
BQXBQX authored Mar 23, 2024
2 parents b92868a + b4fc0bf commit fc395b7
Show file tree
Hide file tree
Showing 14 changed files with 225 additions and 173 deletions.
2 changes: 1 addition & 1 deletion src/api/judge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const getJudgeWorkTotal = (workId: number) => {
* 提交作品评分信息
* @param workId 作品 id
* @param score 评的分 0 ~ 100
* @param opinion 评价
* @param opinion 评语
* @return axios 对象
*/
export const uploadWorkScoreInfo = (workId: number, score: number, opinion: string) => {
Expand Down
24 changes: 12 additions & 12 deletions src/pages/account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,18 @@ function Main() {
title: '姓名',
content: `${userProfile[0].name}`,
},
grade: {
title: '年级',
content: `20${userProfile[0].code.charAt(1)}${userProfile[0].code.charAt(2)}级`
// },
// faculty: {
// title: '学院',
// content: `${userProfile[0].college}`,
// },
// major: {
// title: '专业',
// content: `${userProfile[0].major}`,
},
// grade: {
// title: '年级',
// content: `20${userProfile[0].code.charAt(1)}${userProfile[0].code.charAt(2)}级`
// },
// faculty: {
// title: '学院',
// content: `${userProfile[0].college}`,
// },
// major: {
// title: '专业',
// content: `${userProfile[0].major}`,
// },
}

// const [accountInfo, setAccountInfo] = useState<Record<string, InfoItem>>({
Expand Down
1 change: 0 additions & 1 deletion src/pages/create/Components/reviewerSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const a = [
'材料与工程学院',
'化学与生命科学学院',
'物联网学院',
'地理与生物信息学院',
'现代邮政学院',
'传媒与艺术学院',
'管理学院',
Expand Down
16 changes: 8 additions & 8 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ const Home = () => {
}
})
switch (res.data.data.role) {
case 3:
setUserState('admin')
localStorage.setItem('userState', 'admin')
break
case 2:
setUserState('approver')
localStorage.setItem('userState', 'approver')
break
case 0:
setUserState('user')
localStorage.setItem('userState', 'user')
Expand All @@ -96,6 +88,14 @@ const Home = () => {
setUserState('judge')
localStorage.setItem('userState', 'judge')
break
case 2:
setUserState('approver')
localStorage.setItem('userState', 'approver')
break
case 3:
setUserState('admin')
localStorage.setItem('userState', 'admin')
break
default:
break
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ function Register() {
{ label: '材料与工程学院', value: '材料与工程学院' },
{ label: '化学与生命科学学院', value: '化学与生命科学学院' },
{ label: '物联网学院', value: '物联网学院' },
{ label: '地理与生物信息学院', value: '地理与生物信息学院' },
{ label: '现代邮政学院', value: '现代邮政学院' },
{ label: '传媒与艺术学院', value: '传媒与艺术学院' },
{ label: '管理学院', value: '管理学院' },
Expand Down
2 changes: 1 addition & 1 deletion src/pages/review/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.manage-content-table-title {
margin: 3vh 0 2.5vh 0;
line-height: 3.15vh;
font-size: 3.15vh;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
// text-shadow: 0 2px 4px;
font-weight: normal;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/reviewApprover/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
align-content: center;
// margin: 3vh 0 1vh 0;
line-height: 3.15vh;
font-size: 3.15vh;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
.manage-content-title {
padding-top: 5px;
Expand Down Expand Up @@ -78,6 +78,7 @@
height: 17px;
line-height: 18px;
padding: 10px 14px !important;
font-size: medium;
}
}
.accessorices {
Expand Down Expand Up @@ -107,7 +108,6 @@
line-height: 18px;
padding: 10px 15px;
font-size: 18px;
color: #999;
}
.ant-table-tbody > tr > td:first-child {
color: rgba(0, 0, 0, 0.85);
Expand Down
100 changes: 46 additions & 54 deletions src/pages/reviewApprover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,44 +99,7 @@ const ReviewApprover: React.FC = (props) => {
}
// 处理提交事件
const handleSubmit = () => {
if (score! >= 0 && score! <= 100) {
if (opinion !== null) {
uploadWorkScoreInfo(Number(id), score!, opinion!).then(() => {
notification.info({
message: '✅ 提交成功',
description: '自动返回列表',
top: 20,
placement: 'top',
})
setTimeout(() => {
window.history.back()
}, 100)

// navigate('/review/detail/' + (current + 1))
// if (current === total) {
// setTimeout(() => {
// notification.info({
// message: '😸️ 审批完成',
// description: '这是最后一个',
// top: 20,
// placement: 'top',
// })
// }, 300)
// } else if (current > total) {
// navigate('/review/detail/' + total)
// }
})
} else {
setTimeout(() => {
notification.info({
message: 'x 提交失败',
description: '评价不能为空',
top: 20,
placement: 'top',
})
}, 300)
}
} else {
if (score === null || score === undefined || score <= 0 || score <= 100) {
setTimeout(() => {
notification.info({
message: 'x 提交失败',
Expand All @@ -145,7 +108,36 @@ const ReviewApprover: React.FC = (props) => {
placement: 'top',
})
}, 100)
return
}
if (opinion === null || opinion === undefined) {
setOpinion("")
}
uploadWorkScoreInfo(Number(id), score, String(opinion)).then(() => {
notification.info({
message: '✅ 提交成功',
description: '自动返回列表',
top: 20,
placement: 'top',
})
setTimeout(() => {
window.history.back()
}, 100)

// navigate('/review/detail/' + (current + 1))
// if (current === total) {
// setTimeout(() => {
// notification.info({
// message: '😸️ 审批完成',
// description: '这是最后一个',
// top: 20,
// placement: 'top',
// })
// }, 300)
// } else if (current > total) {
// navigate('/review/detail/' + total)
// }
})
}
useEffect(() => {
// 请求数据,并把列表中的成员是否为队长布尔型换为字符串
Expand All @@ -157,7 +149,7 @@ const ReviewApprover: React.FC = (props) => {
// console.log(result.memberList)

for (let i = 0; i < res.data.data.memberList.length; i++) {
result.memberList[i].isCaptain = i === 0 ? '队长' : '队员'
result.memberList[i].isCaptain = i === 0 ? '负责人' : '团队成员'
}
setDataList(result)
} else {
Expand All @@ -179,19 +171,19 @@ const ReviewApprover: React.FC = (props) => {
name: string
}
const columns: ColumnsType<DataType> = [
{
title: '职位',
dataIndex: 'isCaptain',
key: '1',
},
{
title: '姓名',
dataIndex: 'name',
key: '2',
key: '1',
},
{
title: '学号',
dataIndex: 'code',
key: '2',
},
{
title: '备注',
dataIndex: 'isCaptain',
key: '3',
},
]
Expand Down Expand Up @@ -224,32 +216,32 @@ const ReviewApprover: React.FC = (props) => {
</div>
<div className="content">
<div id="team" className="item">
<h1 style={{ fontSize: '25px' }}>队伍名称</h1>
<h3>队伍: {dataList.teamName}</h3>
<h1 style={{ fontSize: '25px', fontWeight: 700 }}>队伍名称</h1>
<h3>{dataList.teamName}</h3>
</div>

<div id="user-information" className="item">
<h1 style={{ fontSize: '25px' }}>参赛者信息</h1>
<h1 style={{ fontSize: '25px', fontWeight: 700 }}>参赛者信息</h1>
<h3>
<Table<DataType> dataSource={dataList.memberList} columns={columns} />
<Table<DataType> dataSource={dataList.memberList} columns={columns} bordered />
</h3>
</div>

<div id="attach-message" className="item">
<h1 style={{ fontSize: '25px' }}>文字展示</h1>
<h1 style={{ fontSize: '25px', fontWeight: 700 }}>文字展示</h1>
<div className="texts">
{dataList.texts.map((item: any, index: number) => {
return (
<li key={index}>
{item.input}:{item.content}
{item.input}: {item.content}
</li>
)
})}
</div>
</div>

<div id="show-work" className="item">
<h1 style={{ fontSize: '25px' }}>作品展示</h1>
<h1 style={{ fontSize: '25px', fontWeight: 700 }}>作品展示</h1>
<div className="accessorices">
{dataList.accessories.map((item: any, index: number) => {
return (
Expand Down Expand Up @@ -313,7 +305,7 @@ const ReviewApprover: React.FC = (props) => {
/>
</div>
<div className="inputBox">
<span>评价: </span>
<span>评语: </span>
<TextArea
className="inputbox"
rows={4}
Expand All @@ -329,7 +321,7 @@ const ReviewApprover: React.FC = (props) => {
<Input placeholder="请输入0-100之间的数字" id="score" />
</Form.Item>
<Form.Item label="评价">
<Form.Item label="评语">
<TextArea rows={3} placeholder="请输入" id="warning" />
</Form.Item>
</Form> */}
Expand Down
5 changes: 2 additions & 3 deletions src/pages/reviewJudge/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
align-content: center;
// margin: 3vh 0 1vh 0;
line-height: 3.15vh;
font-size: 3.15vh;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
.manage-content-title {
padding-top: 5px;
Expand Down Expand Up @@ -112,8 +112,7 @@
border: none !important;
line-height: 1.7vh;
padding: 0.5vw 0.7vw;
font-size: 0.9vw;
color: #999;
font-size: 18px;
}
.ant-table-tbody > tr > td:first-child {
color: rgba(0, 0, 0, 0.85);
Expand Down
10 changes: 5 additions & 5 deletions src/pages/reviewJudge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ const ReviewJudge: React.FC = (props) => {
<Anchor
// targetOffset={targetOffset}
onClick={(e) => e.preventDefault()}
// affix={false}
// showInkInFixed={true}
// onChange={(link) => console.log('Anchor:OnChange', link)}
// getContainer={() => document.querySelector('.message')}
// affix={false}
// showInkInFixed={true}
// onChange={(link) => console.log('Anchor:OnChange', link)}
// getContainer={() => document.querySelector('.message')}
>
<Link href="#user-information" title="参赛者信息" target="" />
<Link href="#show-work" title="作品展示" />
Expand All @@ -185,7 +185,7 @@ const ReviewJudge: React.FC = (props) => {
<div className="content">{item.code}</div>
</div>
<div className="list-item">
<div className="title">职务:</div>
<div className="title">备注:</div>
<div className="content">{item.isCaptain}</div>
</div>
</div>
Expand Down
17 changes: 13 additions & 4 deletions src/pages/reviewList/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
align-content: center;
margin: 3vh 0 1vh 0;
line-height: 3.15vh;
font-size: 3.15vh;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
.manage-content-title {
padding-top: 5px;
Expand All @@ -25,10 +25,19 @@
margin-right: 1.5vh;
}
}
.manage-content-statistic {
display: flex;
flex-direction: column;
justify-content: space-around;
margin: 15px 0;
height: 150px;
}
.manage-content-table-body {
margin-left: 1.1vw;
margin-right: 0.93vw;
padding: 1.8vh 3.6vw 0 3.6vw;
margin-left: 0;
padding: 0;
border-style: solid;
border-color: rgb(206, 206, 206);
border-radius: 0.5px;
text-align: center;
background-color: #fff;
}
Expand Down
Loading

0 comments on commit fc395b7

Please sign in to comment.