|
@@ -17,15 +17,23 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <leagueData :lessonList="lessonList" :list="list"></leagueData>
|
|
|
|
|
|
+ <leagueData
|
|
|
|
+ :lessonList="lessonList"
|
|
|
|
+ :groupList="groupList"
|
|
|
|
+ :list="list"
|
|
|
|
+ :getPScore="getPScore"
|
|
|
|
+ :homeworkList="homeworkList"
|
|
|
|
+ :groupscoreList="groupscoreList"
|
|
|
|
+ ></leagueData>
|
|
</el-col>
|
|
</el-col>
|
|
</list-frame>
|
|
</list-frame>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+var moment = require('moment');
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
-import leagueData from './leagueData.vue';
|
|
|
|
|
|
+import leagueData from '@frame/layout/leagueData.vue';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: trainplan } = createNamespacedHelpers('trainplan');
|
|
const { mapActions: trainplan } = createNamespacedHelpers('trainplan');
|
|
@@ -34,6 +42,8 @@ const { mapActions: student } = createNamespacedHelpers('student');
|
|
const { mapActions: lesson } = createNamespacedHelpers('lesson');
|
|
const { mapActions: lesson } = createNamespacedHelpers('lesson');
|
|
const { mapActions: group } = createNamespacedHelpers('group');
|
|
const { mapActions: group } = createNamespacedHelpers('group');
|
|
const { mapActions: uploadtask } = createNamespacedHelpers('uploadtask');
|
|
const { mapActions: uploadtask } = createNamespacedHelpers('uploadtask');
|
|
|
|
+const { mapActions: pscore } = createNamespacedHelpers('personalscore');
|
|
|
|
+const { mapActions: groupscore } = createNamespacedHelpers('groupscore');
|
|
const { mapActions: util } = createNamespacedHelpers('util');
|
|
const { mapActions: util } = createNamespacedHelpers('util');
|
|
export default {
|
|
export default {
|
|
metaInfo: { title: '积分榜' },
|
|
metaInfo: { title: '积分榜' },
|
|
@@ -53,78 +63,17 @@ export default {
|
|
// 期
|
|
// 期
|
|
termList: [],
|
|
termList: [],
|
|
// 课表
|
|
// 课表
|
|
- lessonList: [
|
|
|
|
- {
|
|
|
|
- id: '1',
|
|
|
|
- name: '测试1',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '2',
|
|
|
|
- name: '测试2',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '3',
|
|
|
|
- name: '测试3',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '4',
|
|
|
|
- name: '测试4',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ lessonList: [],
|
|
|
|
+ // 组列表
|
|
|
|
+ groupList: [],
|
|
// 学生名单
|
|
// 学生名单
|
|
- list: [
|
|
|
|
- {
|
|
|
|
- group: '1',
|
|
|
|
- index: '1',
|
|
|
|
- name: '测试1',
|
|
|
|
- team: '10',
|
|
|
|
- person: '10',
|
|
|
|
- homework: '10',
|
|
|
|
- team1: '10',
|
|
|
|
- person1: '10',
|
|
|
|
- homework1: '10',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- group: '1',
|
|
|
|
- index: '2',
|
|
|
|
- name: '测试2',
|
|
|
|
- team: '10',
|
|
|
|
- person: '10',
|
|
|
|
- homework: '10',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- group: '1',
|
|
|
|
- index: '3',
|
|
|
|
- name: '测试3',
|
|
|
|
- team: '10',
|
|
|
|
- person: '10',
|
|
|
|
- homework: '10',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- group: '2',
|
|
|
|
- index: '1',
|
|
|
|
- name: '测试4',
|
|
|
|
- team: '10',
|
|
|
|
- person: '10',
|
|
|
|
- homework: '10',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- group: '2',
|
|
|
|
- index: '2',
|
|
|
|
- name: '测试5',
|
|
|
|
- team: '10',
|
|
|
|
- person: '10',
|
|
|
|
- homework: '10',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- group: '2',
|
|
|
|
- index: '3',
|
|
|
|
- name: '测试6',
|
|
|
|
- team: '10',
|
|
|
|
- person: '10',
|
|
|
|
- homework: '10',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ list: [],
|
|
|
|
+ // 平时成绩
|
|
|
|
+ getPScore: [],
|
|
|
|
+ // 作业成绩
|
|
|
|
+ homeworkList: [],
|
|
|
|
+ // 团队分
|
|
|
|
+ groupscoreList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -138,35 +87,45 @@ export default {
|
|
...lesson({ lessonQuery: 'query', lessonFetch: 'fetch' }),
|
|
...lesson({ lessonQuery: 'query', lessonFetch: 'fetch' }),
|
|
...group({ groupQuery: 'query' }),
|
|
...group({ groupQuery: 'query' }),
|
|
...uploadtask({ uploadtaskQuery: 'query' }),
|
|
...uploadtask({ uploadtaskQuery: 'query' }),
|
|
|
|
+ ...pscore({ getPScoreList: 'query', pscoreOpera: 'opera' }),
|
|
|
|
+ ...groupscore({ groupscoreQuery: 'query' }),
|
|
...util({ modelFetch: 'fetch' }),
|
|
...util({ modelFetch: 'fetch' }),
|
|
async search() {
|
|
async search() {
|
|
- console.log(this.form);
|
|
|
|
// 查询课表
|
|
// 查询课表
|
|
let classid = this.form.classid;
|
|
let classid = this.form.classid;
|
|
let res = await this.modelFetch({ model: 'lesson', classid });
|
|
let res = await this.modelFetch({ model: 'lesson', classid });
|
|
- let lesson = _.uniqBy(
|
|
|
|
- res.data.lessons.filter(item => item.subid != null),
|
|
|
|
- 'subid'
|
|
|
|
- );
|
|
|
|
- this.$set(this, `lessonList`, lesson);
|
|
|
|
- // 查询学生
|
|
|
|
|
|
+ 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 });
|
|
res = await this.groupQuery({ classid });
|
|
|
|
+ this.$set(this, `groupList`, res.data);
|
|
for (const val of res.data) {
|
|
for (const val of res.data) {
|
|
for (const student of val.students) {
|
|
for (const student of val.students) {
|
|
- // 组成绩
|
|
|
|
- student.groupScore = val.score;
|
|
|
|
- let studentInfo = await this.studentFetch(student.stuid);
|
|
|
|
- // 平时成绩
|
|
|
|
- student.selfscore = studentInfo.data.selfscore;
|
|
|
|
|
|
+ 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);
|
|
// 作业成绩
|
|
// 作业成绩
|
|
- let homeWork = await this.uploadtaskQuery({ classid });
|
|
|
|
- console.log(homeWork.data);
|
|
|
|
- // console.log(res.data);
|
|
|
|
- // let student = res.data.map(item => item.students);
|
|
|
|
- // student = _.flattenDeep(student);
|
|
|
|
- // console.log(student);
|
|
|
|
|
|
+ res = await this.uploadtaskQuery({ classid });
|
|
|
|
+ this.$set(this, `homeworkList`, res.data);
|
|
|
|
+ // 团队分
|
|
|
|
+ res = await this.groupscoreQuery({ classid });
|
|
|
|
+ this.$set(this, `groupscoreList`, res.data);
|
|
},
|
|
},
|
|
// 期
|
|
// 期
|
|
async getPlan() {
|
|
async getPlan() {
|
|
@@ -183,6 +142,11 @@ export default {
|
|
const res = await this.classesquery({ termid });
|
|
const res = await this.classesquery({ termid });
|
|
this.$set(this, `classList`, res.data);
|
|
this.$set(this, `classList`, res.data);
|
|
},
|
|
},
|
|
|
|
+ // getX(data) {
|
|
|
|
+ // let r = _.uniqBy(data, 'date').map(i => ({ date: i.date, subname: i.subname, subid: i.subid }));
|
|
|
|
+ // r = r.sort((a, b) => moment(a).format('X') - moment(b).format('X'));
|
|
|
|
+ // return r;
|
|
|
|
+ // },
|
|
},
|
|
},
|
|
|
|
|
|
watch: {
|
|
watch: {
|