考试权限调整

This commit is contained in:
fan 2021-01-12 18:51:38 +08:00
parent 378d5430e6
commit 73f98ce8b4

View File

@ -46,7 +46,7 @@
<div class="btn-buy"> <div class="btn-buy">
<!-- <el-button v-if="!isLocal" :disabled="disabled" type="success" @click="buy">{{ $t('exam.buy') }}</el-button> --> <!-- <el-button v-if="!isLocal" :disabled="disabled" type="success" @click="buy">{{ $t('exam.buy') }}</el-button> -->
<el-button v-if="hasPermssion && !isLocal" :disabled="disabled" type="primary" @click="distribute">{{ $t('exam.distributePermission') }}</el-button> <el-button v-if="hasPermssion && !isLocal" :disabled="disabled" type="primary" @click="distribute">{{ $t('exam.distributePermission') }}</el-button>
<el-button v-if="hasPermssion && !$route.query.noPreLogout && !courseModel.systemFault" :disabled="disabled" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button> <el-button v-if=" (isAdmin || isShowPaper)&& !$route.query.noPreLogout && !courseModel.systemFault" :disabled="disabled" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button>
<el-button v-if="!$route.query.noPreLogout" type="primary" :disabled="disabled" @click="backLessonList">{{ $t('exam.returnCourseList') }}</el-button> <el-button v-if="!$route.query.noPreLogout" type="primary" :disabled="disabled" @click="backLessonList">{{ $t('exam.returnCourseList') }}</el-button>
<el-button v-if="$route.query.noPreLogout" type="primary" :disabled="disabled" @click="quit">退出</el-button> <el-button v-if="$route.query.noPreLogout" type="primary" :disabled="disabled" @click="quit">退出</el-button>
</div> </div>
@ -59,6 +59,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
import LimitList from '@/views/components/limits/index'; import LimitList from '@/views/components/limits/index';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
import localStore from 'storejs'; import localStore from 'storejs';
import { superAdmin, admin } from '@/router/index';
export default { export default {
name: 'ExamDetailView', name: 'ExamDetailView',
@ -111,6 +112,12 @@ export default {
}); });
} }
return sumRemains >= 10; return sumRemains >= 10;
},
isShowPaper() {
return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
},
isAdmin() {
return this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(superAdmin);
} }
// height() { // height() {
// return this.$route.query.noPreLogout ? this.$store.state.app.height : this.$store.state.app.height - 91; // return this.$route.query.noPreLogout ? this.$store.state.app.height : this.$store.state.app.height - 91;
@ -169,16 +176,12 @@ export default {
}, },
checkCourse() { checkCourse() {
this.loading = true; this.loading = true;
if (this.isAddRule) {
const path = `${this.$route.path.match(/(\/.*)\/course/)[1]}${UrlConfig.examRuleManage}`; const path = `${this.$route.path.match(/(\/.*)\/course/)[1]}${UrlConfig.examRuleManage}`;
this.$router.push({ this.$router.push({
path: path, path: path,
query: { lessonId: this.courseModel.id }, query: { lessonId: this.courseModel.id },
noPreLogout: this.$route.query.noPreLogout noPreLogout: this.$route.query.noPreLogout
}); });
} else {
this.$messageBox(this.$t('tip.notViewTheCoursePaper'));
}
}, },
distribute() { // distribute() { //
this.disabled = true; this.disabled = true;