lrf402788946 4 年之前
父节点
当前提交
17e23e75b8
共有 3 个文件被更改,包括 63 次插入0 次删除
  1. 6 0
      src/router/index.js
  2. 2 0
      src/store/index.js
  3. 55 0
      src/views/logs/index.vue

+ 6 - 0
src/router/index.js

@@ -593,6 +593,12 @@ const routes = [
         meta: { title: '待办事项' },
         component: () => import('@/views/mission/index.vue'),
       },
+      {
+        path: '/logs',
+        name: 'logs',
+        meta: { title: '操作记录' },
+        component: () => import('@/views/logs/index.vue'),
+      },
     ],
   },
   {

+ 2 - 0
src/store/index.js

@@ -45,6 +45,7 @@ import cerconfirm from '@frame/store/cerconfirm';
 import experience from '@frame/store/experience';
 import talented from '@frame/store/talented';
 import mission from '@frame/store/mission';
+import logs from '@frame/store/logs';
 import menu from '@frame/store/auth/menu';
 import role from '@frame/store/auth/role';
 import user from '@frame/store/auth/user';
@@ -110,6 +111,7 @@ export default new Vuex.Store({
     role,
     user,
     userMenu,
+    logs,
   },
   state: { ...ustate, ...dostate },
   mutations: { ...umutations, ...domutations },

+ 55 - 0
src/views/logs/index.vue

@@ -0,0 +1,55 @@
+<template>
+  <div id="index">
+    <detail-frame :title="pageTitle">
+      <data-table :fields="fields" :data="list" :opera="[]" :total="total" @query="search"> </data-table>
+    </detail-frame>
+  </div>
+</template>
+
+<script>
+import detailFrame from '@frame/layout/admin/detail-frame';
+import dataTable from '@frame/components/filter-page-table.vue';
+import { mapState, createNamespacedHelpers, mapActions } from 'vuex';
+const { mapActions: logs } = createNamespacedHelpers('logs');
+export default {
+  name: 'index',
+  props: {},
+  components: { detailFrame, dataTable },
+  data: function() {
+    return {
+      list: [],
+      total: 0,
+      fields: [
+        { label: 'ip', prop: 'ip' },
+        { label: '操作人', prop: 'name' },
+        { label: '操作', prop: 'opera' },
+        { label: '时间', prop: 'time' },
+      ],
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...logs(['query']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>