教师专业选项的处理

This commit is contained in:
daihh
2023-01-18 11:24:41 +08:00
parent 58377363b6
commit d360b96bc0
4 changed files with 127 additions and 42 deletions

View File

@@ -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 });