mirror of
https://github.com/QingdaoU/OnlineJudgeFE.git
synced 2025-01-01 09:31:42 +00:00
contest rank chart 的状态在整个contest view内保存
admin problem的一些调整
This commit is contained in:
parent
91f1d91db6
commit
5e3385fef1
@ -265,11 +265,13 @@
|
||||
data () {
|
||||
return {
|
||||
rules: {
|
||||
_id: {required: true, message: 'Display ID is required', trigger: 'blur'},
|
||||
title: {required: true, message: 'Title is required', trigger: 'blur'},
|
||||
input_description: {required: true, message: 'Input Description is required', trigger: 'blur'},
|
||||
output_description: {required: true, message: 'Output Description is required', trigger: 'blur'}
|
||||
},
|
||||
mode: '',
|
||||
contest: {},
|
||||
problem: {
|
||||
languages: []
|
||||
},
|
||||
@ -326,10 +328,11 @@
|
||||
}
|
||||
let contestID = this.$route.params.contestId
|
||||
if (contestID) {
|
||||
this.problem.contest_id = contestID
|
||||
this.problem.contest_id = this.reProblem.contest_id = contestID
|
||||
this.disableRuleType = true
|
||||
api.getContest(contestID).then(res => {
|
||||
this.problem.rule_type = this.reProblem.rule_type = res.data.data.rule_type
|
||||
this.contest = res.data.data
|
||||
})
|
||||
}
|
||||
|
||||
@ -511,6 +514,10 @@
|
||||
'create-contest-problem': 'createContestProblem',
|
||||
'edit-contest-problem': 'editContestProblem'
|
||||
}[this.routeName]
|
||||
// edit contest problem 时, contest_id会被后来的请求覆盖掉
|
||||
if (funcName === 'editContestProblem') {
|
||||
this.problem.contest_id = this.contest.id
|
||||
}
|
||||
api[funcName](this.problem).then(res => {
|
||||
if (this.routeName === 'create-contest-problem' || this.routeName === 'edit-contest-problem') {
|
||||
this.$router.push({name: 'contest-problem-list', params: {contestId: this.$route.params.contestId}})
|
||||
|
@ -3,6 +3,8 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="renderer" content="webkit"/>
|
||||
<title>OnlineJudge</title>
|
||||
</head>
|
||||
<style>
|
||||
|
@ -9,7 +9,8 @@ const state = {
|
||||
created_by: {}
|
||||
},
|
||||
contestProblems: [],
|
||||
contestMenuVisible: true
|
||||
showMenu: true,
|
||||
showChart: true
|
||||
}
|
||||
|
||||
const getters = {
|
||||
@ -86,7 +87,10 @@ const mutations = {
|
||||
state.contest = payload.contest
|
||||
},
|
||||
[types.CHANGE_CONTEST_MENU_VISIBLE] (state, payload) {
|
||||
state.contestMenuVisible = payload.visible
|
||||
state.showMenu = payload.visible
|
||||
},
|
||||
[types.CHANGE_CONTEST_CHART_VISIBLE] (state, payload) {
|
||||
state.showChart = payload.visible
|
||||
},
|
||||
[types.CHANGE_CONTEST_PROBLEMS] (state, payload) {
|
||||
state.contestProblems = payload.contestProblems
|
||||
@ -94,7 +98,8 @@ const mutations = {
|
||||
[types.CLEAR_CONTEST] (state) {
|
||||
state.contest = {created_by: {}}
|
||||
state.contestProblems = []
|
||||
state.contestMenuVisible = true
|
||||
state.showMenu = true
|
||||
state.showChart = true
|
||||
},
|
||||
[types.NOW] (state, payload) {
|
||||
state.now = payload.now
|
||||
|
@ -18,5 +18,6 @@ export default keyMirror({
|
||||
'CHANGE_CONTEST': null,
|
||||
'CHANGE_CONTEST_PROBLEMS': null,
|
||||
'CHANGE_CONTEST_MENU_VISIBLE': null,
|
||||
'CHANGE_CONTEST_CHART_VISIBLE': null,
|
||||
'CLEAR_CONTEST': null
|
||||
})
|
||||
|
@ -127,7 +127,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
showMenu: state => state.contest.contestMenuVisible,
|
||||
showMenu: state => state.contest.showMenu,
|
||||
contest: state => state.contest.contest,
|
||||
contest_table: state => [state.contest.contest]
|
||||
}),
|
||||
|
@ -47,7 +47,6 @@
|
||||
return {
|
||||
limit: 10,
|
||||
total: 0,
|
||||
showChart: true,
|
||||
contestID: '',
|
||||
columns: [
|
||||
{
|
||||
@ -297,9 +296,17 @@
|
||||
'contest': state => state.contest.contest,
|
||||
'contestProblems': state => state.contest.contestProblems
|
||||
}),
|
||||
showChart: {
|
||||
get () {
|
||||
return this.$store.state.contest.showChart
|
||||
},
|
||||
set (value) {
|
||||
this.$store.commit(types.CHANGE_CONTEST_CHART_VISIBLE, {visible: value})
|
||||
}
|
||||
},
|
||||
showMenu: {
|
||||
get () {
|
||||
return this.$store.state.contest.contestMenuVisible
|
||||
return this.$store.state.contest.showMenu
|
||||
},
|
||||
set (value) {
|
||||
this.$store.commit(types.CHANGE_CONTEST_MENU_VISIBLE, {visible: value})
|
||||
|
@ -45,7 +45,6 @@
|
||||
return {
|
||||
limit: 10,
|
||||
total: 0,
|
||||
showChart: true,
|
||||
contestID: '',
|
||||
columns: [
|
||||
{
|
||||
@ -224,9 +223,17 @@
|
||||
'contest': state => state.contest.contest,
|
||||
'contestProblems': state => state.contest.contestProblems
|
||||
}),
|
||||
showChart: {
|
||||
get () {
|
||||
return this.$store.state.contest.showChart
|
||||
},
|
||||
set (value) {
|
||||
this.$store.commit(types.CHANGE_CONTEST_CHART_VISIBLE, {visible: value})
|
||||
}
|
||||
},
|
||||
showMenu: {
|
||||
get () {
|
||||
return this.$store.state.contest.contestMenuVisible
|
||||
return this.$store.state.contest.showMenu
|
||||
},
|
||||
set (value) {
|
||||
this.$store.commit(types.CHANGE_CONTEST_MENU_VISIBLE, {visible: value})
|
||||
|
Loading…
Reference in New Issue
Block a user