|
@@ -1,53 +1,52 @@
|
|
|
<template>
|
|
|
- <div class="curricula-manager">
|
|
|
- <div class="curricula-manager-header">
|
|
|
- <el-input
|
|
|
- v-model="input"
|
|
|
- placeholder="请输入"
|
|
|
- suffix-icon="el-icon-search"
|
|
|
- @keyup.enter.native="search"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <div class="curricula-manager-body">
|
|
|
- <div class="curricula-manager-body-button">
|
|
|
- <el-button
|
|
|
- v-for="(item, i) in statusList"
|
|
|
- :key="i"
|
|
|
- :class="['bg-color', { active: curTab === i }]"
|
|
|
- @click="selectTab(item.status, i)"
|
|
|
- >
|
|
|
- {{ item.val }}
|
|
|
- </el-button>
|
|
|
+ <div class="curricula">
|
|
|
+ <div class="curricula-search">
|
|
|
+ <div class="curricula-search-condition">
|
|
|
+ <el-input v-model="search" prefix-icon="el-icon-search">
|
|
|
+ <el-button slot="append" @click="queryMyCourseList">搜索</el-button>
|
|
|
+ </el-input>
|
|
|
+ <el-select v-model="finish_status">
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
- <div class="curricula-manager-body-sort">
|
|
|
- <div>
|
|
|
- <span>排序:</span>
|
|
|
- <span v-for="item in sortList" :key="item.id" class="sort-body">
|
|
|
- {{ item.name }}
|
|
|
- <i class="el-icon-sort"></i>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <el-button class="add-course" @click="$router.push('/add_course')">
|
|
|
- {{ $t('Learn_New_Courses') }}
|
|
|
- </el-button>
|
|
|
+ <div class="curricula-search-button">
|
|
|
+ <el-button @click="queryMyCourseList">查询</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="curricula-manager-item">
|
|
|
- <div v-for="item in courseList" :key="item.id">
|
|
|
- <div class="circulation">
|
|
|
- <div class="curricula-manager-item-value">
|
|
|
- <span>{{ item.name }}</span>
|
|
|
- <!-- <span>{{ item.val }}</span> -->
|
|
|
- </div>
|
|
|
- <div class="curricula-manager-item-create">
|
|
|
- <span>{{ item.begin_date }}</span>
|
|
|
- <span class="date-horizontal-bar">-</span>
|
|
|
- <span>{{ item.end_date }}</span>
|
|
|
- <!-- <span class="curricula-manager-item-teacher">授课教师:{{ item.teacher }}</span> -->
|
|
|
- </div>
|
|
|
+ <div class="curricula-container">
|
|
|
+ <div class="curricula-container-title">
|
|
|
+ <span>课程列表</span>
|
|
|
+ <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">
|
|
|
+ <el-table :data="courseList">
|
|
|
+ <el-table-column prop="name" label="课程名称" width="240" />
|
|
|
+ <el-table-column prop="begin_date" label="课程周期" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ :page-sizes="[10, 20, 30, 40, 50]"
|
|
|
+ :page-size="page_capacity"
|
|
|
+ layout="prev, pager, next, total, sizes, jumper"
|
|
|
+ :total="total_count"
|
|
|
+ :current-page="cur_page"
|
|
|
+ @prev-click="changePage"
|
|
|
+ @next-click="changePage"
|
|
|
+ @current-change="changePage"
|
|
|
+ @size-change="changePageSize"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -59,48 +58,22 @@ export default {
|
|
|
name: 'CurriculaList',
|
|
|
data() {
|
|
|
return {
|
|
|
- input: '',
|
|
|
- curTab: 0,
|
|
|
- status: '1',
|
|
|
- sortList: [
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- name: '创建时间',
|
|
|
- sortType: 'createTime', // 数组对象中的哪一个属性进行排序
|
|
|
- order: false // 升序还是降序
|
|
|
- },
|
|
|
- {
|
|
|
- id: '2',
|
|
|
- name: '编辑时间',
|
|
|
- sortType: 'editTime',
|
|
|
- order: false
|
|
|
- },
|
|
|
- {
|
|
|
- id: '3',
|
|
|
- name: '开课时间',
|
|
|
- sortType: 'onClassTime',
|
|
|
- order: false
|
|
|
- }
|
|
|
- ],
|
|
|
+ search: '',
|
|
|
statusList: [
|
|
|
- {
|
|
|
- status: '1',
|
|
|
- val: '进行中'
|
|
|
- },
|
|
|
- {
|
|
|
- status: '2',
|
|
|
- val: '待开始'
|
|
|
- },
|
|
|
- {
|
|
|
- status: '3',
|
|
|
- val: '已结束'
|
|
|
- }
|
|
|
+ { value: 1, name: '草稿' },
|
|
|
+ { value: 2, name: '未开始' },
|
|
|
+ { value: 3, name: '已结束' },
|
|
|
+ { value: 4, name: '进行中' }
|
|
|
],
|
|
|
+ finish_status: 1,
|
|
|
+ page_capacity: 10,
|
|
|
+ cur_page: 1,
|
|
|
+ total_count: 0,
|
|
|
courseList: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.search();
|
|
|
+ this.queryMyCourseList();
|
|
|
updateWordPack({
|
|
|
word_key_list: ['Learn_New_Courses']
|
|
|
});
|
|
@@ -111,14 +84,23 @@ export default {
|
|
|
this.curTab = i;
|
|
|
this.search();
|
|
|
},
|
|
|
- search() {
|
|
|
+ changePage(newPage) {
|
|
|
+ this.cur_page = newPage;
|
|
|
+ this.queryMyCourseList();
|
|
|
+ },
|
|
|
+ changePageSize(pageSize) {
|
|
|
+ this.page_capacity = pageSize;
|
|
|
+ this.queryMyCourseList();
|
|
|
+ },
|
|
|
+ queryMyCourseList() {
|
|
|
const queryCriteria = {
|
|
|
finish_status: this.status,
|
|
|
- page_capacity: 200,
|
|
|
- cur_page: 1
|
|
|
+ page_capacity: this.page_capacity,
|
|
|
+ cur_page: this.cur_page
|
|
|
};
|
|
|
- pageQueryMyCourseList(queryCriteria).then(response => {
|
|
|
- this.courseList = response.course_list;
|
|
|
+ pageQueryMyCourseList(queryCriteria).then(({ course_list, total_count }) => {
|
|
|
+ this.courseList = course_list;
|
|
|
+ this.total_count = total_count;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -126,85 +108,66 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-$main-w: 953px;
|
|
|
-
|
|
|
-.curricula-manager {
|
|
|
- &-header .el-input {
|
|
|
- width: 244px;
|
|
|
- height: 40px;
|
|
|
- margin: 37px auto 0;
|
|
|
- display: block;
|
|
|
- }
|
|
|
-
|
|
|
- &-body-button {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 35px;
|
|
|
- font-size: 16px;
|
|
|
+@import '~@/styles/mixin.scss';
|
|
|
|
|
|
- .el-button {
|
|
|
- width: 97px;
|
|
|
- height: 52px;
|
|
|
- }
|
|
|
-
|
|
|
- .el-button + .el-button {
|
|
|
- margin-left: 0;
|
|
|
- }
|
|
|
- }
|
|
|
+.curricula {
|
|
|
+ @include pagination;
|
|
|
|
|
|
- &-body-sort {
|
|
|
+ &-search {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- width: $main-w;
|
|
|
- line-height: 40px;
|
|
|
- margin: 25px auto 15px;
|
|
|
-
|
|
|
- .add-course {
|
|
|
- @extend .bg-color;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- .bg-color {
|
|
|
- background: #c4c4c4;
|
|
|
- border: 1px solid #c4c4c4;
|
|
|
- border-radius: 0;
|
|
|
- color: #000;
|
|
|
+ &-condition {
|
|
|
+ > .el-input {
|
|
|
+ width: 528px;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
|
|
|
- &.active {
|
|
|
- background: #e6e6e6;
|
|
|
- border-color: #0c0c0c;
|
|
|
+ .el-select {
|
|
|
+ width: 225px;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .sort-body {
|
|
|
- margin-left: 20px;
|
|
|
- cursor: pointer;
|
|
|
+ &-button {
|
|
|
+ .el-button {
|
|
|
+ background-color: $buttonColor;
|
|
|
+ color: #fff;
|
|
|
+ width: 114px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- &-item {
|
|
|
- .circulation {
|
|
|
- margin: 0 auto 10px;
|
|
|
- width: $main-w;
|
|
|
- height: 92px;
|
|
|
- background-color: #eee;
|
|
|
- padding: 20px 20px 0;
|
|
|
- }
|
|
|
+ &-container {
|
|
|
+ width: 100%;
|
|
|
+ min-height: calc(100vh - 325px);
|
|
|
+ margin-top: 16px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 8px;
|
|
|
|
|
|
- &-value {
|
|
|
+ &-title {
|
|
|
+ height: 88px;
|
|
|
+ padding: 24px 32px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- }
|
|
|
+ align-items: center;
|
|
|
|
|
|
- .date-horizontal-bar {
|
|
|
- margin: 0 15px;
|
|
|
- }
|
|
|
+ > span {
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 700;
|
|
|
+ }
|
|
|
+
|
|
|
+ .create {
|
|
|
+ width: 138px;
|
|
|
|
|
|
- &-create {
|
|
|
- padding-top: 20px;
|
|
|
+ div {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- &-teacher {
|
|
|
- margin-left: 40px;
|
|
|
+ &-list {
|
|
|
+ @include list;
|
|
|
}
|
|
|
}
|
|
|
}
|