mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
Merge branch 'dai-master'
This commit is contained in:
@@ -30,7 +30,7 @@ const formRequest=axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
// baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
timeout: 60000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
|
||||
@@ -26,8 +26,17 @@ const userDeleteStudy = function(data){
|
||||
return ajax.postJson(baseURL,'/stu/project/stuCancelEnrollment',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新报名
|
||||
* {studentId,pid}
|
||||
*/
|
||||
const userRsSginupCourse = function(data){
|
||||
return ajax.postJson(baseURL,'/stu/project/stuCancelEnrollment',data);
|
||||
}
|
||||
|
||||
export default {
|
||||
getTaskNum,
|
||||
userTaskList,
|
||||
userDeleteStudy
|
||||
userDeleteStudy,
|
||||
userRsSginupCourse
|
||||
}
|
||||
|
||||
@@ -376,6 +376,11 @@ const myStudysFromES=function (data){
|
||||
return ajax.post('/xboe/school/study/es/search',data);
|
||||
}
|
||||
|
||||
/**根据id集合查询,传入的是id数组*/
|
||||
const findByIds=function (ids){
|
||||
return ajax.postJson('/xboe/school/study/es/list-by-ids',ids);
|
||||
}
|
||||
|
||||
export default {
|
||||
hasSignup,
|
||||
signup,
|
||||
@@ -406,6 +411,7 @@ export default {
|
||||
myExamList2,
|
||||
myCourseStudy,
|
||||
myStudysFromES,
|
||||
findByIds,
|
||||
deleteSignUp,
|
||||
ids,
|
||||
followIds
|
||||
|
||||
@@ -111,6 +111,11 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
//计算是http还是https
|
||||
let urlPre=window.location.protocol;
|
||||
this.uploadFileUrl=urlPre+this.uploadFileUrl.substring(this.uploadFileUrl.indexOf(':')+1);
|
||||
},
|
||||
computed: {
|
||||
// 是否显示提示
|
||||
showTip() {
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<!-- <el-table-column prop="finishTime" label="结束时间"></el-table-column> -->
|
||||
<el-table-column prop="totalDuration" label="学习时长(分)">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.totalDuration == 0? '0': scope.row.totalDuration/60}}
|
||||
{{ scope.row.totalDuration == 0? '0': (scope.row.totalDuration/60).toFixed(2)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="progress" label="进度">
|
||||
|
||||
@@ -29,7 +29,7 @@ const jsonRequest=axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
timeout: 60000,
|
||||
});
|
||||
//发送json对象的拦截器
|
||||
jsonRequest.interceptors.request.use(config => {
|
||||
|
||||
@@ -1,87 +1,15 @@
|
||||
<template>
|
||||
<div class="study-index" v-loading="loading">
|
||||
<Remark>
|
||||
1.学员个人中心首页,当前简单,后续会美化<br/>
|
||||
2.<br/>
|
||||
3.<br/>
|
||||
|
||||
</Remark>
|
||||
<!-- <div style="display: flex;justify-content:space-between; padding: 10px;">
|
||||
<div style="display: flex;justify-content: flex-start;">
|
||||
<div><el-input v-model="params.name" placeholder="查询名称"></el-input></div>
|
||||
<div style="padding-left: 10px;">
|
||||
<el-select v-model="params.type" clearable placeholder="请选择">
|
||||
<el-option label="微课" value="1"></el-option>
|
||||
<el-option label="在线课" value="2"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="padding-left: 10px;">
|
||||
<el-button type="primary" icon="el-icon-search">查询</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-badge :value="2" class="uc-badge">
|
||||
<el-button >未开始</el-button>
|
||||
</el-badge>
|
||||
<el-badge :value="3" class="uc-badge">
|
||||
<el-button >学习中</el-button>
|
||||
</el-badge>
|
||||
<el-badge :value="1" class="uc-badge" type="primary">
|
||||
<el-button >已完成</el-button>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div> -->
|
||||
<!--课程列表内容-->
|
||||
<div>
|
||||
<!-- <div v-if="lastStudy.itemId && lastStudy.itemId!=''">
|
||||
<p class="title"><i class="el-icon-caret-right"></i> 上次学习</p>
|
||||
<div>
|
||||
<div>
|
||||
<span>【{{getCourseType(lastStudy.courseType)}}】 {{lastStudy.courseName}}, </span>
|
||||
<span style="margin: 0px 10px;"> {{lastStudy.lastTime}} </span>
|
||||
<span> {{lastStudy.contentName}} </span>
|
||||
<span style="margin: 0px 10px;">
|
||||
<el-link type="primary" :href="continueStudy(lastStudy)" target="_blank">继续学习</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<!-- <p class="title">
|
||||
<router-link to="/uc/study/courses"><i class="el-icon-caret-right"></i> 正在学习</router-link>
|
||||
<span v-if="couresList.length>5" class="more"><router-link to="/uc/study/courses">更多 ></router-link></span>
|
||||
</p> -->
|
||||
<div>
|
||||
<!-- <div v-if="couresList.length>0" style="">
|
||||
|
||||
</div> -->
|
||||
<!-- <div v-else style="text-align: center;padding: 20px;color: #ffaa00;">目前您没有正在学习的课程</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<!-- <p class="title">
|
||||
<router-link to="/uc/study/task"><i class="el-icon-caret-right"></i> 正在进行的任务</router-link>
|
||||
<span v-if="taskList.length>5" class="more"><router-link to="/uc/study/task">更多 ></router-link></span>
|
||||
</p> -->
|
||||
<div>
|
||||
<!-- <div v-if="taskList.length>0">
|
||||
|
||||
</div> -->
|
||||
<!-- <div v-else style="text-align: center;padding: 20px;color: #ffaa00; ">目前您没有正在进行的任务</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import studyItem from '@/components/Course/studyItem.vue'
|
||||
import apicourseStudy from '@/api/modules/courseStudy.js';
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
// import apiBoeCourse from '@/api/boe/course.js';
|
||||
import {resListMap, resOwnerListMap,courseType,getType} from '@/utils/tools.js';
|
||||
import apiBoe from '@/api/boe/boeApiAjax.js';
|
||||
import axios from 'axios'
|
||||
@@ -130,36 +58,36 @@
|
||||
// cmtask_status:this.cmtask_status,
|
||||
// cmtask_name:this.cmtask_name,
|
||||
}
|
||||
|
||||
apiBoeCourse.cmtaskList(params).then(res=>{
|
||||
if(res.status==200){
|
||||
this.total = res.result.count
|
||||
this.couresList = res.result.list;
|
||||
this.loading = false;
|
||||
if(this.$route.fullPath != '/uc/study/task' && this.$route.fullPath != '/uc/study/courses' && this.$route.fullPath != '/study/index') {
|
||||
return;
|
||||
}
|
||||
if(res.result.count > 0) {
|
||||
this.$router.push('/uc/study/task')
|
||||
} else {
|
||||
if(this.$route.query.study == '1') {
|
||||
this.$router.push('/uc/study/task')
|
||||
} else {
|
||||
this.$router.push('/uc/study/courses')
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.$router.push('/uc/study/courses')
|
||||
}
|
||||
}).catch(err=>{
|
||||
if(this.$route.fullPath != '/uc/study/task' || this.$route.fullPath != '/uc/study/courses' || this.$route.fullPath != '/study/index') {
|
||||
return;
|
||||
}
|
||||
this.$router.push('/uc/study/courses');
|
||||
})
|
||||
|
||||
// apiBoeCourse.cmtaskList(params).then(res=>{
|
||||
// if(res.status==200){
|
||||
// this.total = res.result.count
|
||||
// this.couresList = res.result.list;
|
||||
// this.loading = false;
|
||||
// if(this.$route.fullPath != '/uc/study/task' && this.$route.fullPath != '/uc/study/courses' && this.$route.fullPath != '/study/index') {
|
||||
// return;
|
||||
// }
|
||||
// if(res.result.count > 0) {
|
||||
// this.$router.push('/uc/study/task')
|
||||
// } else {
|
||||
// if(this.$route.query.study == '1') {
|
||||
// this.$router.push('/uc/study/task')
|
||||
// } else {
|
||||
// this.$router.push('/uc/study/courses')
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// this.$router.push('/uc/study/courses')
|
||||
// }
|
||||
// }).catch(err=>{
|
||||
// if(this.$route.fullPath != '/uc/study/task' || this.$route.fullPath != '/uc/study/courses' || this.$route.fullPath != '/study/index') {
|
||||
// return;
|
||||
// }
|
||||
// this.$router.push('/uc/study/courses');
|
||||
// })
|
||||
},
|
||||
created() {
|
||||
//this.$router.push('/uc/study/courses');
|
||||
this.$router.push('/uc/study/courses');
|
||||
// this.searchData();
|
||||
// this.getLastStudy();
|
||||
// this.loadRemoteTask();
|
||||
|
||||
@@ -779,6 +779,10 @@ export default {
|
||||
this.$message({type: 'error',message: 'SCORM包解析失败'});
|
||||
}
|
||||
|
||||
}else if(row.resType==40){
|
||||
if(!row.previewFilePath){
|
||||
row.previewFilePath=row.filePath;
|
||||
}
|
||||
}
|
||||
//console.log(row, 'row');
|
||||
this.coursewareShow = true;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<el-table style="margin:10px 32px 10px 22px;" :data="pageData" border stripe>
|
||||
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||
<el-table-column v-if="forChoose" label="选择" width="80">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope" v-if="scope.row.published">
|
||||
<el-button type="default" size="mini" @click="handleChoose(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -46,16 +46,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top:6px" class="uc-course-text"><i class="el-icon-time" style="margin-right:4px"></i>报名时间:{{ formatsec(Number(item.startTime) * 1000 )}}</div>
|
||||
<div style="width: 80%;margin-top: 20px;display: flex;">
|
||||
<div style="color: #333333;font-size: 14px;">当前进度:</div>
|
||||
<div v-if="item.courseType==30">
|
||||
<div class="uc-course-text" style="margin-top: 8px;"><i class="el-icon-location-outline" style="margin-right:4px"></i>面授地点:{{ item.courseAddress }}</div>
|
||||
<div class="uc-course-text" style="margin-top: 8px;"><i class="el-icon-timer" style="margin-right:4px"></i>上课时间:{{ formatsec(Number(item.attendCourseTime) * 1000 ) }}</div>
|
||||
</div>
|
||||
<div v-else style="width: 80%;margin-top: 20px;display: flex;">
|
||||
<div style="color: #333333;font-size: 14px;"><i class="el-icon-s-operation" style="margin-right:4px"></i>当前进度:</div>
|
||||
<div style="width:170px;padding-top: 5px;">
|
||||
<el-progress :percentage="item.progress" color="#FFA050"></el-progress>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uc-course-btns">
|
||||
<div style="text-align: right;">
|
||||
<!-- <el-button class="del" @click.stop="delItem(item,idx)" type="text" icon="el-icon-delete" size="mini" title="删除"></el-button> -->
|
||||
<!-- <div style="text-align: right;">
|
||||
<el-button class="del" @click.stop="delItem(item,idx)" type="text" icon="el-icon-delete" size="mini" title="删除"></el-button>
|
||||
<el-dropdown trigger="click" style="display: none;">
|
||||
<span class="el-dropdown-link">
|
||||
<svg-icon style="margin-right: 0;font-size:26px;" icon-class="spot"></svg-icon>
|
||||
@@ -66,12 +70,38 @@
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div> -->
|
||||
<div v-if="item.courseType==30">
|
||||
<div v-if="item.applyStatus==10"><!--「报名待审核」展示为「等待审核」-->
|
||||
<div><el-button style="margin-top:30px" type="primary" disabled size="small">等待审核</el-button></div>
|
||||
<!-- <div><el-button style="margin-top:30px;text-align: right;" type="text" size="small">取消报名</el-button></div> -->
|
||||
</div>
|
||||
<div v-if="item.applyStatus==20"><!--「报名取消」」-->
|
||||
<div><el-button style="margin-top:30px" type="primary" disabled size="small">已取消</el-button></div>
|
||||
<div><el-button @click.stop="reSignupCourse(item)" style="margin-top:30px;text-align: right;" type="text" size="small">重新报名</el-button></div>
|
||||
</div>
|
||||
<div v-if="item.applyStatus==30"><!--「报名审核通过」展示为「报名成功」-->
|
||||
<div><el-button style="margin-top:30px" type="primary" disabled size="small">报名成功</el-button></div>
|
||||
</div>
|
||||
<div v-if="item.applyStatus==40"><!--「审核拒绝」展示为「报名失败」-->
|
||||
<div><el-button style="margin-top:30px" type="primary" disabled size="small">报名失败</el-button></div>
|
||||
<div style="margin-top:30px;text-align: right;">
|
||||
<el-button @click.stop="reSignupCourse(item)" type="text" size="small">重新报名</el-button>
|
||||
<el-button @click.stop="delItem(item,idx)" type="text" size="small">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.applyStatus==50"><!--「报名已删除」展示为「报名已删除」-->
|
||||
<div><el-button style="margin-top:30px" type="primary" disabled size="small">报名已删除</el-button></div>
|
||||
<div><el-button @click.stop="delItem(item,idx)" style="margin-top:30px;text-align: right;" type="text" size="small">删除</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else >
|
||||
<span @click.stop="jumpRouter(item)">
|
||||
<!-- <el-button style="margin-top:30px" v-if="item.progress==0" type="primary" size="small">开始学习</el-button> -->
|
||||
<el-button style="margin-top:30px" v-if="item.progress<100" type="primary" size="small">继续学习</el-button>
|
||||
<el-button style="margin-top:30px" v-if="item.progress==100" type="primary" size="small">回顾</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<span @click.stop="jumpRouter(item)">
|
||||
<!-- <el-button style="margin-top:30px" v-if="item.progress==0" type="primary" size="small">开始学习</el-button> -->
|
||||
<el-button style="margin-top:30px" v-if="item.progress<100" type="primary" size="small">继续学习</el-button>
|
||||
<el-button style="margin-top:30px" v-if="item.progress==100" type="primary" size="small">回顾</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="couresList.length > 0 " style="text-align: center;margin-top:57px;">
|
||||
@@ -179,6 +209,28 @@ export default {
|
||||
|
||||
})
|
||||
},
|
||||
//重新报名
|
||||
reSignupCourse(item){
|
||||
if(item.source==3){
|
||||
this.$confirm('您确定要重新报名学习吗?', '重新报名提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() =>{
|
||||
var reqData={ pid:item.courseId, student:item.accountId }
|
||||
apiManage.userRsSginupCourse(reqData).then(res=>{
|
||||
if(res.code==200){
|
||||
this.$message({ type: 'success', message: '报名已提交!' });
|
||||
this.findStudys();
|
||||
}else{
|
||||
this.$message({ type: 'error', message: '重新报名处理失败!' });
|
||||
}
|
||||
})
|
||||
}).catch(err=>{
|
||||
//this.$message({ type: 'error', message: '重新报名处理失败:'+err });
|
||||
})
|
||||
}
|
||||
},
|
||||
findStudys(flag){ //新的
|
||||
if(flag){
|
||||
this.page.pageIndex=1;
|
||||
@@ -199,11 +251,29 @@ export default {
|
||||
this.loading=true;
|
||||
apiCourseStudy.myStudysFromES(reqData).then(res=>{
|
||||
if(res.status==200){
|
||||
let localCourseIds=[];//本地在线课程的id集合
|
||||
res.result.list.forEach(item=>{
|
||||
if(item.courseImage.startsWith('/upload')){
|
||||
item.courseImage=$this.fileUrl+item.courseImage.substring(7)
|
||||
}
|
||||
})
|
||||
if(item.source==2){
|
||||
localCourseIds.push(item.id);
|
||||
}
|
||||
});
|
||||
if(localCourseIds.length>0){
|
||||
//二次提取学习进度
|
||||
apiCourseStudy.findByIds(localCourseIds).then(rs2=>{
|
||||
if(rs2.status==200){
|
||||
res.result.list.forEach(item=>{
|
||||
rs2.result.forEach(idItem=>{
|
||||
if(item.id==idItem.id){
|
||||
item.progress=idItem.progress;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.couresList=res.result.list;
|
||||
this.page.count=res.result.count;
|
||||
}else{
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
|
||||
<script>
|
||||
import studyItem from '@/components/Course/studyItem.vue';
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
import apiManage from '@/api/manage/manage.js'
|
||||
import { getToken } from '@/utils/token'
|
||||
import {formatsec} from '@/utils/datetime.js'
|
||||
@@ -108,32 +107,7 @@ export default {
|
||||
keyword:'',
|
||||
formatsec,
|
||||
couresList:[],
|
||||
total: 0,
|
||||
options: [
|
||||
{
|
||||
label: '微课',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '在线课',
|
||||
value: 2,
|
||||
children: [
|
||||
{
|
||||
label: '录播课',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '直播课',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '面授课',
|
||||
value: 3
|
||||
}
|
||||
],
|
||||
|
||||
total: 0
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -194,18 +168,6 @@ export default {
|
||||
}).catch(()=>{
|
||||
this.loading=false;
|
||||
})
|
||||
// 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.page=1;
|
||||
|
||||
@@ -1347,24 +1347,22 @@
|
||||
console.log(rs.message);
|
||||
}
|
||||
});
|
||||
// let postData = {
|
||||
// id: this.appentId,
|
||||
// studyId: this.studyId,
|
||||
// courseId: this.courseInfo.id,
|
||||
// contentId: this.contentData.id,
|
||||
// studyInfo: this.courseInfo.name +
|
||||
// "-" +
|
||||
// this.contentData.contentName,
|
||||
// duration: duration
|
||||
// };
|
||||
// apiStudy.appendStudyTime(postData).then(rs => {
|
||||
// if (rs.status == 200) {
|
||||
// this.appentId = rs.result;
|
||||
// studyUtil.clearStudyDuration(); //清除本地存储
|
||||
// } else {
|
||||
// console.log(rs.message);
|
||||
// }
|
||||
// });
|
||||
let postAppendData = {
|
||||
id: this.appentId,
|
||||
studyId: this.studyId,
|
||||
courseId: this.courseInfo.id,
|
||||
contentId: this.contentData.id,
|
||||
studyInfo: this.courseInfo.name +"-" +this.contentData.contentName,
|
||||
duration: duration
|
||||
};
|
||||
apiStudy.appendStudyTime(postAppendData).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
this.appentId = rs.result;
|
||||
studyUtil.clearStudyDuration(); //清除本地存储
|
||||
} else {
|
||||
console.log(rs.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//结束追加学习时长
|
||||
|
||||
Reference in New Issue
Block a user