Skip to content

Commit

Permalink
Merge pull request #97 from NJUPT-SAST/lay-dev
Browse files Browse the repository at this point in the history
feat: 前端路由更新
  • Loading branch information
MaxtuneLee authored Mar 27, 2024
2 parents f75e8c3 + 4c13fbb commit 4b21929
Show file tree
Hide file tree
Showing 18 changed files with 199 additions and 117 deletions.
4 changes: 2 additions & 2 deletions src/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export const assignJudge = (formData: FormData) => {
}

/**
* 导出作品(分配评委)
* 导出作品后用于分配评委 导出的是一个 excel 文件
* 导出项目(分配评委)
* 导出项目后用于分配评委 导出的是一个 excel 文件
* @param competitionId 活动Id
* @return axios对象
*/
Expand Down
28 changes: 14 additions & 14 deletions src/api/judge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import axios from 'axios'
import { apis } from '.'

/**
* 提交作品审核列表
* @param workId 作品 id
* 提交项目审核列表
* @param workId 项目 id
* @param accept 是否通过 值为 true 或 false (接口文档里类型标的是integer?
* @param opinion 对通过情况的说明
* @return axios 对象
Expand Down Expand Up @@ -36,7 +36,7 @@ export const getJudgeCompetitionList = (page: number) => {
}

/**
* 获取审核作品列表
* 获取审核项目列表
* @param comId 比赛 id
* @param page 当前页数
* @return axios 对象
Expand All @@ -53,8 +53,8 @@ export const getJudgeWorkList = (comId: number, page: number) => {
}

/**
* 获取审核作品信息
* @param workId 作品id
* 获取审核项目信息
* @param workId 项目id
* @return axios 对象
*/
export const getJudgeWorkInfo = (workId: number) => {
Expand Down Expand Up @@ -83,7 +83,7 @@ export const getScoreCompetitionList = (page: number) => {
}

/**
* 获取评分作品列表
* 获取评分项目列表
* @param comId 比赛 id
* @param page 当前页数
* @return axios 对象
Expand All @@ -100,8 +100,8 @@ export const getScoreWorkList = (comId: number, page: number) => {
}

/**
* 获取评分作品信息
* @param workId 作品id
* 获取评分项目信息
* @param workId 项目id
* @return axios 对象
*/
export const getScoreWork = (workId: number) => {
Expand All @@ -117,8 +117,8 @@ export const getScoreWork = (workId: number) => {
})
}
/**
* 获取评分作品总数
* @param workId 作品id
* 获取评分项目总数
* @param workId 项目id
* @return axios 对象
*/
export const getScoreWorkTotal = (workId: number) => {
Expand All @@ -132,8 +132,8 @@ export const getScoreWorkTotal = (workId: number) => {
}

/**
* 获取审批作品总数
* @param workId 作品id
* 获取审批项目总数
* @param workId 项目id
* @return axios 对象
*/
export const getJudgeWorkTotal = (workId: number) => {
Expand All @@ -147,8 +147,8 @@ export const getJudgeWorkTotal = (workId: number) => {
}

/**
* 提交作品评分信息
* @param workId 作品 id
* 提交项目评分信息
* @param workId 项目 id
* @param score 评的分 0 ~ 100
* @param opinion 评语
* @return axios 对象
Expand Down
14 changes: 7 additions & 7 deletions src/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export const getTeamInfo = (competitionId: number) => {
}

/**
* 上传审批作品
* 上传审批项目
* @param competitionId 比赛 id
* @param name 输入框名
* @param introduce 作品介绍
* @param file 评审作品 仅允许zip格式
* @param introduce 项目介绍
* @param file 评审项目 仅允许zip格式
* @returns axios对象
*/
export const uploadWork = (competitionId: number, input: string, file: File, onProgress: any) => {
Expand All @@ -127,7 +127,7 @@ export const uploadWork = (competitionId: number, input: string, file: File, onP
}

/**
* 删除评审作品
* 删除评审项目
* @param competitionId 比赛Id
* @returns axios对象
*/
Expand All @@ -142,7 +142,7 @@ export const deleteWork = (competitionId: number) => {
}

/**
* 获取已提交作品信息
* 获取已提交项目信息
* @param competitionId 比赛Id
* @returns axios对象
*/
Expand All @@ -154,7 +154,7 @@ export const getWorkInfo = (competitionId: number) => {
}

/**
* 获取作品资料表单
* 获取项目资料表单
* @param competitionId 比赛Id
* @returns axios对象
*/
Expand All @@ -166,7 +166,7 @@ export const getWorkSchema = (competitionId: number) => {
}

/**
* 提交作品资料表单
* 提交项目资料表单
* @param competitionId 比赛Id
* @param data 没写描述
* @returns axios对象
Expand Down
12 changes: 6 additions & 6 deletions src/components/TopBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ function TopBar(props?: { activity?: string }) {
window.history.back()
}
const breadcrumbNameMap: Record<string, string> = {
'/activity': '活动广场',
'/activity': '比赛入口',
'/inbox': '收件箱',
'/manage': '活动管理',
'/create': '创建活动',
'/manage': '比赛管理',
'/create': '创建比赛',
'/account': '我的帐号',
'/review': '活动评审',
'/review': '比赛评审',
'/list': '比赛',
'/detail': '活动列表',
'/register': '活动报名',
'/detail': '比赛列表',
'/register': '比赛报名',
'/register-detail': '报名参加详情',
'/notice': '发布公告',
'/work-detail': '项目提交信息',
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function LoginForm(props: loginFormProp) {
return (
<Form name="normal_login" className="login-form" onFinish={props.finishCb}>
<div className="avatar"></div>
<div className={'login-title'}>登录 通用比赛管理评审系统</div>
<Form.Item
className="login-form-body"
name="username"
Expand Down
12 changes: 6 additions & 6 deletions src/pages/home/components/menu/AdminMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardOutlined } from '@ant-design/icons'
import { DashboardOutlined, MessageOutlined, SendOutlined, SettingOutlined } from '@ant-design/icons'
import { useRecoilValue } from 'recoil'
import { userInboxPointState } from '../../../../store/userInboxState'
import { Menu } from 'antd'
Expand All @@ -16,14 +16,14 @@ function AdminMenu(props: any) {
<Menu.Item key="/" icon={<DashboardOutlined />}>
我的账号
</Menu.Item>
<Menu.Item key="/inbox" icon={<DashboardOutlined />}>
<Menu.Item key="/inbox" icon={<MessageOutlined />}>
收件箱 {point === 'on' ? <span className="message-read-or-not"></span> : <></>}
</Menu.Item>
<Menu.Item key="/activity" icon={<DashboardOutlined />}>
活动广场
<Menu.Item key="/activity" icon={<SendOutlined />}>
比赛入口
</Menu.Item>
<Menu.Item key="/manage" icon={<DashboardOutlined />}>
活动管理
<Menu.Item key="/manage" icon={<SettingOutlined />}>
比赛管理
</Menu.Item>
</Menu>
)
Expand Down
12 changes: 6 additions & 6 deletions src/pages/home/components/menu/ApproveMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardOutlined } from '@ant-design/icons'
import { DashboardOutlined, MessageOutlined, SendOutlined, SettingOutlined } from '@ant-design/icons'
import { useRecoilValue } from 'recoil'
import { userInboxPointState } from '../../../../store/userInboxState'
import { Menu } from 'antd'
Expand All @@ -16,14 +16,14 @@ function ApproveMenu(props: any) {
<Menu.Item key="/" icon={<DashboardOutlined />}>
我的账号
</Menu.Item>
<Menu.Item key="/inbox" icon={<DashboardOutlined />}>
<Menu.Item key="/inbox" icon={<MessageOutlined />}>
收件箱{point === 'on' ? <span className="message-read-or-not"></span> : <></>}
</Menu.Item>
<Menu.Item key="/activity" icon={<DashboardOutlined />}>
活动广场
<Menu.Item key="/activity" icon={<SendOutlined />}>
比赛入口
</Menu.Item>
<Menu.Item key="/review" icon={<DashboardOutlined />}>
活动评审
<Menu.Item key="/review" icon={<SettingOutlined />}>
比赛评审
</Menu.Item>
</Menu>
)
Expand Down
12 changes: 6 additions & 6 deletions src/pages/home/components/menu/JudgeMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardOutlined } from '@ant-design/icons'
import { DashboardOutlined, MessageOutlined, SendOutlined, SettingOutlined } from '@ant-design/icons'
import { useRecoilValue } from 'recoil'
import { userInboxPointState } from '../../../../store/userInboxState'
import { Menu } from 'antd'
Expand All @@ -15,14 +15,14 @@ function JudgeMenu(props: any) {
<Menu.Item key="/" icon={<DashboardOutlined />}>
我的账号
</Menu.Item>
<Menu.Item key="/inbox" icon={<DashboardOutlined />}>
<Menu.Item key="/inbox" icon={<MessageOutlined />}>
收件箱{point === 'on' ? <span className="message-read-or-not"></span> : <></>}
</Menu.Item>
<Menu.Item key="/activity" icon={<DashboardOutlined />}>
活动广场
<Menu.Item key="/activity" icon={<SendOutlined />}>
比赛入口
</Menu.Item>
<Menu.Item key="/review" icon={<DashboardOutlined />}>
活动评审
<Menu.Item key="/review" icon={<SettingOutlined />}>
比赛评审
</Menu.Item>
</Menu>
)
Expand Down
6 changes: 3 additions & 3 deletions src/pages/home/components/menu/UnLoginMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Menu } from 'antd'
import { DashboardOutlined } from '@ant-design/icons'
import { DashboardOutlined, SendOutlined } from '@ant-design/icons'
function UnLoginMenu(props: any) {
return (
<Menu
Expand All @@ -9,8 +9,8 @@ function UnLoginMenu(props: any) {
selectedKeys={[props.navigation]}
defaultSelectedKeys={['/']}
>
<Menu.Item key="/" icon={<DashboardOutlined />}>
活动广场
<Menu.Item key="/" icon={<SendOutlined />}>
比赛入口
</Menu.Item>
</Menu>
)
Expand Down
8 changes: 4 additions & 4 deletions src/pages/home/components/menu/UserMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardOutlined } from '@ant-design/icons'
import { DashboardOutlined, MessageOutlined, SendOutlined, SettingOutlined } from '@ant-design/icons'
import { useRecoilValue } from 'recoil'
import { userInboxPointState } from '../../../../store/userInboxState'
import { Menu } from 'antd'
Expand All @@ -16,11 +16,11 @@ function UserMenu(props: any) {
<Menu.Item key="/" icon={<DashboardOutlined />}>
我的账号
</Menu.Item>
<Menu.Item key="/inbox" icon={<DashboardOutlined />}>
<Menu.Item key="/inbox" icon={<MessageOutlined />}>
收件箱{point === 'on' ? <span className="message-read-or-not"></span> : <></>}
</Menu.Item>
<Menu.Item key="/activity" icon={<DashboardOutlined />}>
活动广场
<Menu.Item key="/activity" icon={<SettingOutlined />}>
比赛入口
</Menu.Item>
</Menu>
)
Expand Down
81 changes: 79 additions & 2 deletions src/pages/home/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//顶部横幅
.header {
padding: 0 5px;
padding: 0 15px;
.header-wrap {
display: flex;
justify-content: space-between;
Expand Down Expand Up @@ -74,7 +74,7 @@
display: flex;
flex-direction: column;
align-items: center;
width: 200px;
width: 100vw;
background: rgba(24, 144, 255, 1);
//头像缩略图
.avatar {
Expand Down Expand Up @@ -186,6 +186,83 @@
}
}

.new-login {
background: rgba(237, 237, 237, 1);
.login-form {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100vh;
background: rgba(24, 144, 255, 1);
//头像缩略图

.avatar {
margin: 10px 0;
width: 100px;
height: 100px;
margin-bottom: 50px;
border-radius: 50%;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
background-image: url(https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png);
background-position: center;
background-size: contain;
background-repeat: no-repeat;
}

.login-title {
font-size: 22px;
font-weight: 450;
color: rgba(237, 237, 237, 1);
line-height: 20px;
padding-bottom: 50px;
}

.login-form-body {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 2vw;
width: 20%;
.login-form-input {
border: 2px solid rgba(255, 255, 255, 1);
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
.validate {
border-radius: 5px 0 0 5px;
}
}
//验证码
.validate-part-body {
display: flex;
align-items: top;
width: 20%;
.validate-input {
width: 40%;
}
.validate-img {
width: 60%;
height: 32px;
border-radius: 0 5px 5px 0;
}
}

//登陆的 button
.login-form-button {
width: 12vw;
align-items: center;
border: 1px solid rgba(255, 255, 255, 1);
background: rgba(24, 144, 255, 1);
color: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
border-radius: 5px;
}
}
}

.ant-layout-sider-trigger {
background: #fff;
color: #002140;
Expand Down
Loading

0 comments on commit 4b21929

Please sign in to comment.