调整跳转处理

This commit is contained in:
daihh
2022-09-09 17:47:03 +08:00
parent 95ad0c0db0
commit 54902e9063

View File

@@ -79,148 +79,23 @@
</template>
<script>
import studyItem from '@/components/Course/studyItem.vue'
import apicourseStudy from '@/api/modules/courseStudy.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'
import { mapGetters,mapActions} from 'vuex';
export default {
name: 'ucStudyIndex',
components:{studyItem},
components:{},
data(){
return {
loading:false,
lastTabName:'course',
getCourseType:courseType,
lastStudy:{
aname: "",
contentId: "",
contentName: "",
contentType: 0,
courseId: "",
courseName: "",
courseType: "",
coverImg: "",
itemId: "",
lastStudyTime: 0,
lastTime: "",
progress: 100,
score: "",
studyDuration: "",
studyId: "",
},
params:{
pageIndex: 1,//第几页
pageSize: 5,
isFinish:false,
},
couresList:[],
couresCount:0,
taskList:[]
loading:false
}
},
beforeCreate() {
this.loading = true;
let params={
// keyword:this.keyword,
page:1,
size:10,
// 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');
// })
this.$router.push('/uc/study/task')
},
created() {
//this.$router.push('/uc/study/courses');
// this.searchData();
// this.getLastStudy();
// this.loadRemoteTask();
// this.loadResOwners();
// this.loadSysTypes();
},
methods:{
continueStudy(item){
if(item.courseType==10){
return '../course/micro?id='+item.courseId
}else{
return '../course/studyindex?id='+item.courseId
}
},
...mapActions({
getResOwnerTree:'resOwner/getResOwnerTree',
loadResOwners:'resOwner/loadResOwners',
getSysTypeTree:'sysType/getSysTypeTree',
loadSysTypes:'sysType/loadSysTypes'
}),
getLastStudy() {
apicourseStudy.lastStudy().then(res=>{
if(res.status === 200) {
this.lastStudy=res.result;
} else {
this.$message.error(res.message);
}
})
},
loadRemoteTask(){
//调用远程接口
// let url="http://u.boe.com/api/b1/system/cmtask/cmtask-list";
// let jsonData={
// cmtask_status:'',
// cmtask_name:'',
// page:1,
// size:10
// }
// axios.post(url,jsonData).then(rs=>{
// console.log(rs)
// })
// apiBoe.postJson(url,jsonData).then(rs=>{
// if(rs.status==200){
// }
// })
},
searchData() {
apicourseStudy.myStudyList(this.params).then(res=>{
if(res.status === 200) {
this.couresList =res.result.list;
this.couresCount = res.result.count;
} else {
this.$message.error(res.message);
}
})
},
lastTabChange(tab,event){
console.log(tab.name);
}
}
}
</script>