|
@@ -1,73 +1,46 @@
|
|
|
<template>
|
|
|
- <div class="curricula">
|
|
|
+ <div class="curricula-teacher">
|
|
|
<!-- 查询条件 -->
|
|
|
- <div class="curricula-search">
|
|
|
- <div class="curricula-search-condition">
|
|
|
+ <div class="curricula-teacher-search">
|
|
|
+ <div class="curricula-teacher-search-condition">
|
|
|
<el-input v-model="search" prefix-icon="el-icon-search">
|
|
|
<el-button slot="append" @click="queryMyCourseList">搜索</el-button>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
- <div class="curricula-search-button">
|
|
|
- <el-select v-if="userType === 'STUDENT'" v-model="teacher_id">
|
|
|
- <el-option label="-请选择-" value="" />
|
|
|
- <el-option
|
|
|
- v-for="item in teacher_list"
|
|
|
- :key="item.teacher_id"
|
|
|
- :label="item.teacher_name"
|
|
|
- :value="item.teacher_id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+ <div class="curricula-teacher-search-button">
|
|
|
<el-select v-model="finish_status">
|
|
|
<el-option label="-请选择-" :value="-1" />
|
|
|
<el-option
|
|
|
v-for="item in finish_status_list"
|
|
|
- :key="userType === 'TEACHER' ? item.finish_status : item.status"
|
|
|
+ :key="item.finish_status"
|
|
|
:label="item.name"
|
|
|
- :value="userType === 'TEACHER' ? item.finish_status : item.status"
|
|
|
+ :value="item.finish_status"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-button type="primary" @click="queryMyCourseList">查询</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 课程列表 -->
|
|
|
- <div class="curricula-container">
|
|
|
- <div class="curricula-container-title">
|
|
|
+ <div class="curricula-teacher-container">
|
|
|
+ <div class="curricula-teacher-container-title">
|
|
|
<div>
|
|
|
<span class="title">课程列表</span>
|
|
|
- <span v-if="userType === 'STUDENT'" class="tip">
|
|
|
- 你也可以去 学习中心 选择更多的课程。
|
|
|
- </span>
|
|
|
</div>
|
|
|
- <div v-if="userType === 'TEACHER'">
|
|
|
+ <div>
|
|
|
<el-button class="create" @click="$router.push('/create_course')">
|
|
|
<div><svg-icon icon-class="create" /><span>创建课程</span></div>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="curricula-container-list">
|
|
|
+ <div class="curricula-teacher-container-list">
|
|
|
<el-table :data="courseList">
|
|
|
- <el-table-column
|
|
|
- :prop="userType === 'TEACHER' ? 'name' : 'course_name'"
|
|
|
- label="课程名称"
|
|
|
- width="320"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- v-if="userType === 'STUDENT'"
|
|
|
- label="教师"
|
|
|
- prop="teacher_name_desc"
|
|
|
- width="200"
|
|
|
- />
|
|
|
+ <el-table-column prop="name" label="课程名称" width="320" />
|
|
|
<el-table-column label="课程周期">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <template v-if="userType === 'TEACHER'">
|
|
|
- <i class="el-icon-date" /> {{ row.begin_date }} - {{ row.end_date }}
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <i class="el-icon-date" /> {{ row.date_space_view_text }}
|
|
|
- </template>
|
|
|
+ <i class="el-icon-date" /> {{ row.begin_date }} - {{ row.end_date }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column v-if="userType === 'TEACHER'" fixed="right" width="80">
|
|
|
+ <el-table-column fixed="right" width="80">
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-dropdown trigger="click">
|
|
|
<span class="el-dropdown-link">
|
|
@@ -87,12 +60,6 @@
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column v-if="userType === 'STUDENT'" label="状态">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span class="status-name" :style="{ 'background-color': statusColor(row.status) }" />
|
|
|
- <span :style="{ color: statusColor(row.status) }">{{ row.status_name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -113,22 +80,15 @@
|
|
|
|
|
|
<script>
|
|
|
import { updateWordPack } from '@/utils/i18n';
|
|
|
-import { PageQueryMyCourseList, PageQueryMyJoinCourseList_Student } from '@/api/table';
|
|
|
-import {
|
|
|
- GetFinishStatusList_Course,
|
|
|
- GetMyJoinCourseTeacherList_Student,
|
|
|
- GetStudentCourseStatusList
|
|
|
-} from '@/api/select';
|
|
|
+import { PageQueryMyCourseList } from '@/api/table';
|
|
|
+import { GetFinishStatusList_Course } from '@/api/select';
|
|
|
|
|
|
export default {
|
|
|
- name: 'CurriculaList',
|
|
|
data() {
|
|
|
return {
|
|
|
- userType: this.$store.state.user.user_type,
|
|
|
search: '',
|
|
|
finish_status_list: [],
|
|
|
teacher_list: [],
|
|
|
- teacher_id: '',
|
|
|
finish_status: -1,
|
|
|
page_capacity: 10,
|
|
|
cur_page: 1,
|
|
@@ -139,35 +99,16 @@ export default {
|
|
|
created() {
|
|
|
this.queryMyCourseList();
|
|
|
this.getFinishStatusList_Course();
|
|
|
- if (this.userType === 'STUDENT') {
|
|
|
- this.getMyJoinCourseTeacherList_Student();
|
|
|
- }
|
|
|
updateWordPack({
|
|
|
word_key_list: ['Learn_New_Courses']
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
getFinishStatusList_Course() {
|
|
|
- if (this.userType === 'TEACHER') {
|
|
|
- GetFinishStatusList_Course().then(({ finish_status_list }) => {
|
|
|
- this.finish_status_list = finish_status_list;
|
|
|
- });
|
|
|
- } else {
|
|
|
- GetStudentCourseStatusList().then(({ status_list }) => {
|
|
|
- this.finish_status_list = status_list;
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- getMyJoinCourseTeacherList_Student() {
|
|
|
- GetMyJoinCourseTeacherList_Student().then(({ teacher_list }) => {
|
|
|
- this.teacher_list = teacher_list;
|
|
|
+ GetFinishStatusList_Course().then(({ finish_status_list }) => {
|
|
|
+ this.finish_status_list = finish_status_list;
|
|
|
});
|
|
|
},
|
|
|
- selectTab(status, i) {
|
|
|
- this.status = status;
|
|
|
- this.curTab = i;
|
|
|
- this.search();
|
|
|
- },
|
|
|
changePage(newPage) {
|
|
|
this.cur_page = newPage;
|
|
|
this.queryMyCourseList();
|
|
@@ -177,30 +118,16 @@ export default {
|
|
|
this.queryMyCourseList();
|
|
|
},
|
|
|
queryMyCourseList() {
|
|
|
- if (this.userType === 'TEACHER') {
|
|
|
- const queryCriteria = {
|
|
|
- finish_status: this.finish_status,
|
|
|
- name: this.search,
|
|
|
- page_capacity: this.page_capacity,
|
|
|
- cur_page: this.cur_page
|
|
|
- };
|
|
|
- PageQueryMyCourseList(queryCriteria).then(({ course_list, total_count }) => {
|
|
|
- this.courseList = course_list;
|
|
|
- this.total_count = total_count;
|
|
|
- });
|
|
|
- } else {
|
|
|
- let data = {
|
|
|
- teacher_id: this.teacher_id,
|
|
|
- status_list: [this.finish_status],
|
|
|
- course_name: this.search,
|
|
|
- page_capacity: this.page_capacity,
|
|
|
- cur_page: this.cur_page
|
|
|
- };
|
|
|
- PageQueryMyJoinCourseList_Student(data).then(({ course_list, total_count }) => {
|
|
|
- this.courseList = course_list;
|
|
|
- this.total_count = total_count;
|
|
|
- });
|
|
|
- }
|
|
|
+ const queryCriteria = {
|
|
|
+ finish_status: this.finish_status,
|
|
|
+ name: this.search,
|
|
|
+ page_capacity: this.page_capacity,
|
|
|
+ cur_page: this.cur_page
|
|
|
+ };
|
|
|
+ PageQueryMyCourseList(queryCriteria).then(({ course_list, total_count }) => {
|
|
|
+ this.courseList = course_list;
|
|
|
+ this.total_count = total_count;
|
|
|
+ });
|
|
|
},
|
|
|
statusColor(val) {
|
|
|
if (val === 0) {
|
|
@@ -232,7 +159,7 @@ export default {
|
|
|
<style lang="scss">
|
|
|
@import '~@/styles/mixin.scss';
|
|
|
|
|
|
-.curricula {
|
|
|
+.curricula-teacher {
|
|
|
@include pagination;
|
|
|
|
|
|
&-search {
|
|
@@ -277,10 +204,6 @@ export default {
|
|
|
margin-right: 36px;
|
|
|
}
|
|
|
|
|
|
- .tip {
|
|
|
- color: #aaa;
|
|
|
- }
|
|
|
-
|
|
|
.create {
|
|
|
width: 138px;
|
|
|
|
|
@@ -317,7 +240,7 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
-<style scope>
|
|
|
+<style scoped>
|
|
|
.el-dropdown-menu .svg-icon {
|
|
|
margin-right: 8px;
|
|
|
}
|