|
@@ -26,7 +26,7 @@
|
|
></classGroup>
|
|
></classGroup>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="平时成绩" name="third">
|
|
<el-tab-pane label="平时成绩" name="third">
|
|
- <daily :data="studentList"></daily>
|
|
|
|
|
|
+ <daily :data="studentList" :scoreList="pscoreList" :classInfo="classInfo" :lesson="lesson" @save="dailyUpdate"></daily>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="作业成绩" name="forth">
|
|
<el-tab-pane label="作业成绩" name="forth">
|
|
<homework
|
|
<homework
|
|
@@ -59,6 +59,8 @@ import daily from './newClass/daily.vue';
|
|
import homework from './newClass/homework.vue';
|
|
import homework from './newClass/homework.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: group } = createNamespacedHelpers('group');
|
|
const { mapActions: group } = createNamespacedHelpers('group');
|
|
|
|
+const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
const { mapActions: student } = createNamespacedHelpers('student');
|
|
const { mapActions: student } = createNamespacedHelpers('student');
|
|
const { mapActions: pscore } = createNamespacedHelpers('personalscore');
|
|
const { mapActions: pscore } = createNamespacedHelpers('personalscore');
|
|
const { mapActions: uploadtask } = createNamespacedHelpers('uploadtask');
|
|
const { mapActions: uploadtask } = createNamespacedHelpers('uploadtask');
|
|
@@ -103,9 +105,14 @@ export default {
|
|
homeworkList: [],
|
|
homeworkList: [],
|
|
homeworkLessonList: [],
|
|
homeworkLessonList: [],
|
|
homeworkForm: {},
|
|
homeworkForm: {},
|
|
|
|
+ // 班级信息
|
|
|
|
+ classInfo: {},
|
|
|
|
+ // 课程信息
|
|
|
|
+ lesson: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
|
|
+ await this.getClass();
|
|
await this.toGetStudentList();
|
|
await this.toGetStudentList();
|
|
// 查看班级小组
|
|
// 查看班级小组
|
|
await this.findGroup();
|
|
await this.findGroup();
|
|
@@ -113,10 +120,28 @@ export default {
|
|
await this.searchHomework();
|
|
await this.searchHomework();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...pscore({ getPScoreList: 'query' }),
|
|
|
|
|
|
+ ...util({ modelFetch: 'fetch' }),
|
|
|
|
+ ...classes({ getClassInfo: 'fetch' }),
|
|
|
|
+ ...pscore({ getPScoreList: 'query', pscoreOpera: 'opera' }),
|
|
...group({ groupQuery: 'query', groupDelete: 'delete', groupCreate: 'create', groupUpdate: 'update', groupInsert: 'insert', groupExit: 'exit' }),
|
|
...group({ groupQuery: 'query', groupDelete: 'delete', groupCreate: 'create', groupUpdate: 'update', groupInsert: 'insert', groupExit: 'exit' }),
|
|
...student({ getStudentList: 'query', updateStudent: 'update' }),
|
|
...student({ getStudentList: 'query', updateStudent: 'update' }),
|
|
...uploadtask({ uploadtasklist: 'query', uploadtaskUpdate: 'update' }),
|
|
...uploadtask({ uploadtasklist: 'query', uploadtaskUpdate: 'update' }),
|
|
|
|
+ async getClass() {
|
|
|
|
+ const res = await this.getClassInfo(this.user.classid);
|
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `classInfo`, res.data);
|
|
|
|
+ const lres = await this.modelFetch({ model: 'lesson', classid: this.user.classid });
|
|
|
|
+ if (this.$checkRes(lres)) {
|
|
|
|
+ let { lessons } = lres.data;
|
|
|
|
+ if (lessons) {
|
|
|
|
+ lessons = _.uniqBy(
|
|
|
|
+ lessons.filter(f => f.subid),
|
|
|
|
+ 'subid'
|
|
|
|
+ );
|
|
|
|
+ console.log(lessons);
|
|
|
|
+ this.$set(this, `lesson`, lessons);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// first 查学生
|
|
// first 查学生
|
|
async toGetStudentList() {
|
|
async toGetStudentList() {
|
|
const res = await this.getStudentList({ classid: this.user.classid });
|
|
const res = await this.getStudentList({ classid: this.user.classid });
|
|
@@ -229,6 +254,11 @@ export default {
|
|
const res = await this.getPScoreList({ classid: this.user.classid });
|
|
const res = await this.getPScoreList({ classid: this.user.classid });
|
|
if (this.$checkRes(res)) this.$set(this, `pscoreList`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `pscoreList`, res.data);
|
|
},
|
|
},
|
|
|
|
+ // third 平时分保存(添加/修改)
|
|
|
|
+ async dailyUpdate(data) {
|
|
|
|
+ const res = await this.pscoreOpera(data);
|
|
|
|
+ if (this.$checkRes(res, '修改成功', res.errmsg || '修改失败')) this.toGetPScoreList();
|
|
|
|
+ },
|
|
tabchange(tab) {
|
|
tabchange(tab) {
|
|
const { name } = tab;
|
|
const { name } = tab;
|
|
if (name === 'third') this.toGetPScoreList();
|
|
if (name === 'third') this.toGetPScoreList();
|