|
@@ -3,15 +3,11 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="style">
|
|
|
<el-col :span="24" class="top">
|
|
|
- <!-- <topInfo></topInfo> -->
|
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <!-- <el-col :span="24" class="leaveBtn" v-if="this.user.job == '学委' || this.user.type == '3'">
|
|
|
- <van-button round type="info" icon="smile" @click="onClickRight()">添加分数</van-button>
|
|
|
- </el-col> -->
|
|
|
<el-col :span="24" class="leaveList">
|
|
|
- <pingfenList :groupList="groupList" :leaveList="leaveList" :stuList="groupList"></pingfenList>
|
|
|
+ <pingfenList :groupList="groupList" :classScore="classScore"></pingfenList>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -26,7 +22,7 @@ import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
const { mapActions: group } = createNamespacedHelpers('group');
|
|
|
const { mapActions: mapclass } = createNamespacedHelpers('classes');
|
|
|
-
|
|
|
+import _ from 'lodash';
|
|
|
export default {
|
|
|
metaInfo: { title: '评分列表' },
|
|
|
name: 'leave',
|
|
@@ -36,13 +32,13 @@ export default {
|
|
|
pingfenList, //请假列表
|
|
|
},
|
|
|
data: () => ({
|
|
|
- groupList: [],
|
|
|
- leaveList: [],
|
|
|
- stuList: [],
|
|
|
title: '',
|
|
|
isleftarrow: '',
|
|
|
- transitionName: 'fade',
|
|
|
navShow: true,
|
|
|
+ // 总分
|
|
|
+ classScore: 0,
|
|
|
+ // 组分
|
|
|
+ groupList: [],
|
|
|
}),
|
|
|
created() {
|
|
|
this.searchInfo();
|
|
@@ -68,39 +64,26 @@ export default {
|
|
|
...group({ groupinfo: 'query', groupfetch: 'fetch' }),
|
|
|
...mapclass({ mapclass: 'query', classfetch: 'fetch' }),
|
|
|
async searchInfo() {
|
|
|
- console.log('a');
|
|
|
+ // 总分
|
|
|
let classid = this.user.classid;
|
|
|
- const acc = await this.query({ classid });
|
|
|
- console.log(acc);
|
|
|
- var res = acc.data.filter(item => item.classid === classid);
|
|
|
- console.log(res.data);
|
|
|
-
|
|
|
- let selfscore = res.map(i => i.selfscore);
|
|
|
- let nes = selfscore.filter(d => d);
|
|
|
- console.log(nes);
|
|
|
- let num = eval(nes.join('+'));
|
|
|
- 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.filter(item => item.id === acc.stuid);
|
|
|
- for (const aaa of ref) {
|
|
|
- acc.stores = aaa.selfscore;
|
|
|
- }
|
|
|
- let asd = val.students.map(i => i.stores);
|
|
|
- let nes = asd.filter(d => d);
|
|
|
- let snewcore = eval(nes.join('+'));
|
|
|
- val.score = snewcore;
|
|
|
- }
|
|
|
- }
|
|
|
- this.$set(this, `groupList`, resq.data);
|
|
|
- },
|
|
|
-
|
|
|
- // 跳转到请假
|
|
|
- onClickRight() {
|
|
|
- this.$router.push({ path: '/user/socre', query: { classid: this.id } });
|
|
|
+ const res = await this.query({ classid });
|
|
|
+ let classScore = res.data.map(i => i.score * 1).reduce((pre, n) => pre + n);
|
|
|
+ this.$set(this, `classScore`, classScore);
|
|
|
+ // 群组分
|
|
|
+ const group = await this.groupinfo({ classid });
|
|
|
+ // for (const val of group.data) {
|
|
|
+ // for (const acc of val.students) {
|
|
|
+ // 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);
|
|
|
+ // let nes = asd.filter(d => d);
|
|
|
+ // let snewcore = eval(nes.join('+'));
|
|
|
+ // val.score = snewcore;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ this.$set(this, `groupList`, group.data);
|
|
|
},
|
|
|
},
|
|
|
};
|