update code

prv
haha 2023-10-26 00:01:30 +08:00
parent fb7de75594
commit 79606eaf12
1 changed files with 12 additions and 7 deletions

View File

@ -187,8 +187,9 @@ export default {
it.id = it.deptId; it.id = it.deptId;
return it; return it;
})] })]
} }
this.deptChange((()=>{})); this.setScreenLiSel1(this.localStorage1);
this.deptChange();
}); });
} }
this.$root.isTypeBuser = this.isTypeBuser; this.$root.isTypeBuser = this.isTypeBuser;
@ -343,10 +344,14 @@ export default {
this.data = [{ id: 0, text: '所有项目' }, ...objs]; this.data = [{ id: 0, text: '所有项目' }, ...objs];
this.$bus.$emit("loadProjects", this.data); this.$bus.$emit("loadProjects", this.data);
this.$root.projects = this.data; this.$root.projects = this.data;
if (this.data.length > 0) { if(this.data.find(it=>it.id==this.localStorage2.id)){
this.setScreenLiSel2(this.data[0], init); this.setScreenLiSel2(this.localStorage2)
} else { }else{
this.setScreenLiSel2(null); if (this.data.length > 0) {
this.setScreenLiSel2(this.data[0], init);
} else {
this.setScreenLiSel2(null);
}
} }
if(cb){ if(cb){
cb(); cb();
@ -357,7 +362,7 @@ export default {
if (item) { if (item) {
this.showSel2 = false; this.showSel2 = false;
if (!init||!this.dept2) { if (!init||!this.dept2) {
localStorage.setItem("data2", JSON.stringify(item)) localStorage.setItem("data2", JSON.stringify(item))
this.localStorage2 = JSON.parse(localStorage.getItem("data2")) this.localStorage2 = JSON.parse(localStorage.getItem("data2"))
this.$emit('itemdata', item); this.$emit('itemdata', item);
this.dept2 = item.text; this.dept2 = item.text;