diff --git a/src/components/ClarificationComment.vue b/src/components/ClarificationComment.vue new file mode 100644 index 00000000..227dfef8 --- /dev/null +++ b/src/components/ClarificationComment.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/components/editor/MarkdownEditor.vue b/src/components/editor/MarkdownEditor.vue new file mode 100644 index 00000000..b1252b72 --- /dev/null +++ b/src/components/editor/MarkdownEditor.vue @@ -0,0 +1,207 @@ + + + + + diff --git a/src/router/routes.js b/src/router/routes.js index 3b1466e5..7a29c9dd 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -101,6 +101,12 @@ const routes = [ path: 'rank', meta: { scrollToTop: true }, component: () => import('@/views/contest/ContestRankView') + }, + { + name: 'contest-clarification', + path: 'clarification', + meta: { scrollToTop: true }, + component: () => import('@/views/contest/ContestClarificationView') } ] }, diff --git a/src/store/modules/contest.js b/src/store/modules/contest.js index 6da8d624..607474ef 100644 --- a/src/store/modules/contest.js +++ b/src/store/modules/contest.js @@ -195,6 +195,10 @@ const getters = { } }, + template: (state) => { + return state.contest.template + }, + submitUserNum: (state, getters) => { const sum = Array(state.problems.length); for (let j = 0; j < state.problems.length; j++) sum[j] = 0; diff --git a/src/utils/api.js b/src/utils/api.js index e0542871..3ef1e8a1 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -17,6 +17,7 @@ axios.defaults.withCredentials = true; function post(url, data) { data = data || {}; + return new Promise((resolve, reject) => { axios.post(url, data) .then(response => { @@ -274,6 +275,28 @@ export default { singleUpload: function(data) { return post('/filesys/upload', data); }, + /* QA part */ + createQuestion: function(data) { + return post('/contest/createQuestion', data) + }, + createReply: function (data) { + return post('/contest/reply', data) + }, + getQuestion: function (data) { + return get('/contest/listQuestion', data) + }, + getQuestionDetail: function (data) { + return get('/contest/questionDetail', data) + }, + deleteQuestion: function (data) { + return get('/contest/delete', data) + }, + editReply: function (data) { + return get('/manage/contest/edit', data) + }, + setPublic: function (data) { + return post('/manage/contest/publicIt', data) + }, /* third-party-login */ thirdPartyLogin: function(params) { return get('/user/thirdPartyLogin', params); diff --git a/src/utils/constants.js b/src/utils/constants.js index 41e43d3c..5327c06d 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -193,3 +193,8 @@ export const GROUP_STATUS_TYPE = { JOINED: 2, REJECTED: 3 }; + +export const CLARIFICATION_TYPE = { + UNPUBLIC: 'UNPUBLIC', + PUBLIC: 'PUBLIC' +} diff --git a/src/views/contest/ContestClarificationView.vue b/src/views/contest/ContestClarificationView.vue new file mode 100644 index 00000000..01b29a2b --- /dev/null +++ b/src/views/contest/ContestClarificationView.vue @@ -0,0 +1,391 @@ + + + + + diff --git a/src/views/contest/ContestDetailView.vue b/src/views/contest/ContestDetailView.vue index 86829c49..32b17e71 100644 --- a/src/views/contest/ContestDetailView.vue +++ b/src/views/contest/ContestDetailView.vue @@ -74,6 +74,11 @@ }"> Rank + + Clarification +