|
|
@@ -21,14 +21,14 @@
|
|
|
<div style="font-size: small; font-weight: bold; color: #666666">登录以查看</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="isLogin && isStudent && myCourseList.length!==0" :style="{height: (courseRowHeight - 63) + 'px'}"
|
|
|
+ <div v-if="isLogin && isStudent && myCourseList!==null && myCourseList.length!==0" :style="{height: (courseRowHeight - 63) + 'px'}"
|
|
|
class="portal-card-main">
|
|
|
<div class="portal-my-card-main">
|
|
|
<MyCourseCard v-for="course in myCourseList" :key="course.id" :courseVO="course"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="isLogin && isStudent && myCourseList.length===0"
|
|
|
+ <div v-if="isLogin && isStudent && myCourseList!==null && myCourseList.length===0"
|
|
|
:style="{height: (courseRowHeight - 63) + 'px', marginTop: (courseRowHeight / 2 - 100) + 'px'}"
|
|
|
class="portal-card-main" style="cursor: pointer"
|
|
|
@click="this.$router.push('/course')">
|
|
|
@@ -38,7 +38,7 @@
|
|
|
<div style="font-size: small; font-weight: bold; color: #666666">去选择课程</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="isLogin && isTeacher"
|
|
|
+ <div v-show="isLogin && isTeacher"
|
|
|
:style="{height: (courseRowHeight - 63) + 'px', marginTop: (courseRowHeight / 2 - 100) + 'px'}"
|
|
|
class="portal-card-main" style="cursor: pointer"
|
|
|
@click="this.$router.push('/manage')">
|
|
|
@@ -79,7 +79,7 @@
|
|
|
@click="$router.push('/manage')">管理页面</span>
|
|
|
查看相关测试。
|
|
|
</div>
|
|
|
- <div v-else>
|
|
|
+ <div v-if="isTeacher">
|
|
|
<div v-if="isLogin" :style="{height: (testRowHeight - 63) + 'px'}" class="portal-card-main">
|
|
|
<div class="portal-my-card-main">
|
|
|
<div v-if="myTestList.length !== 0">
|
|
|
@@ -171,7 +171,7 @@ export default {
|
|
|
evalExamList: [],
|
|
|
courseList: [],
|
|
|
coderExamList: [],
|
|
|
- myCourseList: [],
|
|
|
+ myCourseList: null,
|
|
|
myEvalExamList: [],
|
|
|
myCoderExamList: [],
|
|
|
myTestList: [],
|
|
|
@@ -184,10 +184,10 @@ export default {
|
|
|
return this.$store.state.user.token !== undefined;
|
|
|
},
|
|
|
isTeacher() {
|
|
|
- return ["TEACHER", "SEEC", "ADMIN"].indexOf(this.$store.state.user.role) !== -1;
|
|
|
+ return this.$store.getters.isTeacher;
|
|
|
},
|
|
|
isStudent() {
|
|
|
- return ["STUDENT", "SEEC", "ADMIN"].indexOf(this.$store.state.user.role) !== -1;
|
|
|
+ return this.$store.getters.isStudent;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -203,31 +203,37 @@ export default {
|
|
|
})();
|
|
|
};
|
|
|
|
|
|
- await this.$apis.getExampleCourses().then(res => {
|
|
|
+ this.$apis.getExampleCourses().then(res => {
|
|
|
this.courseList = res.data.data;
|
|
|
});
|
|
|
-
|
|
|
- // await this.$apis.getAllEvalExams().then(res => {
|
|
|
- // this.coderExamList = res.data.data["examVOList"];
|
|
|
+ // this.$apis.getAllEvalExams().then(res => {
|
|
|
+ // this.evalExamList = res.data.data["examVOList"];
|
|
|
// });
|
|
|
+ // todo
|
|
|
this.evalExamList = this.$apis.getAllEvalExams().data.data["examVOList"];
|
|
|
-
|
|
|
- // await this.$apis.getAllCoderExams().then(res => {
|
|
|
+ // this.$apis.getAllCoderExams().then(res => {
|
|
|
// this.coderExamList = res.data.data.res;
|
|
|
// });
|
|
|
- this.coderExamList = this.$apis.getAllCoderExams().data.data["res"];
|
|
|
-
|
|
|
- if (this.isLogin) {
|
|
|
+ // todo
|
|
|
+ this.coderExamList = this.$apis.getAllCoderExams().data.data.res;
|
|
|
+ if (this.isLogin && this.isStudent) {
|
|
|
this.$apis.getStudentCourses(this.$store.state.user.id)
|
|
|
.then(res => {
|
|
|
this.myCourseList = res.data.data;
|
|
|
})
|
|
|
.catch(err => {
|
|
|
});
|
|
|
- const evalRes = await this.$apis.getStudentEvalExams({state: 0});
|
|
|
- this.myEvalExamList = evalRes.data.data.examVOList;
|
|
|
- const coderRes = await this.$apis.getStudentCoderExams({});
|
|
|
- this.myCoderExamList = coderRes.data.data.res;
|
|
|
+ this.$apis.getStudentEvalExams({state: 0})
|
|
|
+ .then(
|
|
|
+ res => {
|
|
|
+ this.myEvalExamList = res.data.data.examVOList;
|
|
|
+ })
|
|
|
+ .catch();
|
|
|
+ this.$apis.getStudentCoderExams({})
|
|
|
+ .then(res => {
|
|
|
+ this.myCoderExamList = res.data.data.res;
|
|
|
+ })
|
|
|
+ .catch();
|
|
|
this.myTestList = [].concat(this.myEvalExamList).concat(this.myCoderExamList);
|
|
|
}
|
|
|
|