ソースを参照

平台添加管理员日志

gzb
wangzhonglu 7ヶ月前
コミット
a00d02a8c8

+ 10
- 0
src/router/platform.js ファイルの表示

@@ -103,6 +103,16 @@ export default {
103 103
         title: "平台管控-设备管理-设备密码"
104 104
       }
105 105
     },
106
+    {
107
+      path: "admin",
108
+      component: () => import("@/views/platformSection/log/admin.vue"),
109
+      name: "admin",
110
+      meta: {
111
+        keepAlive: true,
112
+        isAuth: true,
113
+        title: "平台管控-日志-管理员日志"
114
+      }
115
+    },
106 116
     {
107 117
       path: "logDeviceExport",
108 118
       component: () =>

+ 11
- 1
src/views/platformSection/index.vue ファイルの表示

@@ -84,6 +84,13 @@
84 84
           <span class="module_title">日志</span>
85 85
           <Icon class="arrow_dropdown" type="md-arrow-dropdown" :size="20" />
86 86
           <div class="drop_down_list" v-if="routeDropdown">
87
+            <router-link
88
+              @click.native="routeDropdownChange()"
89
+              tag="div"
90
+              to="/platform/admin"
91
+              class="drop_down_list_item"
92
+              >管理员日志</router-link
93
+            >
87 94
             <router-link
88 95
               @click.native="routeDropdownChange()"
89 96
               tag="div"
@@ -133,7 +140,10 @@ export default {
133 140
     },
134 141
     // 日志路由选中
135 142
     logSelected() {
136
-      return this.$route.path.includes("/platform/logDeviceExport");
143
+      return (
144
+        this.$route.path.includes("/platform/admin") ||
145
+        this.$route.path.includes("/platform/logDeviceExport")
146
+      );
137 147
     }
138 148
   },
139 149
   methods: {

+ 162
- 0
src/views/platformSection/log/admin.vue ファイルの表示

@@ -0,0 +1,162 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <DatePicker
6
+          v-model="searchForm.dataRange"
7
+          @on-change="searchList()"
8
+          :editable="false"
9
+          :transfer="true"
10
+          format="yyyy-MM-dd"
11
+          type="daterange"
12
+          placement="bottom-start"
13
+          placeholder="请选择日期段"
14
+          style="margin-right: 10px; width: 220px"
15
+        ></DatePicker>
16
+        <Input
17
+          v-model="searchForm.name"
18
+          placeholder="请输入登录名、事件"
19
+          search
20
+          @on-search="searchList()"
21
+          style="width: 180px"
22
+        />
23
+      </div>
24
+    </div>
25
+    <div class="table_wrap">
26
+      <Table :columns="columns" :data="searchForm.list"></Table>
27
+    </div>
28
+    <div class="page_wrap">
29
+      <Page
30
+        :transfer="true"
31
+        :total="searchForm.total"
32
+        :current="searchForm.page"
33
+        :page-size="searchForm.size"
34
+        :page-size-opts="[10, 20, 40, 60]"
35
+        @on-change="pageChange"
36
+        @on-page-size-change="pageSizeChange"
37
+        show-total
38
+        show-sizer
39
+      ></Page>
40
+    </div>
41
+  </div>
42
+</template>
43
+
44
+<script>
45
+import { dateFormat } from "@/utils";
46
+import { logOperate_list } from "@/api/log";
47
+export default {
48
+  data() {
49
+    return {
50
+      searchForm: {
51
+        dataRange: [],
52
+        name: "",
53
+        page: 1,
54
+        size: 10,
55
+        list: [],
56
+        total: 0
57
+      },
58
+      columns: [
59
+        {
60
+          title: "序号",
61
+          align: "center",
62
+          width: 70,
63
+          render: (h, params) => {
64
+            return h(
65
+              "span",
66
+              params.index +
67
+                (this.searchForm.page - 1) * this.searchForm.size +
68
+                1
69
+            );
70
+          }
71
+        },
72
+        {
73
+          title: "登录名",
74
+          minWidth: 100,
75
+          key: "loginname",
76
+          align: "center"
77
+        },
78
+        {
79
+          title: "姓名",
80
+          minWidth: 80,
81
+          key: "aname",
82
+          align: "center"
83
+        },
84
+        {
85
+          title: "事件",
86
+          minWidth: 150,
87
+          key: "content",
88
+          align: "center"
89
+        },
90
+        {
91
+          title: "时间",
92
+          key: "createtime",
93
+          width: 190,
94
+          align: "center"
95
+        }
96
+      ]
97
+    };
98
+  },
99
+  created() {
100
+    this.searchList();
101
+  },
102
+  computed: {
103
+    powerParams() {
104
+      return this.$store.getters.powerParams;
105
+    }
106
+  },
107
+  methods: {
108
+    // 搜索
109
+    searchList() {
110
+      this.searchForm.page = 1;
111
+      this.getList();
112
+    },
113
+    // 页码改变
114
+    pageChange(page) {
115
+      this.searchForm.page = page;
116
+      this.getList();
117
+    },
118
+    // 每页显示数量改变
119
+    pageSizeChange(size) {
120
+      this.searchForm.size = size;
121
+      this.searchForm.page = 1;
122
+      this.getList();
123
+    },
124
+    // 获取列表
125
+    getList() {
126
+      let _begindate = this.searchForm.dataRange[0];
127
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
128
+      let _enddate = this.searchForm.dataRange[1];
129
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
130
+      logOperate_list({
131
+        // rtype: this.powerParams.rtype,
132
+        page: this.searchForm.page,
133
+        size: this.searchForm.size,
134
+        begindate: _begindate,
135
+        enddate: _enddate,
136
+        name: this.searchForm.name
137
+      }).then((data) => {
138
+        if (data.code === 0) {
139
+          this.searchForm.list = data.obj.data;
140
+          this.searchForm.total = data.obj.total;
141
+        } else {
142
+          this.$Message.error(data.msg);
143
+        }
144
+      });
145
+    }
146
+  }
147
+};
148
+</script>
149
+
150
+<style lang="less" scoped>
151
+.search_header {
152
+  display: flex;
153
+  justify-content: space-between;
154
+  align-items: center;
155
+  margin: 16px 16px;
156
+  .search_left {
157
+    display: flex;
158
+    justify-content: flex-start;
159
+    align-items: center;
160
+  }
161
+}
162
+</style>

+ 1
- 2
src/views/regionSection/log/admin.vue ファイルの表示

@@ -145,8 +145,7 @@ export default {
145 145
           this.$Message.error(data.msg);
146 146
         }
147 147
       });
148
-    },
149
-    toExport() {}
148
+    }
150 149
   }
151 150
 };
152 151
 </script>

+ 1
- 2
src/views/schoolSection/log/admin.vue ファイルの表示

@@ -147,8 +147,7 @@ export default {
147 147
           this.$Message.error(data.msg);
148 148
         }
149 149
       });
150
-    },
151
-    toExport() {}
150
+    }
152 151
   }
153 152
 };
154 153
 </script>

読み込み中…
キャンセル
保存