Merge branch 'zcwy_0716_learning' into dev0515

This commit is contained in:
zhangsir
2024-09-19 16:56:09 +08:00
3 changed files with 70 additions and 149 deletions

View File

@@ -123,7 +123,7 @@
<div style="font-weight: 400;font-size: 16px; margin-top: 8px;">{{userInfo.name}}</div>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="setCurIdentity(1)"><span @click="goCenter">个人中心</span></el-dropdown-item>
<el-dropdown-item @click.native="setCurIdentity(1)"><a :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`">个人中心</a></el-dropdown-item>
<el-dropdown-item><router-link :to="'/home/'+userInfo.aid">个人主页</router-link></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -206,100 +206,26 @@ export default {
keyword: '',
isTiao: false,
sex:'',
fistTotals: 0,
pathTotals: 0,
growTotal: 0,
nums: 0,
courseNum: 0,
};
},
created() {
this.learnTotal()
},
mounted() {
this.sex = this.userInfo.sex;
this.$store.dispatch('refrashMsg');
// this.loadBoeData();
this.loadBoeData();
//this.loadPopupConfig();
},
methods: {
learnTotal(){
let params = {
pageNo: 1,
pageSize: 10,
cmtask_user_status: "",
cmtask_name: ""
}
let reqData={
courseName:'',
courseType:'',
status:'',
progress:'',
pageIndex:1,
pageSize:10
}
const promises = [
//领导力
// apiManage.leadership(params).then(res=>{
// this.fistTotals =parseInt(res.data.total);
// }),
//学习路径
// apiManage.compulsoryList(params).then(res=>{
// this.pathTotals =parseInt(res.data.total);
// }),
getList(this.userInfo.aid).then(res=>{
if(res.code == 200 && Object.keys(res.data).length){
this.growTotal = 1
}else{
this.growTotal = 0
}
}),
apiCourseStudy.myStudysFromES(reqData).then(res=>{
this.courseNum = res.result.count;
sessionStorage.setItem('courseNums',this.courseNum)
})
]
Promise.all(promises).then(() => {
this.nums = this.fistTotals + this.pathTotals + this.growTotal;
console.log(this.nums,'this.nums')
sessionStorage.setItem('fistTotals',this.fistTotals)
sessionStorage.setItem('pathTotals',this.pathTotals)
sessionStorage.setItem('growTotal',this.growTotal)
this.loadBoeData();
});
},
setCurIdentity(iden){
this.$store.dispatch('SetCurIdentity',iden);
},
tomy(){
console.log('lll')
},
goCenter(){
console.log(this.isTiao,'isTiao')
if(this.isTiao){
if(this.nums == 0){
window.location.href = `${this.webBaseUrl}/uc/study/task?type=9`;
return
}
// window.location.href = `${this.webBaseUrl}/uc/study/task?type=${this.fistTotals || this.growTotal || this.pathTotals}`;
if(this.fistTotals != 0){
window.location.href = `${this.webBaseUrl}/uc/study/task?type=1`;
}else if (this.growTotal != 0){
window.location.href = `${this.webBaseUrl}/uc/study/growth`;
}else if (this.pathTotals != 0){
window.location.href = `${this.webBaseUrl}/uc/study/task?type=2`;
}else{
window.location.href = `${this.webBaseUrl}/uc/study/task?type=9`;
}
}else{
window.location.href = `${this.webBaseUrl}/uc/study/courses`;
}
},
loadBoeData() {
if(this.nums == 0 && this.courseNum>0){
this.isTiao = false;
}else{
if(this.studyTaskCount>0){
this.isTiao = true;
}else{
this.isTiao = false;
}
// let params = {
// // keyword:this.keyword,

View File

@@ -480,14 +480,11 @@ export default {
overlayShow: false,
instructor:0,
fistTotal:0,
// fistTotals:1,
fistTotals:0,
fistTotals:1,
proTotal: 0,
// proTotals: 1,
proTotals: 0,
proTotals: 1,
pathTotal:0,
// pathTotals:1,
pathTotals:0,
pathTotals:1,
growTotal: 1,
openedsList:[],
courseNum: 0,
@@ -545,17 +542,17 @@ export default {
}
const promises = [
//领导力
// apiManage.leadership(params).then(res=>{
// this.fistTotals =parseInt(res.data.total);
// }),
apiManage.leadership(params).then(res=>{
this.fistTotals =parseInt(res.data.total);
}),
//项目
// apiManage.customized(params).then(res=>{
// this.proTotals =parseInt(res.data.total);
// })
//学习路径
// apiManage.compulsoryList(params).then(res=>{
// this.pathTotals =parseInt(res.data.total);
// }),
apiManage.compulsoryList(params).then(res=>{
this.pathTotals =parseInt(res.data.total);
}),
getList(this.userInfo.aid).then(res=>{
if(res.code == 200 && Object.keys(res.data).length){
this.growTotal = 1
@@ -578,14 +575,12 @@ export default {
}
}
});
// apiManage.queryTaskCounts({}).then(res=>{
// // this.proTotal =parseInt(res.data.count); //学习项目
// this.fistTotal =parseInt(res.data.count1); // 领导力必修
// this.pathTotal =parseInt(res.data.count2); // 学习路径
// // this.growTotal = parseInt(res.data.count3); //成长路径
// })
this.fistTotal = 1
this.pathTotal = 1
apiManage.queryTaskCounts({}).then(res=>{
// this.proTotal =parseInt(res.data.count); //学习项目
this.fistTotal =parseInt(res.data.count1); // 领导力必修
this.pathTotal =parseInt(res.data.count2); // 学习路径
// this.growTotal = parseInt(res.data.count3); //成长路径
})
},
//讲师认证条数
instructorCertification(){

View File

@@ -198,56 +198,56 @@ export default {
cmtask_name:this.params.cmtask_name,
}
this.loading=true;
// if(this.isType == 1){
// //领导力必修
// apiManage.leadership(params).then(res=>{
// if(res.code==200){
// this.total =parseInt(res.data.total);
// this.couresList = res.data.records;
// }else{
// this.$message.error('查询数据失败:'+res.msg);
// }
// this.loading=false;
// }).catch(()=>{
// this.loading=false;
// })
// }else if (this.isType == 2){
// //定制化学习
// apiManage.compulsoryList(params).then(res=>{
// if(res.code==200){
// this.total =parseInt(res.data.total);
// this.couresList = res.data.records;
// }else{
// this.$message.error('查询数据失败:'+res.msg);
// }
// this.loading=false;
// }).catch(()=>{
// this.loading=false;
// })
// }else{
// apiManage.leadership(params).then(res=>{
// if(res.code==200){
// this.total =parseInt(res.data.total);
// this.couresList = res.data.records;
// }else{
// this.$message.error('查询数据失败:'+res.msg);
// }
// this.loading=false;
// }).catch(()=>{
// this.loading=false;
// })
// // apiManage.userTaskList(params).then(res=>{
// // if(res.code==200){
// // this.total =parseInt(res.data.total);
// // this.couresList = res.data.records;
// // }else{
// // this.$message.error('查询数据失败:'+res.msg);
// // }
// // this.loading=false;
// // }).catch(()=>{
// // this.loading=false;
// // })
// }
if(this.isType == 1){
//领导力必修
apiManage.leadership(params).then(res=>{
if(res.code==200){
this.total =parseInt(res.data.total);
this.couresList = res.data.records;
}else{
this.$message.error('查询数据失败:'+res.msg);
}
this.loading=false;
}).catch(()=>{
this.loading=false;
})
}else if (this.isType == 2){
//定制化学习
apiManage.compulsoryList(params).then(res=>{
if(res.code==200){
this.total =parseInt(res.data.total);
this.couresList = res.data.records;
}else{
this.$message.error('查询数据失败:'+res.msg);
}
this.loading=false;
}).catch(()=>{
this.loading=false;
})
}else{
apiManage.leadership(params).then(res=>{
if(res.code==200){
this.total =parseInt(res.data.total);
this.couresList = res.data.records;
}else{
this.$message.error('查询数据失败:'+res.msg);
}
this.loading=false;
}).catch(()=>{
this.loading=false;
})
// apiManage.userTaskList(params).then(res=>{
// if(res.code==200){
// this.total =parseInt(res.data.total);
// this.couresList = res.data.records;
// }else{
// this.$message.error('查询数据失败:'+res.msg);
// }
// this.loading=false;
// }).catch(()=>{
// this.loading=false;
// })
}
},
search(){
this.page=1;