lrf402788946 4 jaren geleden
bovenliggende
commit
98fa6b0908
3 gewijzigde bestanden met toevoegingen van 58 en 8 verwijderingen
  1. 2 0
      src/store/index.js
  2. 26 8
      src/views/class/index.vue
  3. 30 0
      src/views/class/newClass/daily.vue

+ 2 - 0
src/store/index.js

@@ -27,6 +27,7 @@ import school from '@frame/store/school';
 import answerapply from '@frame/store/answerapply';
 import chatroom from '@frame/store/chatroom';
 import answerchat from '@frame/store/answerchat';
+import personalscore from '@frame/store/personalscore';
 import * as ustate from '@frame/store/user/state';
 import * as umutations from '@frame/store/user/mutations';
 Vue.use(Vuex);
@@ -64,5 +65,6 @@ export default new Vuex.Store({
     answerapply,
     chatroom,
     answerchat,
+    personalscore,
   },
 });

+ 26 - 8
src/views/class/index.vue

@@ -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 {

+ 30 - 0
src/views/class/newClass/daily.vue

@@ -0,0 +1,30 @@
+<template>
+  <div id="daily">
+    <van-cell title="单元格" value="内容" />
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'daily',
+  props: {},
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>