|
@@ -49,6 +49,9 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
|
+ id() {
|
|
|
+ return this.$route.query.id;
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.title = this.$route.meta.title;
|
|
@@ -65,41 +68,36 @@ export default {
|
|
|
...group({ groupinfo: 'query', groupfetch: 'fetch' }),
|
|
|
...mapclass({ mapclass: 'query', classfetch: 'fetch' }),
|
|
|
async searchInfo() {
|
|
|
- const leaveList = await this.fetch(this.user.userid);
|
|
|
- let classid = this.user.classid;
|
|
|
- const res = await this.query({ classid });
|
|
|
- let selfscore = res.data.map(i => i.selfscore);
|
|
|
+ let classid = this.id;
|
|
|
+ const acc = await this.query({ classid });
|
|
|
+ console.log(res);
|
|
|
+ var res = acc.data.filter(item => item.classid === classid);
|
|
|
+ let selfscore = res.map(i => i.selfscore);
|
|
|
let nes = selfscore.filter(d => d);
|
|
|
+ console.log(nes);
|
|
|
let num = eval(nes.join('+'));
|
|
|
- leaveList.data.num = num;
|
|
|
- console.log(leaveList.data);
|
|
|
- this.$set(this, `leaveList`, leaveList.data);
|
|
|
- const resq = await this.groupinfo();
|
|
|
-
|
|
|
+ console.log(num);
|
|
|
+ this.leaveList.num = num;
|
|
|
+ this.$set(this, `leaveList`, this.leaveList);
|
|
|
+ const resq = await this.groupinfo({ classid });
|
|
|
for (const val of resq.data) {
|
|
|
for (const acc of val.students) {
|
|
|
- var ref = res.data.filter(item => item.id === acc.stuid);
|
|
|
+ var ref = res.filter(item => item.id === acc.stuid);
|
|
|
for (const aaa of ref) {
|
|
|
acc.stores = aaa.selfscore;
|
|
|
}
|
|
|
-
|
|
|
let asd = val.students.map(i => i.stores);
|
|
|
- console.log(asd);
|
|
|
let nes = asd.filter(d => d);
|
|
|
let snewcore = eval(nes.join('+'));
|
|
|
-
|
|
|
val.score = snewcore;
|
|
|
}
|
|
|
}
|
|
|
- console.log(resq.data);
|
|
|
-
|
|
|
this.$set(this, `groupList`, resq.data);
|
|
|
},
|
|
|
-
|
|
|
async clickShow(acc) {},
|
|
|
// 跳转到请假
|
|
|
onClickRight() {
|
|
|
- this.$router.push({ path: '/user/socre' });
|
|
|
+ this.$router.push({ path: '/user/socre', query: { classid: this.id } });
|
|
|
},
|
|
|
},
|
|
|
};
|