From a131486a1a17b6c3fc0d49d55c7694a86c46c618 Mon Sep 17 00:00:00 2001 From: zema1 Date: Wed, 6 Dec 2017 15:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=82=B9score=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BA100/=E6=B5=8B=E8=AF=95=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/admin/views/problem/Problem.vue | 8 +++++--- src/pages/oj/components/NavBar.vue | 4 ++-- src/pages/oj/store/modules/user.js | 2 +- src/pages/oj/views/submission/SubmissionDetails.vue | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/pages/admin/views/problem/Problem.vue b/src/pages/admin/views/problem/Problem.vue index 89bc5c7fe..a1210a1df 100644 --- a/src/pages/admin/views/problem/Problem.vue +++ b/src/pages/admin/views/problem/Problem.vue @@ -115,7 +115,8 @@
- Delete + + Delete @@ -173,7 +174,8 @@ {{ lang.name }} - + Compile @@ -442,7 +444,7 @@ } let fileList = response.data.info for (let file of fileList) { - file.score = 0 + file.score = (100 / fileList.length).toFixed(0) if (this.problem.spj) { file.output_name = '-' } diff --git a/src/pages/oj/components/NavBar.vue b/src/pages/oj/components/NavBar.vue index ad697f74d..ee7085513 100644 --- a/src/pages/oj/components/NavBar.vue +++ b/src/pages/oj/components/NavBar.vue @@ -66,7 +66,7 @@ Home Submissions Settings - Management + Management Logout @@ -110,7 +110,7 @@ } }, computed: { - ...mapGetters(['website', 'modalStatus', 'user', 'isAuthenticated', 'isAdmin']), + ...mapGetters(['website', 'modalStatus', 'user', 'isAuthenticated', 'isAdminRole']), // 跟随路由变化 activeMenu () { return '/' + this.$route.path.split('/')[1] diff --git a/src/pages/oj/store/modules/user.js b/src/pages/oj/store/modules/user.js index d2a3e38e2..7776283d3 100644 --- a/src/pages/oj/store/modules/user.js +++ b/src/pages/oj/store/modules/user.js @@ -13,7 +13,7 @@ const getters = { isAuthenticated: (state, getters) => { return !!getters.user.id }, - isAdmin: (state, getters) => { + isAdminRole: (state, getters) => { return getters.user.admin_type === USER_TYPE.ADMIN || getters.user.admin_type === USER_TYPE.SUPER_ADMIN } diff --git a/src/pages/oj/views/submission/SubmissionDetails.vue b/src/pages/oj/views/submission/SubmissionDetails.vue index a47142e1e..bd0eebd4f 100644 --- a/src/pages/oj/views/submission/SubmissionDetails.vue +++ b/src/pages/oj/views/submission/SubmissionDetails.vue @@ -141,7 +141,7 @@ this.isConcat = true columns = columns.concat(scoreColumn) } - if (this.isAdmin) { + if (this.isAdminRole) { this.isConcat = true columns = columns.concat(adminColumn) } @@ -171,8 +171,8 @@ isCE () { return this.submission.result === -2 }, - isAdmin () { - return this.$store.getters.isAdmin + isAdminRole () { + return this.$store.getters.isAdminRole } } }