@@ -107,14 +111,30 @@ export default {
keyword:'',
formatsec,
couresList:[],
- total: 0
+ total: 0,
+ isType: null,
+ typeClass: true,
};
},
+ watch:{
+ '$route': {
+ handler(to, from) {
+ console.log('type变化了', to.query.type);
+ this.isType = to.query.type;
+ this.loadBoeData();
+ },
+ immediate: true
+ }
+ },
mounted() {
this.loadBoeData();
this.getPossData()
},
methods: {
+ learnType(item){
+ this.typeClass = item
+ this.reset()
+ },
jumpRouter(item) {
//location.href=`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`;
@@ -157,17 +177,59 @@ export default {
cmtask_name:this.params.cmtask_name,
}
this.loading=true;
- 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){
+ //定制化学习
+ if(this.typeClass == 1){
+ apiManage.customized(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.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.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;
@@ -196,6 +258,31 @@ export default {