|
@@ -6,11 +6,8 @@
|
|
|
<NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <el-tabs v-model="activeName">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="tabchange">
|
|
|
<el-tab-pane label="班级名单" name="first">
|
|
|
- <el-col :span="24" style="text-align:center;padding:15px 0;">
|
|
|
- <el-button type="primary" size="mini">查看平时成绩</el-button>
|
|
|
- </el-col>
|
|
|
<el-col :span="24">
|
|
|
<name-list :data="studentList" @updateStu="toUpdateStu"></name-list>
|
|
|
</el-col>
|
|
@@ -18,6 +15,10 @@
|
|
|
<el-tab-pane label="班级分组" name="second">
|
|
|
<classGroup :groupList="groupList" :stuIdAndGroupId="stuIdAndGroupId"></classGroup>
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane label="平时成绩" name="third">
|
|
|
+ <daily :data="studentList"></daily>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="作业成绩" name="forth"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="foot">
|
|
@@ -34,9 +35,11 @@ import footInfo from '@/layout/common/footInfo.vue';
|
|
|
// 班级分组
|
|
|
import classGroup from './newClass/classGroup.vue';
|
|
|
import nameList from './newClass/nameList.vue';
|
|
|
+import daily from './newClass/daily.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: group } = createNamespacedHelpers('group');
|
|
|
const { mapActions: student } = createNamespacedHelpers('student');
|
|
|
+const { mapActions: pscore } = createNamespacedHelpers('personalscore');
|
|
|
export default {
|
|
|
metaInfo: { title: '班级名单' },
|
|
|
name: 'index',
|
|
@@ -48,6 +51,8 @@ export default {
|
|
|
classGroup,
|
|
|
//班级名单
|
|
|
nameList,
|
|
|
+ // 日常分
|
|
|
+ daily,
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
|
@@ -62,6 +67,8 @@ export default {
|
|
|
stuIdAndGroupId: {},
|
|
|
//学生列表
|
|
|
studentList: [],
|
|
|
+ // 平时分列表
|
|
|
+ pscoreList: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -70,19 +77,20 @@ export default {
|
|
|
await this.findGroup();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...pscore({ getPScoreList: 'query' }),
|
|
|
...student({ getStudentList: 'query', updateStudent: 'update' }),
|
|
|
...group({ groupQuery: 'query' }),
|
|
|
- // 查学生
|
|
|
+ // first 查学生
|
|
|
async toGetStudentList() {
|
|
|
const res = await this.getStudentList({ classid: this.user.classid });
|
|
|
if (res) this.$set(this, `studentList`, res.data);
|
|
|
},
|
|
|
- // 修改学生职位
|
|
|
+ // first 修改学生职位
|
|
|
async toUpdateStu(data) {
|
|
|
const res = await this.updateStudent(data);
|
|
|
if (this.$checkRes(res, '修改成功', res.errmsg || '修改失败')) this.toGetStudentList();
|
|
|
},
|
|
|
- // 查询小组
|
|
|
+ // second 查询小组
|
|
|
async findGroup() {
|
|
|
let stuid = this.user.userid;
|
|
|
let classid = this.user.classid;
|
|
@@ -114,6 +122,16 @@ export default {
|
|
|
this.$set(this, 'stuIdAndGroupId', stuIdAndGroupId);
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ //third 获取该班平时分
|
|
|
+ async toGetPScoreList() {
|
|
|
+ const res = await this.getPScoreList({ classid: this.user.classid });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `pscoreList`, res.data);
|
|
|
+ },
|
|
|
+ tabchange(tab) {
|
|
|
+ const { name } = tab;
|
|
|
+ if (name === 'third') this.toGetPScoreList();
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -153,7 +171,7 @@ export default {
|
|
|
}
|
|
|
/deep/.el-tabs__item {
|
|
|
padding: 0;
|
|
|
- width: 50%;
|
|
|
+ width: 25%;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.foot {
|