mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
教师专业选项的处理
This commit is contained in:
@@ -191,7 +191,8 @@
|
||||
}else{
|
||||
this.tearchUrl ='';
|
||||
}
|
||||
|
||||
this.teachtext.expertise = res.result.expertise.split( ',' );
|
||||
this.convertExpertise(this.teachtext.expertise);
|
||||
//通过用户的sysId(原系统中的kid)去取用户
|
||||
apiBoeTeahcer.simpleInfo(res.result.sysId).then(sinfo=>{
|
||||
if(sinfo.status=='200'){
|
||||
@@ -205,25 +206,46 @@
|
||||
this.teachtext.photo = sinfo.result.photo;
|
||||
this.tearchUrl = this.fileBaseUrl + sinfo.result.photo;
|
||||
}
|
||||
if(!res.result.expertise && sinfo.result.expertise){
|
||||
this.teachtext.expertise = sinfo.result.expertise.split( ',' );
|
||||
this.convertExpertise(this.teachtext.expertise);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.teachtext.expertise = res.result.expertise.split( ',' );
|
||||
// this.teachtext.expertise = res.result.expertise.split( ',' );
|
||||
// this.convertExpertise(this.teachtext.expertise);
|
||||
//console.log(this.teachtext,"this.teachtext");
|
||||
this.childData=[];
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
this.childData.push(lk);
|
||||
})
|
||||
});
|
||||
this.teachtext.expertise.forEach(item =>{
|
||||
this.childData.forEach(it =>{
|
||||
if(item == it.id){
|
||||
//console.log(item)
|
||||
this.workname.push(it.name);
|
||||
}
|
||||
})
|
||||
})
|
||||
// this.childData=[];
|
||||
// this.sysTypeListtear.forEach(nm =>{
|
||||
// nm.children.forEach(lk =>{
|
||||
// this.childData.push(lk);
|
||||
// })
|
||||
// });
|
||||
// this.teachtext.expertise.forEach(item =>{
|
||||
// this.childData.forEach(it =>{
|
||||
// if(item == it.id){
|
||||
// //console.log(item)
|
||||
// this.workname.push(it.name);
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
})
|
||||
},
|
||||
convertExpertise(expertises){
|
||||
this.childData=[];
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
this.childData.push(lk);
|
||||
})
|
||||
});
|
||||
expertises.forEach(item =>{
|
||||
this.childData.forEach(it =>{
|
||||
if(item == it.id){
|
||||
//console.log(item)
|
||||
this.workname.push(it.name);
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
teacherProfile(){ //检查是否是教师
|
||||
|
||||
@@ -332,7 +332,12 @@ export default {
|
||||
// if(this.domain.length==0){
|
||||
// this.getdomain();
|
||||
// }
|
||||
|
||||
let isBack=false;
|
||||
if(window.history && window.history.pushState) {
|
||||
history.pushState(null, null, document.URL); //这里有没有都无所谓,最好是有以防万一
|
||||
isBack=true;
|
||||
}
|
||||
console.log(isBack,'isBack');
|
||||
Promise.all([apiDict.items("org_domain"),apiCase.majorTypes()]).then(rs=>{
|
||||
if(rs[0].status==200){
|
||||
rs[0].result.forEach(item =>{
|
||||
|
||||
@@ -469,7 +469,8 @@ export default {
|
||||
courseList: [],
|
||||
searchRecords: [],
|
||||
hotList: [],
|
||||
totalPages: 1
|
||||
totalPages: 1,
|
||||
localSessionKey:this.$xpage.constants.localCourseFiltersKey
|
||||
};
|
||||
},
|
||||
|
||||
@@ -538,6 +539,41 @@ export default {
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
saveLocalFilters(){
|
||||
let typeCodeList=[];
|
||||
this.stagList.forEach(item=>{
|
||||
typeCodeList.push({
|
||||
type:item.type,
|
||||
id:item.id,
|
||||
name:item.name
|
||||
})
|
||||
});
|
||||
let typeCodeString=JSON.stringify(typeCodeList);
|
||||
//console.log(typeCodeString);
|
||||
sessionStorage.setItem(this.localSessionKey,typeCodeString);
|
||||
},
|
||||
loadLocalFilters(){
|
||||
let hasData=sessionStorage.getItem(this.localSessionKey);
|
||||
let $this=this;
|
||||
if(hasData){
|
||||
// let typeCodeList=JSON.parse(hasData);
|
||||
// typeCodeList.forEach(item=>{
|
||||
// if(item.type==0){
|
||||
// this.keyword=item.name;
|
||||
// }else if(item.type==1){
|
||||
// if(item.id==20){
|
||||
// $this.ctypeList[0].checked=true;
|
||||
// }else if(item.id==30){
|
||||
// $this.ctypeList[1].checked=true;
|
||||
// }else if(item.id==40){
|
||||
// $this.ctypeList[2].checked=true;
|
||||
// }
|
||||
// }else{ //三级分类的处理,如果一个分类选中多个,显示哪个,显示第一个,是否可以
|
||||
|
||||
// }
|
||||
// })
|
||||
}
|
||||
},
|
||||
stagClose(tag,tagIndex){
|
||||
tag.checked=false;
|
||||
if(tag.type==0){
|
||||
@@ -732,7 +768,7 @@ export default {
|
||||
}
|
||||
$this.oneList.push(newItem);
|
||||
});
|
||||
|
||||
this.loadLocalFilters();
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -932,7 +968,7 @@ export default {
|
||||
// let s=1650973801;
|
||||
// var d = new Date(1650973801*1000);
|
||||
// console.log(formatDateByFmt(d,'yyyy-MM-dd hh:mm'),'data');
|
||||
|
||||
this.saveLocalFilters();
|
||||
let that = this;
|
||||
if (this.keyword) {
|
||||
apiSearchterm.save({ keyword: this.course.keyword, type: 1 });
|
||||
|
||||
@@ -396,6 +396,15 @@
|
||||
loadTeacherinfo(){
|
||||
this.workname=[];
|
||||
this.checkboxtearGroup=[];
|
||||
|
||||
let children=[];
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
children.push(lk);
|
||||
})
|
||||
});
|
||||
this.childData=children;
|
||||
|
||||
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
|
||||
if(res.result.courses){
|
||||
this.teachform.courses = res.result.courses;
|
||||
@@ -407,6 +416,8 @@
|
||||
this.teachform.photo = res.result.photo;
|
||||
this.tearchUrl = this.fileBaseUrl + res.result.photo;
|
||||
}
|
||||
this.teachform.expertise = res.result.expertise.split( ',' );
|
||||
this.convertExpertise(this.teachform.expertise);
|
||||
|
||||
apiBoeTeahcer.simpleInfo(this.userInfo.sysId).then(sinfo=>{
|
||||
if(sinfo.status=='200'){
|
||||
@@ -420,33 +431,44 @@
|
||||
this.teachform.photo = sinfo.result.photo;
|
||||
this.tearchUrl = this.fileBaseUrl + sinfo.result.photo;
|
||||
}
|
||||
if(!res.result.expertise && sinfo.result.expertise){
|
||||
this.teachform.expertise = sinfo.result.expertise.split( ',' );
|
||||
this.convertExpertise(this.teachform.expertise);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.teachform.expertise = res.result.expertise.split( ',' );
|
||||
let children=[];
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
children.push(lk);
|
||||
})
|
||||
});
|
||||
this.childData=children;
|
||||
this.teachform.expertise.forEach(item =>{
|
||||
this.childData.forEach(it =>{
|
||||
if(item == it.id){
|
||||
this.workname.push(it);
|
||||
this.checkboxtearGroup.push(it.id);
|
||||
//console.log(it,'匹配的数据')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// this.teachform.expertise.forEach(item =>{
|
||||
// this.childData.forEach(it =>{
|
||||
// if(item == it.id){
|
||||
// this.workname.push(it);
|
||||
// this.checkboxtearGroup.push(it.id);
|
||||
// //console.log(it,'匹配的数据')
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
})
|
||||
},
|
||||
// Teacherprofile(){
|
||||
// apiTeach.has(this.userInfo.aid).then(res =>{
|
||||
// this.teaechswich = res.result.isTeacher;
|
||||
// })
|
||||
// },
|
||||
convertExpertise(expertises){
|
||||
let children=[];
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
children.push(lk);
|
||||
})
|
||||
});
|
||||
this.childData=children;
|
||||
expertises.forEach(item =>{
|
||||
this.childData.forEach(it =>{
|
||||
if(item == it.id){
|
||||
//console.log(item)
|
||||
this.workname.push(it);
|
||||
this.checkboxtearGroup.push(it.id);
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 保存个人主页选项的编辑
|
||||
saveHideHome(){
|
||||
//执行隐藏操作
|
||||
|
||||
Reference in New Issue
Block a user