Skip to content

Commit

Permalink
change: Modify page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
meua committed Jan 30, 2024
1 parent aca7526 commit caade52
Show file tree
Hide file tree
Showing 27 changed files with 1,005 additions and 172 deletions.
18 changes: 9 additions & 9 deletions src/api/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ export const challengeTeam = (challengeId) =>
url: `/api/challenges/${challengeId}/participant_team/team_detail`,
});

// 查询phase
export const challengePhase = (challengeId) =>
// 查询track
export const challengeTrack = (challengeId) =>
service({
method: 'get',
url: `/api/challenges/challenge/${challengeId}/challenge_phase`,
});

// 查询提交列表
export const getSubmission = (challengeId, phaseId, params) =>
export const getSubmission = (challengeId, trackId, params) =>
service({
method: 'get',
url: `/api/jobs/challenge/${challengeId}/challenge_phase/${phaseId}/submission/`,
url: `/api/jobs/challenge/${challengeId}/challenge_phase/${trackId}/submission/`,
params,
});

// 更新提交列表
export const updateSubmission = (challengeId, phaseId, submisId, data) =>
export const updateSubmission = (challengeId, trackId, submisId, data) =>
service({
method: 'PATCH',
url: `/api/jobs/challenge/${challengeId}/challenge_phase/${phaseId}/submission/${submisId}`,
url: `/api/jobs/challenge/${challengeId}/challenge_phase/${trackId}/submission/${submisId}`,
data,
});

// 获取赛道
export const getPhaseSplit = (challengeId) =>
export const getTrackSplit = (challengeId) =>
service({
method: 'get',
url: `/api/challenges/${challengeId}/challenge_phase_split`,
Expand Down Expand Up @@ -95,10 +95,10 @@ export const disapproveTeam = (challengeId, teamId) =>
});

// 查询某个阶段的所有提交
export const getAllSubmissions = (challengeId, phaseId) =>
export const getAllSubmissions = (challengeId, trackId) =>
service({
method: 'get',
url: `/api/challenges/${challengeId}/challenge_phase/${phaseId}/submissions`,
url: `/api/challenges/${challengeId}/challenge_phase/${trackId}/submissions`,
});

// 取消正在执行的任务
Expand Down
12 changes: 6 additions & 6 deletions src/api/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const getAllChallenges = (challenge_time, challenge_approved, challenge_p
params,
});

// 创建phase
export const createPhase = (challenge_pk, data) =>
// 创建track
export const createTrack = (challenge_pk, data) =>
service({
method: 'post',
url: `/api/challenges/challenge/challenge_host_team/${challenge_host_team_pk}/challenges/${challenge_pk}/create_or_update_challenge_phase/`,
Expand All @@ -40,8 +40,8 @@ export const verifyHostUser = () =>
},
});

// 查询phase详情
export const getPhaseDetail = (challenge_pk, id) =>
// 查询track详情
export const getTrackDetail = (challenge_pk, id) =>
service({
method: 'get',
url: `/api/challenges/challenge/${challenge_pk}/challenge_phase/${id}`,
Expand All @@ -54,8 +54,8 @@ export const delChallenge = (challenge_pk) =>
url: `/api/challenges/challenge_host_team/${challenge_host_team_pk}/challenge/${challenge_pk}`,
});

// 删除Phase
export const delPhase = (challenge_pk, id) =>
// 删除track
export const delTrack = (challenge_pk, id) =>
service({
method: 'delete',
url: `/api/challenges/challenge/${challenge_pk}/challenge_phase/${id}`,
Expand Down
33 changes: 1 addition & 32 deletions src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import axios from 'axios';
import { ElNotification, ElMessageBox, ElMessage, ElLoading } from 'element-plus';
import { ElNotification, ElMessageBox, ElMessage } from 'element-plus';
import errorCode, { getErrMsg } from '@/utils/errorCode';
import { blobValidate } from '@/utils/tool';
import store from '../store';
import router from '../router';
import i18n from '@/lang/index.js';

let downloadLoadingInstance;
// 是否显示重新登录
export let isRelogin = { show: false };

Expand Down Expand Up @@ -145,33 +143,4 @@ service.interceptors.response.use(
}
);

// 通用下载方法
export function download(url, params, filename, config) {
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
return service
.post(url, params, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
...config,
})
.then(async (data) => {
const isBlob = blobValidate(data);
if (isBlob) {
const blob = new Blob([data]);
// saveAs(blob, filename);
} else {
const resText = await data.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'];
ElMessage.error(errMsg);
}
downloadLoadingInstance.close();
})
.catch((r) => {
console.error(r);
ElMessage.error('下载文件出现错误,请联系管理员!');
downloadLoadingInstance.close();
});
}

