Просмотр исходного кода

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-dirtea

guhongwei 5 лет назад
Родитель
Сommit
31adcfa0c7
3 измененных файлов с 73 добавлено и 0 удалено
  1. 6 0
      src/router/index.js
  2. 1 0
      src/views/home/classmenu.vue
  3. 66 0
      src/views/user/attendance.vue

+ 6 - 0
src/router/index.js

@@ -93,6 +93,12 @@ const routes = [
     meta: { title: '学生评分', isleftarrow: true },
     component: () => import('../views/user/score.vue'),
   },
+  {
+    path: '/user/attendance',
+    name: 'user_attendance',
+    meta: { title: '考勤管理', isleftarrow: true },
+    component: () => import('../views/user/attendance.vue'),
+  },
 ];
 
 const router = new VueRouter({

+ 1 - 0
src/views/home/classmenu.vue

@@ -56,6 +56,7 @@ export default {
       if (name === '班级名单') this.$router.push({ path: '/class/classStuList', query: { id: this.classid } });
       if (name === '班级成绩') this.$router.push({ path: '/class/achieve', query: { classid: this.classid } });
       if (name === '请假管理') this.$router.push({ path: '/user/teaLeave' });
+      if (name === '考勤管理') this.$router.push({ path: '/user/attendance' });
       if (name === '学生评分') this.$router.push({ path: '/user/score' });
     },
   },

+ 66 - 0
src/views/user/attendance.vue

@@ -0,0 +1,66 @@
+<template>
+  <div id="attendance">
+    <van-row>
+      <van-col :span="24" class="style">
+        <van-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: attendance } = createNamespacedHelpers('attendance');
+const { mapActions: student } = createNamespacedHelpers('student');
+export default {
+  name: 'attendance',
+  props: {},
+  components: {
+    NavBar, //头部导航
+  },
+  data: () => ({
+    title: '',
+    isleftarrow: '',
+    navShow: true,
+  }),
+  created() {
+    this.search();
+  },
+  computed: {
+    ...mapState(['user', 'classid']),
+  },
+  methods: {
+    ...attendance(['query']),
+    async search() {
+      const attendList = await this.query({ classid: this.classid });
+      console.log(attendList);
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {
+    $route(to, from) {
+      this.title = to.meta.title;
+      this.isleftarrow = to.meta.isleftarrow;
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+</style>