|
@@ -94,18 +94,18 @@
|
|
|
|
|
|
|
|
<div v-if="isCreator || isCourseSelected" class="course-tab-content">
|
|
<div v-if="isCreator || isCourseSelected" class="course-tab-content">
|
|
|
<div v-if="tabName==='task'">
|
|
<div v-if="tabName==='task'">
|
|
|
-<!-- <el-timeline>-->
|
|
|
|
|
-<!-- <el-timeline-item-->
|
|
|
|
|
-<!-- v-for="(task, index) in tasks"-->
|
|
|
|
|
-<!-- :key="index"-->
|
|
|
|
|
-<!-- :timestamp="task.timestamp"-->
|
|
|
|
|
-<!-- >-->
|
|
|
|
|
-<!-- {{ task.content }}-->
|
|
|
|
|
-<!-- </el-timeline-item>-->
|
|
|
|
|
-<!-- </el-timeline>-->
|
|
|
|
|
- evalExamList: {{this.evalExamList}}
|
|
|
|
|
|
|
+ <!-- <el-timeline>-->
|
|
|
|
|
+ <!-- <el-timeline-item-->
|
|
|
|
|
+ <!-- v-for="(task, index) in tasks"-->
|
|
|
|
|
+ <!-- :key="index"-->
|
|
|
|
|
+ <!-- :timestamp="task.timestamp"-->
|
|
|
|
|
+ <!-- >-->
|
|
|
|
|
+ <!-- {{ task.content }}-->
|
|
|
|
|
+ <!-- </el-timeline-item>-->
|
|
|
|
|
+ <!-- </el-timeline>-->
|
|
|
|
|
+ evalExamList: {{ this.evalExamList }}
|
|
|
<br/>
|
|
<br/>
|
|
|
- coderExamList: {{this.coderExamList}}
|
|
|
|
|
|
|
+ coderExamList: {{ this.coderExamList }}
|
|
|
</div>
|
|
</div>
|
|
|
<div v-else-if="tabName==='notice'" class="tab-notice">
|
|
<div v-else-if="tabName==='notice'" class="tab-notice">
|
|
|
<NoticeItem v-for="(item,index) in announcementList" :key="index" :ref="'noticeItem'+item.id"
|
|
<NoticeItem v-for="(item,index) in announcementList" :key="index" :ref="'noticeItem'+item.id"
|
|
@@ -420,21 +420,19 @@ export default {
|
|
|
{
|
|
{
|
|
|
courseId: this.courseInfo.id,
|
|
courseId: this.courseInfo.id,
|
|
|
userId: this.$store.state.user.id,
|
|
userId: this.$store.state.user.id,
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- ElMessage.success("选课成功");
|
|
|
|
|
- setTimeout(function () {
|
|
|
|
|
- location.reload();
|
|
|
|
|
- }, 500);
|
|
|
|
|
})
|
|
})
|
|
|
- .catch(err => {
|
|
|
|
|
- console.log("handleSelectCourse: " + err);
|
|
|
|
|
- ElMessage.error("handleSelectCourse: " + err);
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.data.code === -1) {
|
|
|
|
|
+ ElMessage.error("选课失败");
|
|
|
|
|
+ console.log(res.data.message);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.success("选课成功");
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ location.reload();
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
handleDropCourse() {
|
|
handleDropCourse() {
|
|
@@ -468,17 +466,32 @@ export default {
|
|
|
switchTab(tabName) {
|
|
switchTab(tabName) {
|
|
|
switch (tabName) {
|
|
switch (tabName) {
|
|
|
case "task":
|
|
case "task":
|
|
|
- if (this.courseInfo.evalId !== null) {
|
|
|
|
|
- this.$apis.getTeacherEvalExamsByCourseId(this.courseInfo.evalId)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.evalExamList = res.data.data;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- if (this.courseInfo.coderId !== null) {
|
|
|
|
|
- this.$apis.getTeacherCoderExamsByCourseId(this.courseInfo.coderId)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.coderExamList = res.data.data;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if(this.isTeacher) {
|
|
|
|
|
+ if (this.courseInfo.evalId !== null) {
|
|
|
|
|
+ this.$apis.getTeacherEvalExamsByCourseId(this.courseInfo.evalId)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.evalExamList = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.courseInfo.coderId !== null) {
|
|
|
|
|
+ this.$apis.getTeacherCoderExamsByCourseId(this.courseInfo.coderId)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.coderExamList = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(this.isStudent){
|
|
|
|
|
+ if (this.courseInfo.evalId !== null) {
|
|
|
|
|
+ this.$apis.getStudentEvalExamsByCourseId(this.courseInfo.evalId)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.evalExamList = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.courseInfo.coderId !== null) {
|
|
|
|
|
+ this.$apis.getStudentCoderExamsByCourseId(this.courseInfo.coderId)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.coderExamList = res.data.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case "notice":
|
|
case "notice":
|