export default service;
12 changes: 8 additions & 4 deletions src/assets/iconfont/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@font-face {
font-family: "iconfont"; /* Project id 4279683 */
src: url('iconfont.woff2?t=1705396800455') format('woff2'),
url('iconfont.woff?t=1705396800455') format('woff'),
url('iconfont.ttf?t=1705396800455') format('truetype'),
url('iconfont.svg?t=1705396800455#iconfont') format('svg');
src: url('iconfont.woff2?t=1706342022026') format('woff2'),
url('iconfont.woff?t=1706342022026') format('woff'),
url('iconfont.ttf?t=1706342022026') format('truetype'),
url('iconfont.svg?t=1706342022026#iconfont') format('svg');
}

.iconfont {
Expand All @@ -14,6 +14,10 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-shouqi1:before {
content: "\e68b";
}

.icon-zhushi:before {
content: "\e6f5";
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/iconfont/iconfont.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/assets/iconfont/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "35671155",
"name": "shouqi",
"font_class": "shouqi1",
"unicode": "e68b",
"unicode_decimal": 59019
},
{
"icon_id": "38977502",
"name": "zhushi",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/iconfont/iconfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/iconfont/iconfont.ttf
Binary file not shown.
Binary file modified src/assets/iconfont/iconfont.woff
Binary file not shown.
Binary file modified src/assets/iconfont/iconfont.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const editorRef = shallowRef();
const { locale } = useI18n();
const toolbarConfig = {
excludeKeys: ['group-more-style', 'emotion', 'insertLink', 'insertImage', 'group-video', 'insertVideo', 'divider', 'fullScreen'],
excludeKeys: ['group-more-style', 'emotion', 'insertLink', 'insertImage', 'group-video', 'todo', 'insertVideo', 'fullScreen'],
};
const editorConfig = {
placeholder: '',
Expand Down
27 changes: 15 additions & 12 deletions src/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
eventDetails: 'Event details',
overview: 'Overview',
leaderboard: 'Leaderboard',
submission: 'Submission',
submit: 'Submit',
allSubmission: 'All Submissions',
noTeam: 'No team exists for now.',
startCreate: 'Start by creating a new team!',
Expand All @@ -108,6 +108,7 @@ export default {
login: 'log in',
partiChall: 'to participate in this challenge.',
participated: 'Participated',
evaluation: 'Evaluation',
},
team: {
team: 'Team',
Expand Down Expand Up @@ -204,7 +205,7 @@ export default {
'You are not allowed to make use of any privilege information offered by the CARLA simulator or derivatives, including world coordinates, planners, or any type of ground truth. Submissions using these features will be rejected and teams will be banned from the platform.',
con3: 'If the organization of the CARLA leaderboard detects any infraction of these terms, an attempt to bypass the rules of the leaderboard, or any other behavior that could be perceived as dishonest, the organization reserves the right to disqualify a submission and/or ban you and/or your team members from the participation in the CARLA leaderboard.',
},
phase: 'Phase',
tracks: 'Tracks',
},
participate: {
continue: 'Continue',
Expand All @@ -216,7 +217,7 @@ export default {
guidelines: 'Submission Guidelines',
guideTxt: 'Card quickly that customer can. Indeed beat year news learn. Surface she tend. Account play food claim despite daughter change use.',
submission: 'Make Submission',
selectPhase: 'Selected phase',
selectTrack: 'Selected track',
startDate: 'Start date',
endDate: 'End date',
todayRemain: 'Today‘s remaining submission',
Expand All @@ -234,10 +235,10 @@ export default {
deregister: 'Deregister',
notApproved: 'Sorry,the participant team is not approved by host yet.',
deregisterSuccess: 'You have successfully deregistered from the challenge.',
list: 'Submission list',
list: 'My Submissions',
deregisterTeam: 'Deregister Partipant Team',
deregisterConfirm: 'Are you sure you want to deregister team?',
phasePH: 'Select phase',
trackPH: 'Select track',
orderPH: 'Order by metric',
notCancelled: 'Only unproccessed submissions can be cancelled',
changeMade: 'The submission is made ',
Expand Down Expand Up @@ -277,6 +278,7 @@ export default {
approveNote: 'Note:participant teams with existing submissions cannot be disapproved',
approveSuccess: 'Participant Team Approved successfully.',
disapproveSuccess: 'Participant Team Disapproved successfully.',
approval: 'Approval',
},
addChall: {
createChall: 'Create Challenge',
Expand All @@ -300,10 +302,11 @@ export default {
createSuccess: 'Contest creation success',
updateSuccess: 'Challenge updated successfully!',
publishNote: 'When this switch is turned on, the competition will be open to the public in the corresponding time period',
participantApproval: 'Manual participant approval',
},
addPhase: {
createPhase: 'Create Phase',
editPhase: 'Edit Phase',
addTrack: {
createTrack: 'Create Track',
editTrack: 'Edit Track',
name: 'Name',
desc: 'Description',
lbPublic: 'Leaderboard public',
Expand All @@ -318,8 +321,8 @@ export default {
isRestrictedToSelectOneSubmission: 'Is restricted to select one submission',
isPartialSubmissionEvaluationEnabled: 'Is partial submission evaluation enabled',
allowedSubmissionFileTypes: 'Allowed submission file types',
createSuccess: 'Phase creation successfully!',
updateSuccess: 'Phase updated successfully!',
createSuccess: 'Track creation successfully!',
updateSuccess: 'Track updated successfully!',
},
host: {
hostchall: 'Hosted Challenge',
Expand All @@ -331,8 +334,8 @@ export default {
publicyAvailable: 'Published',
isRegistrationOpen: 'Is Registration Open',
enableForum: 'Enable Forum',
createPhases: 'Create Phases',
createTracks: 'Create Tracks',
deleteSuccess: 'Challenge deleted successfully!',
phaseDeleteSuccess: 'Phase deleted successfully!',
trackDeleteSuccess: 'Track deleted successfully!',
},
};
21 changes: 12 additions & 9 deletions src/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
eventDetails: '比赛详情',
overview: '概述',
leaderboard: '排行榜',
submission: '提交',
submit: '提交',
allSubmission: '所有提交',
noTeam: '目前不存在任何团队。',
startCreate: '开始创建一个新团队吧!',
Expand All @@ -108,6 +108,7 @@ export default {
login: '登录',
partiChall: '参与比赛。',
participated: '已参加',
evaluation: '评价',
},
team: {
team: '团队',
Expand Down Expand Up @@ -202,7 +203,7 @@ export default {
'您不允许使用CARLA模拟器或衍生物提供的任何特权信息,包括世界坐标、规划者或任何类型的地面实况。使用这些功能的提交将被拒绝,团队将被禁止进入平台。',
con3: '如果CARLA排行榜的组织发现任何违反这些条款的行为、试图绕过排行榜规则的行为或任何其他可能被视为不诚实的行为,该组织保留取消提交资格和/或禁止您和/或您的团队成员参加CARLA排行表的权利。',
},
phase: '阶段',
tracks: '阶段',
},
participate: {
continue: '继续',
Expand All @@ -214,7 +215,7 @@ export default {
guidelines: '投稿须知',
guideTxt: '客户可以快速刷卡。确实打败了当年的新闻学习。表面她倾向。账户播放食物索赔,尽管女儿改变了用途。',
submission: '提交',
selectPhase: '选定的阶段',
selectTrack: '选定的阶段',
startDate: '开始时间',
endDate: '结束时间',
todayRemain: '今天剩余提交次数',
Expand All @@ -235,7 +236,7 @@ export default {
list: '提交列表',
deregisterTeam: '退出比赛',
deregisterConfirm: '你确定团队要退出比赛吗?',
phasePH: '选择阶段',
trackPH: '选择阶段',
orderPH: '排序指标',
notCancelled: '只有未处理的提交才能取消',
changeMade: '提交已被置为',
Expand Down Expand Up @@ -275,6 +276,7 @@ export default {
approveNote: '注意: 已提交作品的参赛团队不能被拒绝',
approveSuccess: '参与者团队批准成功。',
disapproveSuccess: '参与者团队否决成功。',
approval: '审批',
},
addChall: {
createChall: '创建比赛',
Expand All @@ -298,10 +300,11 @@ export default {
createSuccess: '比赛创建成功',
updateSuccess: '比赛更新成功',
publishNote: '此开关打开,比赛将在对应的时间区段对外开放',
participantApproval: '团队审批',
},
addPhase: {
createPhase: '创建阶段',
editPhase: '编辑阶段',
addTrack: {
createTrack: '创建阶段',
editTrack: '编辑阶段',
name: '名称',
desc: '描述',
lbPublic: '公开排行',
Expand Down Expand Up @@ -329,8 +332,8 @@ export default {
publicyAvailable: '私有提供',
isRegistrationOpen: '注册是否开放',
enableForum: '可否讨论',
createPhases: '创建阶段',
createTracks: '创建阶段',
deleteSuccess: '比赛删除成功',
phaseDeleteSuccess: '阶段删除成功',
trackDeleteSuccess: '阶段删除成功',
},
};
Loading

0 comments on commit caade52

Please sign in to comment.