mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
教师专业选项的处理
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user