|
@@ -143,7 +143,7 @@ export default {
|
|
|
this.$checkRes(res, '设置成功', res.errmsg);
|
|
|
},
|
|
|
//班主任使用,默认班级
|
|
|
- async getClassOption() {
|
|
|
+ async getClassOption(needReturn = true) {
|
|
|
let termid = _.get(this.defaultOption, 'termid');
|
|
|
let planid = _.get(this.defaultOption, 'planid');
|
|
|
if (!termid) return;
|
|
@@ -178,18 +178,21 @@ export default {
|
|
|
this.$set(this, `options`, options);
|
|
|
}
|
|
|
}
|
|
|
- //教师/班主任,如果今天有班级选择
|
|
|
- for (const i of orginList) {
|
|
|
- const { startdate, enddate } = i;
|
|
|
- const r = moment().isBetween(startdate, enddate, null, '[]');
|
|
|
- if (r) {
|
|
|
- const { _id, termid } = i;
|
|
|
- let options = _.cloneDeep(this.options);
|
|
|
- options.classid = _id;
|
|
|
- options.termid = termid;
|
|
|
- this.$set(this, `options`, options);
|
|
|
- break;
|
|
|
+ if (this.needInit) {
|
|
|
+ //教师/班主任,如果今天有班级选择
|
|
|
+ for (const i of orginList) {
|
|
|
+ const { startdate, enddate } = i;
|
|
|
+ const r = moment().isBetween(startdate, enddate, null, '[]');
|
|
|
+ if (r) {
|
|
|
+ const { _id, termid } = i;
|
|
|
+ let options = _.cloneDeep(this.options);
|
|
|
+ options.classid = _id;
|
|
|
+ options.termid = termid;
|
|
|
+ this.$set(this, `options`, options);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ sessionStorage.setItem('init', true);
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -217,6 +220,10 @@ export default {
|
|
|
pageTitle() {
|
|
|
return `${this.$route.meta.title}`;
|
|
|
},
|
|
|
+ needInit() {
|
|
|
+ let needInit = sessionStorage.getItem('init');
|
|
|
+ return !needInit;
|
|
|
+ },
|
|
|
},
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|