mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 04:16:45 +08:00
2022年5月29日从svn移到git
This commit is contained in:
250
src/views/study/TaskList.vue
Normal file
250
src/views/study/TaskList.vue
Normal file
@@ -0,0 +1,250 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="display: flex; justify-content: space-between; padding: 12px 32px 10px 22px;">
|
||||
<div style="display: flex; justify-content: flex-start">
|
||||
<div>
|
||||
<el-select class="search-input" v-model="status" clearable placeholder="学习进度">
|
||||
<el-option label="全部" value="5"></el-option>
|
||||
<el-option label="未开始" value="0"></el-option>
|
||||
<el-option label="进行中" value="1"></el-option>
|
||||
<el-option label="已完成" value="2"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="padding-left: 10px"><el-input v-model="params.cmtask_name" clearable placeholder="搜索名称"></el-input></div>
|
||||
<div class="button-class" style="padding-left: 10px"><el-button type="primary" icon="el-icon-search" @click="search()">搜索</el-button></div>
|
||||
<div class="button-class" style="padding-left: 10px"><el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--课程列表内容-->
|
||||
<div class="uc-list" v-if="couresList.length > 0">
|
||||
<div class="uc-course" v-for="(item, idx) in couresList" @click="jumpRouter(item)" :key="idx">
|
||||
<div class="uc-course-img"><img :src="item.cmtask_imgurl" /></div>
|
||||
<div class="uc-course-info">
|
||||
<!-- 任务名称 -->
|
||||
<div class="uc-course-name one-line-ellipsis" style="cursor: pointer">
|
||||
<span v-if="item.type==10" class="uc-course-type2">录播</span>
|
||||
<span v-if="item.type==20" class="uc-course-type2">录播</span>
|
||||
<!-- <a href="/course/detail?id=" target="_blank"> {{item.name}}</a> -->
|
||||
<span v-html="item.cmtask_name"></span>
|
||||
</div>
|
||||
<!-- <div class="uc-course-source" @click="jumpRouter(item)">来源:{{ item.cmtask_name }}</div> -->
|
||||
<div style="padding-top: 18px; " class="uc-course-text">学习进度:
|
||||
<span v-if="item.cmtask_status==0">未开始</span>
|
||||
<span v-if="item.cmtask_status==1">进行中</span>
|
||||
<span v-if="item.cmtask_status==2">已完成</span>
|
||||
</div>
|
||||
<div class="uc-course-time">推送时间:{{ formatsec(Number(item.updated_at) * 1000 )}}</div>
|
||||
</div>
|
||||
<div class="uc-course-btns">
|
||||
<!-- <a :href="item.type == 1 ? '/pc/course/recorded' : '/pc/course/micro'" target="_blank"> -->
|
||||
<el-button @click="jumpRouter(item)" type="primary" size="small">开始学习</el-button>
|
||||
<!-- </a> -->
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:150px; text-align: center; margin-top:57px;" >
|
||||
<el-pagination background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:current-page="page"
|
||||
:page-size="size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<div v-else class="zan-wu">
|
||||
<div v-if="loading">
|
||||
<span v-if="couresList.length==0">正在加载数据...</span>
|
||||
<span v-else>查询中...</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span v-if="couresList.length==0">没有查询到相关内容</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import studyItem from '@/components/Course/studyItem.vue';
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
import {formatsec} from '@/utils/datetime.js'
|
||||
export default {
|
||||
name: 'ucStudyCourses',
|
||||
components: { studyItem },
|
||||
data() {
|
||||
return {
|
||||
status: '',
|
||||
params:{
|
||||
cmtask_name:'',
|
||||
cmtask_status:'',
|
||||
type:'',
|
||||
},
|
||||
loading:true,
|
||||
size:10,
|
||||
page:1,
|
||||
keyword:'',
|
||||
formatsec,
|
||||
couresList:[],
|
||||
total: 0,
|
||||
options: [
|
||||
{
|
||||
label: '微课',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '在线课',
|
||||
value: 2,
|
||||
children: [
|
||||
{
|
||||
label: '录播课',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '直播课',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '面授课',
|
||||
value: 3
|
||||
}
|
||||
],
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadBoeData();
|
||||
},
|
||||
methods: {
|
||||
|
||||
jumpRouter(item) {
|
||||
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`,'_self' )
|
||||
location.href=`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`;
|
||||
},
|
||||
|
||||
loadBoeData() {
|
||||
if(this.status !== '5') {
|
||||
this.params.cmtask_status = this.status;
|
||||
}
|
||||
let params={
|
||||
// keyword:this.keyword,
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
cmtask_status:this.params.cmtask_status,
|
||||
cmtask_name:this.params.cmtask_name,
|
||||
}
|
||||
this.loading=true;
|
||||
apiBoeCourse.cmtaskList(params).then(res=>{
|
||||
if(res.status==200){
|
||||
this.total = res.result.count
|
||||
this.couresList = res.result.list;
|
||||
}else{
|
||||
this.$message.error('查询数据失败:'+res.message);
|
||||
}
|
||||
this.loading=false;
|
||||
|
||||
}).catch(()=>{
|
||||
this.loading=false;
|
||||
})
|
||||
},
|
||||
search(){
|
||||
this.loadBoeData()
|
||||
},
|
||||
reset() {
|
||||
this.loading=false;
|
||||
this.params.cmtask_name = '',
|
||||
this.params.type = '',
|
||||
this.params.cmtask_status = ''
|
||||
this.status = '';
|
||||
this.loadBoeData();
|
||||
},
|
||||
handleSizeChange(value) {
|
||||
this.size = value;
|
||||
this.loadBoeData();
|
||||
},
|
||||
//改变条数的回调
|
||||
handleCurrentChange(value) {
|
||||
this.page = value;
|
||||
this.loadBoeData();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.zan-wu{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
margin-top: 70px;
|
||||
color: #ccc;
|
||||
}
|
||||
.one-line-ellipsis {
|
||||
display: -webkit-box;
|
||||
white-space: pre-wrap;
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.button-class{
|
||||
// height: 42px;
|
||||
}
|
||||
|
||||
.uc-list{
|
||||
padding-left: 22px;
|
||||
}
|
||||
.uc-course-time{
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
.uc-badge {
|
||||
margin-top: 10px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
.uc-course {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
border-bottom: 1px solid #E8E8E8;
|
||||
margin-right: 32px;
|
||||
padding: 20px 0px 15px 0px ;
|
||||
.uc-course-img {
|
||||
width: 212px;
|
||||
height: 119px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.uc-course-info {
|
||||
// width: 50%;
|
||||
flex: 1;
|
||||
line-height: 28px;
|
||||
padding: 0px 10px;
|
||||
.uc-course-name {
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
margin-top: -3px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.uc-course-text {
|
||||
color: #444;
|
||||
margin-bottom:3px;
|
||||
font-size: 16px;
|
||||
margin-top: 20px;
|
||||
|
||||
}
|
||||
}
|
||||
.uc-course-btns {
|
||||
text-align: right;
|
||||
margin-top: 80px;
|
||||
width: 100px;
|
||||
height: 44px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user