Sfoglia il codice sorgente

更新个人信息完成

guhongwei 5 anni fa
parent
commit
102a228419

+ 11 - 3
src/layout/index/footInfo.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="footInfo">
     <el-row>
-      <el-col :span="24">
+      <!-- <el-col :span="24">
         <el-col :span="6" class="link">
           <el-link :underline="false" @click="$router.push({ path: '/' })">
             <i class="el-icon-s-home"></i>
@@ -26,7 +26,13 @@
             <p>个人信息</p>
           </el-link>
         </el-col>
-      </el-col>
+      </el-col> -->
+      <van-tabbar v-model="active">
+        <van-tabbar-item to="/" icon="home-o">首页</van-tabbar-item>
+        <van-tabbar-item to="/class/index" icon="friends-o">班级名单</van-tabbar-item>
+        <van-tabbar-item to="/question/index" icon="question-o">问卷调查</van-tabbar-item>
+        <van-tabbar-item to="/user/index" icon="user-o">个人信息</van-tabbar-item>
+      </van-tabbar>
     </el-row>
   </div>
 </template>
@@ -36,7 +42,9 @@ export default {
   name: 'footInfo',
   props: {},
   components: {},
-  data: () => ({}),
+  data: () => ({
+    active: 0,
+  }),
   created() {},
   computed: {},
   methods: {},

+ 38 - 0
src/store/attendance.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  checkInfo: `/api/train/attendance`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.checkInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.checkInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.checkInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.checkInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.checkInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 2 - 1
src/store/index.js

@@ -1,12 +1,13 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
 import leave from './leave';
-
+import attendance from './attendance';
 Vue.use(Vuex);
 
 export default new Vuex.Store({
   modules: {
     leave,
+    attendance,
   },
   state: {},
   mutations: {},

+ 13 - 2
src/views/user/checkWork.vue

@@ -12,6 +12,8 @@
 
 <script>
 import checkList from '@/layout/user/checkList.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapCheck } = createNamespacedHelpers('attendance');
 export default {
   name: 'checkWork',
   props: {},
@@ -30,9 +32,18 @@ export default {
       ],
     },
   }),
-  created() {},
+  created() {
+    this.searchInfo();
+  },
   computed: {},
-  methods: {},
+  methods: {
+    ...mapCheck(['query']),
+    async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      console.log(res.data);
+      // this.$set(this, `leaveList`, res.data);
+    },
+  },
 };
 </script>