Skip to content

Commit

Permalink
Merge branch 'zemal_dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zema1 committed Dec 6, 2017
2 parents dc30df2 + a131486 commit aa9159d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/pages/admin/views/problem/Problem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
<div>
<el-form-item v-for="(sample, index) in problem.samples" :key="'sample'+index">
<Accordion :title="'Sample' + (index + 1)">
<el-button type="warning" size="small" icon="el-icon-delete" slot="header" @click="deleteSample(index)">Delete
<el-button type="warning" size="small" icon="el-icon-delete" slot="header" @click="deleteSample(index)">
Delete
</el-button>
<el-row :gutter="20">
<el-col :span="12">
Expand Down Expand Up @@ -173,7 +174,8 @@
<el-radio :label="lang.name">{{ lang.name }}</el-radio>
</el-tooltip>
</el-radio-group>
<el-button type="primary" size="small" icon="el-icon-fa-random" @click="compileSPJ" :loading="loadingCompile">
<el-button type="primary" size="small" icon="el-icon-fa-random" @click="compileSPJ"
:loading="loadingCompile">
Compile
</el-button>
</template>
Expand Down Expand Up @@ -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 = '-'
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/oj/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<Dropdown-item name="/user-home">Home</Dropdown-item>
<Dropdown-item name="/status?myself=1">Submissions</Dropdown-item>
<Dropdown-item name="/setting/profile">Settings</Dropdown-item>
<Dropdown-item v-if="isAdmin" name="/admin">Management</Dropdown-item>
<Dropdown-item v-if="isAdminRole" name="/admin">Management</Dropdown-item>
<Dropdown-item divided name="/logout">Logout</Dropdown-item>
</Dropdown-menu>
</Dropdown>
Expand Down Expand Up @@ -110,7 +110,7 @@
}
},
computed: {
...mapGetters(['website', 'modalStatus', 'user', 'isAuthenticated', 'isAdmin']),
...mapGetters(['website', 'modalStatus', 'user', 'isAuthenticated', 'isAdminRole']),
// 跟随路由变化
activeMenu () {
return '/' + this.$route.path.split('/')[1]
Expand Down
2 changes: 1 addition & 1 deletion src/pages/oj/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/oj/views/submission/SubmissionDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
this.isConcat = true
columns = columns.concat(scoreColumn)
}
if (this.isAdmin) {
if (this.isAdminRole) {
this.isConcat = true
columns = columns.concat(adminColumn)
}
Expand Down Expand Up @@ -171,8 +171,8 @@
isCE () {
return this.submission.result === -2
},
isAdmin () {
return this.$store.getters.isAdmin
isAdminRole () {
return this.$store.getters.isAdminRole
}
}
}
Expand Down

0 comments on commit aa9159d

Please sign in to comment.