|
@@ -0,0 +1,111 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <list-frame :title="pageTitle" :needFilter="false" :needAdd="false">
|
|
|
+ <leagueData
|
|
|
+ :lessonList="lessonList"
|
|
|
+ :groupList="groupList"
|
|
|
+ :list="list"
|
|
|
+ :getPScore="getPScore"
|
|
|
+ :homeworkList="homeworkList"
|
|
|
+ :groupscoreList="groupscoreList"
|
|
|
+ ></leagueData>
|
|
|
+ </list-frame>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+var moment = require('moment');
|
|
|
+import _ from 'lodash';
|
|
|
+import leagueData from '@frame/layout/leagueData.vue';
|
|
|
+import listFrame from '@frame/layout/admin/detail-frame';
|
|
|
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
+const { mapActions: lesson } = createNamespacedHelpers('lesson');
|
|
|
+const { mapActions: group } = createNamespacedHelpers('group');
|
|
|
+const { mapActions: uploadtask } = createNamespacedHelpers('uploadtask');
|
|
|
+const { mapActions: pscore } = createNamespacedHelpers('personalscore');
|
|
|
+const { mapActions: groupscore } = createNamespacedHelpers('groupscore');
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ listFrame,
|
|
|
+ leagueData,
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ // 课表
|
|
|
+ lessonList: [],
|
|
|
+ // 组列表
|
|
|
+ groupList: [],
|
|
|
+ // 学生名单
|
|
|
+ list: [],
|
|
|
+ // 平时成绩
|
|
|
+ getPScore: [],
|
|
|
+ // 作业成绩
|
|
|
+ homeworkList: [],
|
|
|
+ // 团队分
|
|
|
+ groupscoreList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...lesson({ lessonQuery: 'query', lessonFetch: 'fetch' }),
|
|
|
+ ...group({ groupQuery: 'query' }),
|
|
|
+ ...uploadtask({ uploadtaskQuery: 'query' }),
|
|
|
+ ...pscore({ getPScoreList: 'query', pscoreOpera: 'opera' }),
|
|
|
+ ...groupscore({ groupscoreQuery: 'query' }),
|
|
|
+ ...util({ modelFetch: 'fetch' }),
|
|
|
+ async search() {
|
|
|
+ // 查询课表
|
|
|
+ let classid = this.id;
|
|
|
+ let res = await this.modelFetch({ model: 'lesson', classid });
|
|
|
+ let r = res.data.lessons.filter(f => f.subid);
|
|
|
+ r = r.map(r => {
|
|
|
+ let time = r.time.split('-');
|
|
|
+ r.start = `${r.date} ${time[0]}`;
|
|
|
+ return r;
|
|
|
+ });
|
|
|
+ r = Object.values(_.groupBy(r, 'subid'));
|
|
|
+ r = r.map(a => {
|
|
|
+ let na = _.orderBy(a, ['start'], ['asc']);
|
|
|
+ return _.head(na);
|
|
|
+ });
|
|
|
+ this.$set(this, `lessonList`, r);
|
|
|
+ res = await this.groupQuery({ classid });
|
|
|
+ this.$set(this, `groupList`, res.data);
|
|
|
+ for (const val of res.data) {
|
|
|
+ for (const student of val.students) {
|
|
|
+ student.groupname = val.name;
|
|
|
+ student.groupid = val.id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let arr = res.data.map(item => item.students);
|
|
|
+ arr = _.flattenDeep(arr);
|
|
|
+ this.$set(this, `list`, arr);
|
|
|
+ // 平时成绩
|
|
|
+ res = await this.getPScoreList({ classid: classid });
|
|
|
+ this.$set(this, `getPScore`, res.data);
|
|
|
+ // 作业成绩
|
|
|
+ res = await this.uploadtaskQuery({ classid });
|
|
|
+ this.$set(this, `homeworkList`, res.data);
|
|
|
+ // 团队分
|
|
|
+ res = await this.groupscoreQuery({ classid });
|
|
|
+ this.$set(this, `groupscoreList`, res.data);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user', 'defaultOption']),
|
|
|
+ pageTitle() {
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
+ },
|
|
|
+ id() {
|
|
|
+ return this.defaultOption.classid;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|