Browse Source

学校-日志

gzb
wangzhonglu 10 months ago
parent
commit
bf8d5e98ca

+ 64
- 0
src/api/log.js View File

@@ -0,0 +1,64 @@
1
+import { setRequest } from "@/utils/httpRequest";
2
+
3
+/**
4
+ * 7.1.1 管理员日志-列表
5
+ */
6
+export const logOperate_list = (data) => setRequest("logOperate/list", data);
7
+/**
8
+ * 7.1.2 管理员日志-添加
9
+ */
10
+export const logOperate_add = (data) => setRequest("logOperate/add", data);
11
+/**
12
+ * 7.2.1 设备推送日志-列表
13
+ */
14
+export const logPush_list = (data) => setRequest("logPush/list", data);
15
+/**
16
+ * 7.2.2 设备推送日志-添加
17
+ */
18
+export const logPush_add = (data) => setRequest("logPush/add", data);
19
+/**
20
+ * 7.3.1 设备位置日志-列表
21
+ */
22
+export const logDeviceLogin_list = (data) =>
23
+  setRequest("logDeviceLogin/list", data);
24
+/**
25
+ * 7.4.1 设备事件日志-列表
26
+ */
27
+export const logdoperate_list_event = (data) =>
28
+  setRequest("logdoperate/list_event", data);
29
+/**
30
+ * 7.4.2 设备事件日志-添加
31
+ */
32
+export const logdoperate_add = (data) => setRequest("logdoperate/add", data);
33
+/**
34
+ * 7.5.1 设备违规日志-列表
35
+ */
36
+export const logdoperate_list_violate = (data) =>
37
+  setRequest("logdoperate/list_violate", data);
38
+/**
39
+ * 7.6.1 应用下载日志-列表
40
+ */
41
+export const logAppDown_list = (data) => setRequest("logAppDown/list", data);
42
+/**
43
+ * 7.6.2 应用下载日志-添加
44
+ */
45
+export const logAppDown_add = (data) => setRequest("logAppDown/add", data);
46
+/**
47
+ * 7.7.1 应用启动日志-列表
48
+ */
49
+export const logAppStart_list_start = (data) =>
50
+  setRequest("logAppStart/list_start", data);
51
+/**
52
+ * 7.7.2 应用启动日志-添加
53
+ */
54
+export const logAppStart_add = (data) => setRequest("logAppStart/add", data);
55
+/**
56
+ * 7.8.1 设备已安装应用-列表
57
+ */
58
+export const logAppStart_list_install = (data) =>
59
+  setRequest("logAppStart/list_install", data);
60
+/**
61
+ * 7.9.1 设备导出-列表
62
+ */
63
+export const logDeviceBind_list = (data) =>
64
+  setRequest("logDeviceBind/list", data);

+ 17
- 13
src/assets/less/common.less View File

@@ -56,7 +56,7 @@ body,
56 56
 }
57 57
 // iview表格全局自定义样式
58 58
 .ivu-table {
59
-  color: #798CB5;
59
+  color: #798cb5;
60 60
   background-color: #ffffff66;
61 61
   .ivu-table-header,
62 62
   .ivu-table-fixed-header {
@@ -64,7 +64,7 @@ body,
64 64
       background-color: #e9f0ff;
65 65
       th {
66 66
         padding: 12px 0;
67
-        color: #253A70;
67
+        color: #253a70;
68 68
         line-height: 1;
69 69
         background-color: #e9f0ff;
70 70
       }
@@ -74,15 +74,19 @@ body,
74 74
   .ivu-table-fixed-right .ivu-table-tbody tr,
75 75
   .ivu-table-body .ivu-table-tbody tr {
76 76
     &.ivu-table-row-hover {
77
-      color: #253A70;
77
+      color: #253a70;
78 78
       background-color: #ffffff;
79 79
       box-shadow: 6px 1px 9px 0 #0879cd24;
80 80
       td {
81 81
         background-color: #ffffff;
82 82
         .action_list {
83
-          color: #339DFF;
83
+          color: #339dff;
84
+          .action_error,
84 85
           .action_del {
85
-            color: #F0153F;
86
+            color: #f0153f;
87
+          }
88
+          .action_success {
89
+            color: #52c41a;
86 90
           }
87 91
         }
88 92
       }
@@ -138,7 +142,7 @@ body,
138 142
   .ivu-table-cell {
139 143
     line-height: 1.6;
140 144
   }
141
-  .ivu-table-overflowX{
145
+  .ivu-table-overflowX {
142 146
     overflow: visible;
143 147
   }
144 148
   .ivu-table-tip {
@@ -325,10 +329,10 @@ fieldset[disabled] .ivu-input,
325 329
 .ivu-checkbox-disabled {
326 330
   &.ivu-checkbox-checked .ivu-checkbox-inner,
327 331
   .ivu-checkbox-inner {
328
-    background-color: #D2DBF3;
329
-    border-color: #98AAE1;
332
+    background-color: #d2dbf3;
333
+    border-color: #98aae1;
330 334
     &:after {
331
-      border-color: #253A70;
335
+      border-color: #253a70;
332 336
     }
333 337
   }
334 338
 }
@@ -351,17 +355,17 @@ fieldset[disabled] .ivu-input,
351 355
     0 3px 5px 0 #339dff80, inset 0 -2px 0 0 #2b89e0;
352 356
 }
353 357
 .ivu-modal-confirm-body {
354
-  color: #7C8DB5;
358
+  color: #7c8db5;
355 359
   font-size: 16px;
356 360
 }
357 361
 .ivu-btn.ivu-btn-default {
358
-  color: #7C8DB5;
362
+  color: #7c8db5;
359 363
   border: 1px solid #b8c2d9;
360 364
   border-radius: 8px;
361 365
 }
362 366
 .ivu-modal-confirm-footer .ivu-btn.ivu-btn-text {
363 367
   margin-right: 16px;
364
-  color: #7C8DB5;
368
+  color: #7c8db5;
365 369
   border: 1px solid #b8c2d9;
366 370
   border-radius: 8px;
367 371
 }
@@ -436,4 +440,4 @@ fieldset[disabled] .ivu-input,
436 440
   .ivu-form-item-content {
437 441
     font-size: 16px;
438 442
   }
439
-}
443
+}

+ 22
- 0
src/utils/index.js View File

@@ -690,3 +690,25 @@ export const dateRangeToSecond = ([beginDate, endDate]) => {
690 690
     endtime: _endtime
691 691
   };
692 692
 };
693
+export const doEventInfo = {
694
+  1: "更换SIM卡",
695
+  2: "违规开启蓝牙",
696
+  3: "USB连接电脑",
697
+  4: "USB拔出电脑",
698
+  5: "插入SD卡",
699
+  6: "拔出SD卡",
700
+  7: "账号登录",
701
+  8: "账号退出",
702
+  9: "安装应用",
703
+  10: "卸载应用",
704
+  11: "启动应用",
705
+  12: "首次使用"
706
+};
707
+export const pushTypeInfo = {
708
+  1: "发送消息",
709
+  2: "解除限制",
710
+  3: "限制使用",
711
+  4: "更新策略",
712
+  5: "重启设备",
713
+  6: "恢复出厂"
714
+};

+ 8
- 1
src/views/layout.vue View File

@@ -65,7 +65,14 @@ export default {
65 65
         // 更换手机号
66 66
       } else if (name === "4") {
67 67
         // 退出
68
-        this.toLoginOut();
68
+        this.$Modal.confirm({
69
+          title: "提示",
70
+          content: "确定退出吗?",
71
+          onOk: () => {
72
+            this.toLoginOut();
73
+          },
74
+          onCancel: () => {}
75
+        });
69 76
       }
70 77
     },
71 78
     // 退出

+ 7
- 7
src/views/platformSection/log/deviceExport.vue View File

@@ -3,7 +3,7 @@
3 3
     <div class="search_header">
4 4
       <div class="search_left">
5 5
         <Input
6
-          v-model="searchForm.aname"
6
+          v-model="searchForm.name"
7 7
           placeholder="请输入名称"
8 8
           search
9 9
           @on-search="searchList()"
@@ -40,7 +40,7 @@
40 40
 </template>
41 41
 
42 42
 <script>
43
-import { whiteLibrary_list } from "@/api/whiteLibrary";
43
+import { logDeviceBind_list } from "@/api/log";
44 44
 export default {
45 45
   data() {
46 46
     return {
@@ -67,22 +67,22 @@ export default {
67 67
         },
68 68
         {
69 69
           title: "区域名称",
70
-          key: "nameSlot",
70
+          key: "regionName",
71 71
           align: "center"
72 72
         },
73 73
         {
74 74
           title: "学校数",
75
-          key: "versionName",
75
+          key: "schoolnum",
76 76
           align: "center"
77 77
         },
78 78
         {
79 79
           title: "用户数",
80
-          key: "website",
80
+          key: "usernum",
81 81
           align: "center"
82 82
         },
83 83
         {
84 84
           title: "设备数",
85
-          key: "whiteAddressSlot",
85
+          key: "snnum",
86 86
           align: "center"
87 87
         },
88 88
         {
@@ -116,7 +116,7 @@ export default {
116 116
     },
117 117
     // 获取列表
118 118
     getList() {
119
-      whiteLibrary_list({
119
+      logDeviceBind_list({
120 120
         page: this.searchForm.page,
121 121
         size: this.searchForm.size,
122 122
         name: this.searchForm.name

+ 144
- 4
src/views/schoolSection/log/admin.vue View File

@@ -1,14 +1,154 @@
1 1
 <template>
2
-  <div class="main_root">管理员日志</div>
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>
3 42
 </template>
4 43
 
5 44
 <script>
45
+import { dateFormat } from "@/utils";
46
+import { logOperate_list } from "@/api/log";
6 47
 export default {
7 48
   data() {
8
-    return {};
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
+          key: "loginname",
75
+          align: "center"
76
+        },
77
+        {
78
+          title: "姓名",
79
+          key: "aname",
80
+          align: "center"
81
+        },
82
+        {
83
+          title: "事件",
84
+          key: "content",
85
+          align: "center"
86
+        },
87
+        {
88
+          title: "时间",
89
+          key: "createtime",
90
+          width: 190,
91
+          align: "center"
92
+        }
93
+      ]
94
+    };
9 95
   },
10
-  methods: {}
96
+  created() {
97
+    this.searchList();
98
+  },
99
+  methods: {
100
+    // 搜索
101
+    searchList() {
102
+      this.searchForm.page = 1;
103
+      this.getList();
104
+    },
105
+    // 页码改变
106
+    pageChange(page) {
107
+      this.searchForm.page = page;
108
+      this.getList();
109
+    },
110
+    // 每页显示数量改变
111
+    pageSizeChange(size) {
112
+      this.searchForm.size = size;
113
+      this.searchForm.page = 1;
114
+      this.getList();
115
+    },
116
+    // 获取列表
117
+    getList() {
118
+      let _begindate = this.searchForm.dataRange[0];
119
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
120
+      let _enddate = this.searchForm.dataRange[1];
121
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
122
+      logOperate_list({
123
+        page: this.searchForm.page,
124
+        size: this.searchForm.size,
125
+        begindate: _begindate,
126
+        enddate: _enddate,
127
+        name: this.searchForm.name
128
+      }).then((data) => {
129
+        if (data.code === 0) {
130
+          this.searchForm.list = data.obj.data;
131
+          this.searchForm.total = data.obj.total;
132
+        } else {
133
+          this.$Message.error(data.msg);
134
+        }
135
+      });
136
+    },
137
+    toExport() {}
138
+  }
11 139
 };
12 140
 </script>
13 141
 
14
-<style lang="less" scoped></style>
142
+<style lang="less" scoped>
143
+.search_header {
144
+  display: flex;
145
+  justify-content: space-between;
146
+  align-items: center;
147
+  margin: 16px 16px;
148
+  .search_left {
149
+    display: flex;
150
+    justify-content: flex-start;
151
+    align-items: center;
152
+  }
153
+}
154
+</style>

+ 171
- 4
src/views/schoolSection/log/appLaunch.vue View File

@@ -1,14 +1,181 @@
1 1
 <template>
2
-  <div class="main_root">应用启动日志</div>
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">
27
+        <template slot-scope="{ row }" slot="violatedSlot">
28
+          <div class="action_list">
29
+            <!-- 0不违规1违规 -->
30
+            <div v-if="row.violated === 1" class="action_success">是</div>
31
+            <div v-else-if="row.violated === 0" class="action_error">否</div>
32
+          </div>
33
+        </template>
34
+      </Table>
35
+    </div>
36
+    <div class="page_wrap">
37
+      <Page
38
+        :transfer="true"
39
+        :total="searchForm.total"
40
+        :current="searchForm.page"
41
+        :page-size="searchForm.size"
42
+        :page-size-opts="[10, 20, 40, 60]"
43
+        @on-change="pageChange"
44
+        @on-page-size-change="pageSizeChange"
45
+        show-total
46
+        show-sizer
47
+      ></Page>
48
+    </div>
49
+  </div>
3 50
 </template>
4 51
 
5 52
 <script>
53
+import { dateFormat } from "@/utils";
54
+import { logAppStart_list_start } from "@/api/log";
6 55
 export default {
7 56
   data() {
8
-    return {};
57
+    return {
58
+      searchForm: {
59
+        dataRange: [],
60
+        name: "",
61
+        page: 1,
62
+        size: 10,
63
+        list: [],
64
+        total: 0
65
+      },
66
+      columns: [
67
+        {
68
+          title: "序号",
69
+          align: "center",
70
+          width: 70,
71
+          render: (h, params) => {
72
+            return h(
73
+              "span",
74
+              params.index +
75
+                (this.searchForm.page - 1) * this.searchForm.size +
76
+                1
77
+            );
78
+          }
79
+        },
80
+        {
81
+          title: "学校名称",
82
+          key: "schoolName",
83
+          align: "center"
84
+        },
85
+        {
86
+          title: "班级",
87
+          key: "classname",
88
+          align: "center"
89
+        },
90
+        {
91
+          title: "登录名",
92
+          key: "loginname",
93
+          align: "center"
94
+        },
95
+        {
96
+          title: "姓名",
97
+          key: "aname",
98
+          align: "center"
99
+        },
100
+        {
101
+          title: "设备号码",
102
+          key: "sn",
103
+          align: "center"
104
+        },
105
+        {
106
+          title: "应用名称",
107
+          key: "appName",
108
+          align: "center"
109
+        },
110
+        {
111
+          title: "违规",
112
+          slot: "violatedSlot",
113
+          align: "center"
114
+        },
115
+        {
116
+          title: "下载时间",
117
+          key: "createtime",
118
+          width: 190,
119
+          align: "center"
120
+        }
121
+      ]
122
+    };
9 123
   },
10
-  methods: {}
124
+  created() {
125
+    this.searchList();
126
+  },
127
+  methods: {
128
+    // 搜索
129
+    searchList() {
130
+      this.searchForm.page = 1;
131
+      this.getList();
132
+    },
133
+    // 页码改变
134
+    pageChange(page) {
135
+      this.searchForm.page = page;
136
+      this.getList();
137
+    },
138
+    // 每页显示数量改变
139
+    pageSizeChange(size) {
140
+      this.searchForm.size = size;
141
+      this.searchForm.page = 1;
142
+      this.getList();
143
+    },
144
+    // 获取列表
145
+    getList() {
146
+      let _begindate = this.searchForm.dataRange[0];
147
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
148
+      let _enddate = this.searchForm.dataRange[1];
149
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
150
+      logAppStart_list_start({
151
+        page: this.searchForm.page,
152
+        size: this.searchForm.size,
153
+        begindate: _begindate,
154
+        enddate: _enddate,
155
+        name: this.searchForm.name
156
+      }).then((data) => {
157
+        if (data.code === 0) {
158
+          this.searchForm.list = data.obj.data;
159
+          this.searchForm.total = data.obj.total;
160
+        } else {
161
+          this.$Message.error(data.msg);
162
+        }
163
+      });
164
+    }
165
+  }
11 166
 };
12 167
 </script>
13 168
 
14
-<style lang="less" scoped></style>
169
+<style lang="less" scoped>
170
+.search_header {
171
+  display: flex;
172
+  justify-content: space-between;
173
+  align-items: center;
174
+  margin: 16px 16px;
175
+  .search_left {
176
+    display: flex;
177
+    justify-content: flex-start;
178
+    align-items: center;
179
+  }
180
+}
181
+</style>

+ 163
- 4
src/views/schoolSection/log/applicationDownload.vue View File

@@ -1,14 +1,173 @@
1 1
 <template>
2
-  <div class="main_root">应用下载日志</div>
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>
3 42
 </template>
4 43
 
5 44
 <script>
45
+import { dateFormat } from "@/utils";
46
+import { logAppDown_list } from "@/api/log";
6 47
 export default {
7 48
   data() {
8
-    return {};
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
+          key: "schoolName",
75
+          align: "center"
76
+        },
77
+        {
78
+          title: "班级",
79
+          key: "classname",
80
+          align: "center"
81
+        },
82
+        {
83
+          title: "登录名",
84
+          key: "loginname",
85
+          align: "center"
86
+        },
87
+        {
88
+          title: "姓名",
89
+          key: "aname",
90
+          align: "center"
91
+        },
92
+        {
93
+          title: "设备号码",
94
+          key: "sn",
95
+          align: "center"
96
+        },
97
+        {
98
+          title: "应用名称",
99
+          key: "appName",
100
+          align: "center"
101
+        },
102
+        {
103
+          title: "版本号",
104
+          key: "appVersion",
105
+          align: "center"
106
+        },
107
+        {
108
+          title: "下载时间",
109
+          key: "createtime",
110
+          width: 190,
111
+          align: "center"
112
+        }
113
+      ]
114
+    };
9 115
   },
10
-  methods: {}
116
+  created() {
117
+    this.searchList();
118
+  },
119
+  methods: {
120
+    // 搜索
121
+    searchList() {
122
+      this.searchForm.page = 1;
123
+      this.getList();
124
+    },
125
+    // 页码改变
126
+    pageChange(page) {
127
+      this.searchForm.page = page;
128
+      this.getList();
129
+    },
130
+    // 每页显示数量改变
131
+    pageSizeChange(size) {
132
+      this.searchForm.size = size;
133
+      this.searchForm.page = 1;
134
+      this.getList();
135
+    },
136
+    // 获取列表
137
+    getList() {
138
+      let _begindate = this.searchForm.dataRange[0];
139
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
140
+      let _enddate = this.searchForm.dataRange[1];
141
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
142
+      logAppDown_list({
143
+        page: this.searchForm.page,
144
+        size: this.searchForm.size,
145
+        begindate: _begindate,
146
+        enddate: _enddate,
147
+        name: this.searchForm.name
148
+      }).then((data) => {
149
+        if (data.code === 0) {
150
+          this.searchForm.list = data.obj.data;
151
+          this.searchForm.total = data.obj.total;
152
+        } else {
153
+          this.$Message.error(data.msg);
154
+        }
155
+      });
156
+    }
157
+  }
11 158
 };
12 159
 </script>
13 160
 
14
-<style lang="less" scoped></style>
161
+<style lang="less" scoped>
162
+.search_header {
163
+  display: flex;
164
+  justify-content: space-between;
165
+  align-items: center;
166
+  margin: 16px 16px;
167
+  .search_left {
168
+    display: flex;
169
+    justify-content: flex-start;
170
+    align-items: center;
171
+  }
172
+}
173
+</style>

+ 201
- 4
src/views/schoolSection/log/deviceEvents.vue View File

@@ -1,14 +1,211 @@
1 1
 <template>
2
-  <div class="main_root">设备事件日志</div>
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
+        <Select
17
+          v-model="searchForm.doEvent"
18
+          :transfer="true"
19
+          style="margin-right: 10px; width: 150px"
20
+          @on-change="searchList()"
21
+        >
22
+          <Option :value="0">所有事件</Option>
23
+          <Option
24
+            v-for="(eventName, eventVal) in doEventInfo"
25
+            :value="Number(eventVal)"
26
+            :key="eventVal"
27
+            >{{ eventName }}</Option
28
+          >
29
+        </Select>
30
+        <Input
31
+          v-model="searchForm.name"
32
+          placeholder="请输入登录名、设备号"
33
+          search
34
+          @on-search="searchList()"
35
+          style="width: 180px"
36
+        />
37
+      </div>
38
+      <Button type="primary" class="primary_btn" @click="toExport()"
39
+        >导出</Button
40
+      >
41
+    </div>
42
+    <div class="table_wrap">
43
+      <Table :columns="columns" :data="searchForm.list">
44
+        <template slot-scope="{ row }" slot="doEventSlot">
45
+          <!-- 1发送消息 2解除限制 3限制使用 4更新策略 5重启设备 6恢复出厂 -->
46
+          <div>{{ doEventInfo[row.doEvent] }}</div>
47
+        </template>
48
+        <template slot-scope="{ row }" slot="violatedSlot">
49
+          <div class="action_list">
50
+            <!-- 0不违规1违规 -->
51
+            <div v-if="row.violated === 1" class="action_success">是</div>
52
+            <div v-else-if="row.violated === 0" class="action_error">否</div>
53
+          </div>
54
+        </template>
55
+      </Table>
56
+    </div>
57
+    <div class="page_wrap">
58
+      <Page
59
+        :transfer="true"
60
+        :total="searchForm.total"
61
+        :current="searchForm.page"
62
+        :page-size="searchForm.size"
63
+        :page-size-opts="[10, 20, 40, 60]"
64
+        @on-change="pageChange"
65
+        @on-page-size-change="pageSizeChange"
66
+        show-total
67
+        show-sizer
68
+      ></Page>
69
+    </div>
70
+  </div>
3 71
 </template>
4 72
 
5 73
 <script>
74
+import { dateFormat, doEventInfo } from "@/utils";
75
+import { logdoperate_list_event } from "@/api/log";
6 76
 export default {
7 77
   data() {
8
-    return {};
78
+    return {
79
+      doEventInfo,
80
+      searchForm: {
81
+        dataRange: [],
82
+        doEvent: 0,
83
+        name: "",
84
+        page: 1,
85
+        size: 10,
86
+        list: [],
87
+        total: 0
88
+      },
89
+      columns: [
90
+        {
91
+          title: "序号",
92
+          align: "center",
93
+          width: 70,
94
+          render: (h, params) => {
95
+            return h(
96
+              "span",
97
+              params.index +
98
+                (this.searchForm.page - 1) * this.searchForm.size +
99
+                1
100
+            );
101
+          }
102
+        },
103
+        {
104
+          title: "学校名称",
105
+          key: "schoolName",
106
+          align: "center"
107
+        },
108
+        {
109
+          title: "班级",
110
+          key: "classname",
111
+          align: "center"
112
+        },
113
+        {
114
+          title: "登录名",
115
+          key: "loginname",
116
+          align: "center"
117
+        },
118
+        {
119
+          title: "姓名",
120
+          key: "username",
121
+          align: "center"
122
+        },
123
+        {
124
+          title: "设备号码",
125
+          key: "sn",
126
+          align: "center"
127
+        },
128
+        {
129
+          title: "事件",
130
+          slot: "doEventSlot",
131
+          align: "center"
132
+        },
133
+        {
134
+          title: "描述",
135
+          key: "comm",
136
+          align: "center"
137
+        },
138
+        {
139
+          title: "违规",
140
+          slot: "violatedSlot",
141
+          align: "center"
142
+        },
143
+        {
144
+          title: "时间",
145
+          key: "createtime",
146
+          width: 190,
147
+          align: "center"
148
+        }
149
+      ]
150
+    };
9 151
   },
10
-  methods: {}
152
+  created() {
153
+    this.searchList();
154
+  },
155
+  methods: {
156
+    // 搜索
157
+    searchList() {
158
+      this.searchForm.page = 1;
159
+      this.getList();
160
+    },
161
+    // 页码改变
162
+    pageChange(page) {
163
+      this.searchForm.page = page;
164
+      this.getList();
165
+    },
166
+    // 每页显示数量改变
167
+    pageSizeChange(size) {
168
+      this.searchForm.size = size;
169
+      this.searchForm.page = 1;
170
+      this.getList();
171
+    },
172
+    // 获取列表
173
+    getList() {
174
+      let _begindate = this.searchForm.dataRange[0];
175
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
176
+      let _enddate = this.searchForm.dataRange[1];
177
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
178
+      logdoperate_list_event({
179
+        page: this.searchForm.page,
180
+        size: this.searchForm.size,
181
+        doEvent: this.searchForm.doEvent,
182
+        begindate: _begindate,
183
+        enddate: _enddate,
184
+        name: this.searchForm.name
185
+      }).then((data) => {
186
+        if (data.code === 0) {
187
+          this.searchForm.list = data.obj.data;
188
+          this.searchForm.total = data.obj.total;
189
+        } else {
190
+          this.$Message.error(data.msg);
191
+        }
192
+      });
193
+    },
194
+    toExport() {}
195
+  }
11 196
 };
12 197
 </script>
13 198
 
14
-<style lang="less" scoped></style>
199
+<style lang="less" scoped>
200
+.search_header {
201
+  display: flex;
202
+  justify-content: space-between;
203
+  align-items: center;
204
+  margin: 16px 16px;
205
+  .search_left {
206
+    display: flex;
207
+    justify-content: flex-start;
208
+    align-items: center;
209
+  }
210
+}
211
+</style>

+ 139
- 4
src/views/schoolSection/log/deviceExport.vue View File

@@ -1,14 +1,149 @@
1 1
 <template>
2
-  <div class="main_root">设备导出</div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Input
6
+          v-model="searchForm.name"
7
+          placeholder="请输入名称"
8
+          search
9
+          @on-search="searchList()"
10
+          style="width: 150px"
11
+        />
12
+      </div>
13
+      <Button type="primary" class="primary_btn" @click="toExport()"
14
+        >导出</Button
15
+      >
16
+    </div>
17
+    <div class="table_wrap">
18
+      <Table :columns="columns" :data="searchForm.list">
19
+        <template slot-scope="{ row }" slot="actionSlot">
20
+          <div class="action_list">
21
+            <div @click="toExport(row)">导出</div>
22
+          </div>
23
+        </template>
24
+      </Table>
25
+    </div>
26
+    <div class="page_wrap">
27
+      <Page
28
+        :transfer="true"
29
+        :total="searchForm.total"
30
+        :current="searchForm.page"
31
+        :page-size="searchForm.size"
32
+        :page-size-opts="[10, 20, 40, 60]"
33
+        @on-change="pageChange"
34
+        @on-page-size-change="pageSizeChange"
35
+        show-total
36
+        show-sizer
37
+      ></Page>
38
+    </div>
39
+  </div>
3 40
 </template>
4 41
 
5 42
 <script>
43
+import { logDeviceBind_list } from "@/api/log";
6 44
 export default {
7 45
   data() {
8
-    return {};
46
+    return {
47
+      searchForm: {
48
+        name: "",
49
+        page: 1,
50
+        size: 10,
51
+        list: [],
52
+        total: 0
53
+      },
54
+      columns: [
55
+        {
56
+          title: "序号",
57
+          align: "center",
58
+          width: 70,
59
+          render: (h, params) => {
60
+            return h(
61
+              "span",
62
+              params.index +
63
+                (this.searchForm.page - 1) * this.searchForm.size +
64
+                1
65
+            );
66
+          }
67
+        },
68
+        {
69
+          title: "区域名称",
70
+          key: "regionName",
71
+          align: "center"
72
+        },
73
+        {
74
+          title: "学校数",
75
+          key: "schoolnum",
76
+          align: "center"
77
+        },
78
+        {
79
+          title: "用户数",
80
+          key: "usernum",
81
+          align: "center"
82
+        },
83
+        {
84
+          title: "设备数",
85
+          key: "snnum",
86
+          align: "center"
87
+        },
88
+        {
89
+          title: "操作",
90
+          slot: "actionSlot",
91
+          width: 90,
92
+          align: "center"
93
+        }
94
+      ]
95
+    };
9 96
   },
10
-  methods: {}
97
+  created() {
98
+    this.searchList();
99
+  },
100
+  methods: {
101
+    // 搜索
102
+    searchList() {
103
+      this.searchForm.page = 1;
104
+      this.getList();
105
+    },
106
+    // 页码改变
107
+    pageChange(page) {
108
+      this.searchForm.page = page;
109
+      this.getList();
110
+    },
111
+    // 每页显示数量改变
112
+    pageSizeChange(size) {
113
+      this.searchForm.size = size;
114
+      this.searchForm.page = 1;
115
+      this.getList();
116
+    },
117
+    // 获取列表
118
+    getList() {
119
+      logDeviceBind_list({
120
+        page: this.searchForm.page,
121
+        size: this.searchForm.size,
122
+        name: this.searchForm.name
123
+      }).then((data) => {
124
+        if (data.code === 0) {
125
+          this.searchForm.list = data.obj.data;
126
+          this.searchForm.total = data.obj.total;
127
+        } else {
128
+          this.$Message.error(data.msg);
129
+        }
130
+      });
131
+    },
132
+    toExport() {}
133
+  }
11 134
 };
12 135
 </script>
13 136
 
14
-<style lang="less" scoped></style>
137
+<style lang="less" scoped>
138
+.search_header {
139
+  display: flex;
140
+  justify-content: space-between;
141
+  align-items: center;
142
+  margin: 16px 16px;
143
+  .search_left {
144
+    display: flex;
145
+    justify-content: flex-start;
146
+    align-items: center;
147
+  }
148
+}
149
+</style>

+ 177
- 4
src/views/schoolSection/log/deviceInstallation.vue View File

@@ -1,14 +1,187 @@
1 1
 <template>
2
-  <div class="main_root">设备已安装应用</div>
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
+      <Button type="primary" class="primary_btn" @click="toExport()"
25
+        >导出</Button
26
+      >
27
+    </div>
28
+    <div class="table_wrap">
29
+      <Table :columns="columns" :data="searchForm.list"></Table>
30
+    </div>
31
+    <div class="page_wrap">
32
+      <Page
33
+        :transfer="true"
34
+        :total="searchForm.total"
35
+        :current="searchForm.page"
36
+        :page-size="searchForm.size"
37
+        :page-size-opts="[10, 20, 40, 60]"
38
+        @on-change="pageChange"
39
+        @on-page-size-change="pageSizeChange"
40
+        show-total
41
+        show-sizer
42
+      ></Page>
43
+    </div>
44
+  </div>
3 45
 </template>
4 46
 
5 47
 <script>
48
+import { dateFormat } from "@/utils";
49
+import { logAppStart_list_install } from "@/api/log";
6 50
 export default {
7 51
   data() {
8
-    return {};
52
+    return {
53
+      searchForm: {
54
+        dataRange: [],
55
+        name: "",
56
+        page: 1,
57
+        size: 10,
58
+        list: [],
59
+        total: 0
60
+      },
61
+      columns: [
62
+        {
63
+          title: "序号",
64
+          align: "center",
65
+          width: 70,
66
+          render: (h, params) => {
67
+            return h(
68
+              "span",
69
+              params.index +
70
+                (this.searchForm.page - 1) * this.searchForm.size +
71
+                1
72
+            );
73
+          }
74
+        },
75
+        {
76
+          title: "学校名称",
77
+          key: "schoolName",
78
+          align: "center"
79
+        },
80
+        {
81
+          title: "班级",
82
+          key: "classname",
83
+          align: "center"
84
+        },
85
+        {
86
+          title: "登录名",
87
+          key: "loginname",
88
+          align: "center"
89
+        },
90
+        {
91
+          title: "姓名",
92
+          key: "aname",
93
+          align: "center"
94
+        },
95
+        {
96
+          title: "设备号码",
97
+          key: "sn",
98
+          align: "center"
99
+        },
100
+        {
101
+          title: "应用名称",
102
+          key: "appName",
103
+          align: "center"
104
+        },
105
+        {
106
+          title: "应用包名",
107
+          key: "appPackage",
108
+          align: "center"
109
+        },
110
+        {
111
+          title: "版本名称",
112
+          key: "versionName",
113
+          align: "center"
114
+        },
115
+        {
116
+          title: "版本号",
117
+          key: "versionNum",
118
+          align: "center"
119
+        },
120
+        {
121
+          title: "上报时间",
122
+          key: "createtime",
123
+          width: 190,
124
+          align: "center"
125
+        }
126
+      ]
127
+    };
9 128
   },
10
-  methods: {}
129
+  created() {
130
+    this.searchList();
131
+  },
132
+  methods: {
133
+    // 搜索
134
+    searchList() {
135
+      this.searchForm.page = 1;
136
+      this.getList();
137
+    },
138
+    // 页码改变
139
+    pageChange(page) {
140
+      this.searchForm.page = page;
141
+      this.getList();
142
+    },
143
+    // 每页显示数量改变
144
+    pageSizeChange(size) {
145
+      this.searchForm.size = size;
146
+      this.searchForm.page = 1;
147
+      this.getList();
148
+    },
149
+    // 获取列表
150
+    getList() {
151
+      let _begindate = this.searchForm.dataRange[0];
152
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
153
+      let _enddate = this.searchForm.dataRange[1];
154
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
155
+      logAppStart_list_install({
156
+        page: this.searchForm.page,
157
+        size: this.searchForm.size,
158
+        begindate: _begindate,
159
+        enddate: _enddate,
160
+        name: this.searchForm.name
161
+      }).then((data) => {
162
+        if (data.code === 0) {
163
+          this.searchForm.list = data.obj.data;
164
+          this.searchForm.total = data.obj.total;
165
+        } else {
166
+          this.$Message.error(data.msg);
167
+        }
168
+      });
169
+    },
170
+    toExport() {}
171
+  }
11 172
 };
12 173
 </script>
13 174
 
14
-<style lang="less" scoped></style>
175
+<style lang="less" scoped>
176
+.search_header {
177
+  display: flex;
178
+  justify-content: space-between;
179
+  align-items: center;
180
+  margin: 16px 16px;
181
+  .search_left {
182
+    display: flex;
183
+    justify-content: flex-start;
184
+    align-items: center;
185
+  }
186
+}
187
+</style>

+ 162
- 4
src/views/schoolSection/log/deviceLocation.vue View File

@@ -1,14 +1,172 @@
1 1
 <template>
2
-  <div class="main_root">设备位置日志</div>
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
+      <Button type="primary" class="primary_btn" @click="toExport()"
25
+        >导出</Button
26
+      >
27
+    </div>
28
+    <div class="table_wrap">
29
+      <Table :columns="columns" :data="searchForm.list"></Table>
30
+    </div>
31
+    <div class="page_wrap">
32
+      <Page
33
+        :transfer="true"
34
+        :total="searchForm.total"
35
+        :current="searchForm.page"
36
+        :page-size="searchForm.size"
37
+        :page-size-opts="[10, 20, 40, 60]"
38
+        @on-change="pageChange"
39
+        @on-page-size-change="pageSizeChange"
40
+        show-total
41
+        show-sizer
42
+      ></Page>
43
+    </div>
44
+  </div>
3 45
 </template>
4 46
 
5 47
 <script>
48
+import { dateFormat } from "@/utils";
49
+import { logDeviceLogin_list } from "@/api/log";
6 50
 export default {
7 51
   data() {
8
-    return {};
52
+    return {
53
+      searchForm: {
54
+        dataRange: [],
55
+        name: "",
56
+        page: 1,
57
+        size: 10,
58
+        list: [],
59
+        total: 0
60
+      },
61
+      columns: [
62
+        {
63
+          title: "序号",
64
+          align: "center",
65
+          width: 70,
66
+          render: (h, params) => {
67
+            return h(
68
+              "span",
69
+              params.index +
70
+                (this.searchForm.page - 1) * this.searchForm.size +
71
+                1
72
+            );
73
+          }
74
+        },
75
+        {
76
+          title: "设备号码",
77
+          key: "sn",
78
+          align: "center"
79
+        },
80
+        {
81
+          title: "登录名",
82
+          key: "loginname",
83
+          align: "center"
84
+        },
85
+        {
86
+          title: "姓名",
87
+          key: "username",
88
+          align: "center"
89
+        },
90
+        {
91
+          title: "学校名称",
92
+          key: "schoolName",
93
+          align: "center"
94
+        },
95
+        {
96
+          title: "班级",
97
+          key: "classname",
98
+          align: "center"
99
+        },
100
+        {
101
+          title: "地址",
102
+          key: "ipAddress",
103
+          align: "center"
104
+        },
105
+        {
106
+          title: "时间",
107
+          key: "createtime",
108
+          width: 190,
109
+          align: "center"
110
+        }
111
+      ]
112
+    };
9 113
   },
10
-  methods: {}
114
+  created() {
115
+    this.searchList();
116
+  },
117
+  methods: {
118
+    // 搜索
119
+    searchList() {
120
+      this.searchForm.page = 1;
121
+      this.getList();
122
+    },
123
+    // 页码改变
124
+    pageChange(page) {
125
+      this.searchForm.page = page;
126
+      this.getList();
127
+    },
128
+    // 每页显示数量改变
129
+    pageSizeChange(size) {
130
+      this.searchForm.size = size;
131
+      this.searchForm.page = 1;
132
+      this.getList();
133
+    },
134
+    // 获取列表
135
+    getList() {
136
+      let _begindate = this.searchForm.dataRange[0];
137
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
138
+      let _enddate = this.searchForm.dataRange[1];
139
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
140
+      logDeviceLogin_list({
141
+        page: this.searchForm.page,
142
+        size: this.searchForm.size,
143
+        begindate: _begindate,
144
+        enddate: _enddate,
145
+        name: this.searchForm.name
146
+      }).then((data) => {
147
+        if (data.code === 0) {
148
+          this.searchForm.list = data.obj.data;
149
+          this.searchForm.total = data.obj.total;
150
+        } else {
151
+          this.$Message.error(data.msg);
152
+        }
153
+      });
154
+    },
155
+    toExport() {}
156
+  }
11 157
 };
12 158
 </script>
13 159
 
14
-<style lang="less" scoped></style>
160
+<style lang="less" scoped>
161
+.search_header {
162
+  display: flex;
163
+  justify-content: space-between;
164
+  align-items: center;
165
+  margin: 16px 16px;
166
+  .search_left {
167
+    display: flex;
168
+    justify-content: flex-start;
169
+    align-items: center;
170
+  }
171
+}
172
+</style>

+ 154
- 4
src/views/schoolSection/log/devicePush.vue View File

@@ -1,14 +1,164 @@
1 1
 <template>
2
-  <div class="main_root">设备推送日志</div>
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">
27
+        <template slot-scope="{ row }" slot="pushTypeSlot">
28
+          <!-- 1发送消息 2解除限制 3限制使用 4更新策略 5重启设备 6恢复出厂 -->
29
+          <div>{{ pushTypeInfo[row.pushType] }}</div>
30
+        </template>
31
+      </Table>
32
+    </div>
33
+    <div class="page_wrap">
34
+      <Page
35
+        :transfer="true"
36
+        :total="searchForm.total"
37
+        :current="searchForm.page"
38
+        :page-size="searchForm.size"
39
+        :page-size-opts="[10, 20, 40, 60]"
40
+        @on-change="pageChange"
41
+        @on-page-size-change="pageSizeChange"
42
+        show-total
43
+        show-sizer
44
+      ></Page>
45
+    </div>
46
+  </div>
3 47
 </template>
4 48
 
5 49
 <script>
50
+import { dateFormat, pushTypeInfo } from "@/utils";
51
+import { logPush_list } from "@/api/log";
6 52
 export default {
7 53
   data() {
8
-    return {};
54
+    return {
55
+      pushTypeInfo,
56
+      searchForm: {
57
+        dataRange: [],
58
+        name: "",
59
+        page: 1,
60
+        size: 10,
61
+        list: [],
62
+        total: 0
63
+      },
64
+      columns: [
65
+        {
66
+          title: "序号",
67
+          align: "center",
68
+          width: 70,
69
+          render: (h, params) => {
70
+            return h(
71
+              "span",
72
+              params.index +
73
+                (this.searchForm.page - 1) * this.searchForm.size +
74
+                1
75
+            );
76
+          }
77
+        },
78
+        {
79
+          title: "登录名",
80
+          key: "loginname",
81
+          align: "center"
82
+        },
83
+        {
84
+          title: "姓名",
85
+          key: "aname",
86
+          align: "center"
87
+        },
88
+        {
89
+          title: "事件",
90
+          slot: "pushTypeSlot",
91
+          align: "center"
92
+        },
93
+        {
94
+          title: "设备号码",
95
+          key: "sn",
96
+          align: "center"
97
+        },
98
+        {
99
+          title: "时间",
100
+          key: "createtime",
101
+          width: 190,
102
+          align: "center"
103
+        }
104
+      ]
105
+    };
9 106
   },
10
-  methods: {}
107
+  created() {
108
+    this.searchList();
109
+  },
110
+  methods: {
111
+    // 搜索
112
+    searchList() {
113
+      this.searchForm.page = 1;
114
+      this.getList();
115
+    },
116
+    // 页码改变
117
+    pageChange(page) {
118
+      this.searchForm.page = page;
119
+      this.getList();
120
+    },
121
+    // 每页显示数量改变
122
+    pageSizeChange(size) {
123
+      this.searchForm.size = size;
124
+      this.searchForm.page = 1;
125
+      this.getList();
126
+    },
127
+    // 获取列表
128
+    getList() {
129
+      let _begindate = this.searchForm.dataRange[0];
130
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
131
+      let _enddate = this.searchForm.dataRange[1];
132
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
133
+      logPush_list({
134
+        page: this.searchForm.page,
135
+        size: this.searchForm.size,
136
+        begindate: _begindate,
137
+        enddate: _enddate,
138
+        name: this.searchForm.name
139
+      }).then((data) => {
140
+        if (data.code === 0) {
141
+          this.searchForm.list = data.obj.data;
142
+          this.searchForm.total = data.obj.total;
143
+        } else {
144
+          this.$Message.error(data.msg);
145
+        }
146
+      });
147
+    }
148
+  }
11 149
 };
12 150
 </script>
13 151
 
14
-<style lang="less" scoped></style>
152
+<style lang="less" scoped>
153
+.search_header {
154
+  display: flex;
155
+  justify-content: space-between;
156
+  align-items: center;
157
+  margin: 16px 16px;
158
+  .search_left {
159
+    display: flex;
160
+    justify-content: flex-start;
161
+    align-items: center;
162
+  }
163
+}
164
+</style>

+ 244
- 4
src/views/schoolSection/log/violatingDevice.vue View File

@@ -1,14 +1,254 @@
1 1
 <template>
2
-  <div class="main_root">违规设备日志</div>
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
+        <Select
17
+          v-model="searchForm.doEvent"
18
+          :transfer="true"
19
+          style="margin-right: 10px; width: 150px"
20
+          @on-change="searchList()"
21
+        >
22
+          <Option :value="0">所有事件</Option>
23
+          <Option
24
+            v-for="(eventName, eventVal) in doEventInfo"
25
+            :value="Number(eventVal)"
26
+            :key="eventVal"
27
+            >{{ eventName }}</Option
28
+          >
29
+        </Select>
30
+        <Input
31
+          v-model="searchForm.name"
32
+          placeholder="请输入登录名、设备号"
33
+          search
34
+          @on-search="searchList()"
35
+          style="width: 180px"
36
+        />
37
+      </div>
38
+      <Button type="primary" class="primary_btn" @click="toExport()"
39
+        >导出</Button
40
+      >
41
+    </div>
42
+    <div class="table_wrap">
43
+      <Table :columns="columns" :data="searchForm.list">
44
+        <template slot-scope="{ row }" slot="doEventSlot">
45
+          <!-- 1发送消息 2解除限制 3限制使用 4更新策略 5重启设备 6恢复出厂 -->
46
+          <div>{{ doEventInfo[row.doEvent] }}</div>
47
+        </template>
48
+        <template slot-scope="{ row }" slot="noticedSlot">
49
+          <div class="action_list">
50
+            <!-- 是否通知:0否 1是 -->
51
+            <div v-if="row.noticed === 1" class="action_success">是</div>
52
+            <div v-else-if="row.noticed === 0" class="action_error">否</div>
53
+          </div>
54
+        </template>
55
+        <template slot-scope="{ row }" slot="lockedSlot">
56
+          <div class="action_list">
57
+            <!-- 是否锁定:0否 1是 -->
58
+            <div v-if="row.locked === 1" class="action_success">是</div>
59
+            <div v-else-if="row.locked === 0" class="action_error">否</div>
60
+          </div>
61
+        </template>
62
+        <template slot-scope="{ row }" slot="resetedSlot">
63
+          <div class="action_list">
64
+            <!-- 是否重置:0否 1是 -->
65
+            <div v-if="row.reseted === 1" class="action_success">是</div>
66
+            <div v-else-if="row.reseted === 0" class="action_error">否</div>
67
+          </div>
68
+        </template>
69
+        <template slot-scope="{ row }" slot="emailedSlot">
70
+          <div class="action_list">
71
+            <!-- 是否发送邮件:0否 1是 -->
72
+            <div v-if="row.emailed === 1" class="action_success">是</div>
73
+            <div v-else-if="row.emailed === 0" class="action_error">否</div>
74
+          </div>
75
+        </template>
76
+        <template slot-scope="{ row }" slot="handledSlot">
77
+          <div class="action_list">
78
+            <!-- 是否处理:0否 1是 -->
79
+            <div v-if="row.handled === 1" class="action_success">是</div>
80
+            <div v-else-if="row.handled === 0" class="action_error">否</div>
81
+          </div>
82
+        </template>
83
+      </Table>
84
+    </div>
85
+    <div class="page_wrap">
86
+      <Page
87
+        :transfer="true"
88
+        :total="searchForm.total"
89
+        :current="searchForm.page"
90
+        :page-size="searchForm.size"
91
+        :page-size-opts="[10, 20, 40, 60]"
92
+        @on-change="pageChange"
93
+        @on-page-size-change="pageSizeChange"
94
+        show-total
95
+        show-sizer
96
+      ></Page>
97
+    </div>
98
+  </div>
3 99
 </template>
4 100
 
5 101
 <script>
102
+import { dateFormat, doEventInfo } from "@/utils";
103
+import { logdoperate_list_violate } from "@/api/log";
6 104
 export default {
7 105
   data() {
8
-    return {};
106
+    return {
107
+      doEventInfo,
108
+      searchForm: {
109
+        dataRange: [],
110
+        doEvent: 0,
111
+        name: "",
112
+        page: 1,
113
+        size: 10,
114
+        list: [],
115
+        total: 0
116
+      },
117
+      columns: [
118
+        {
119
+          title: "序号",
120
+          align: "center",
121
+          width: 70,
122
+          render: (h, params) => {
123
+            return h(
124
+              "span",
125
+              params.index +
126
+                (this.searchForm.page - 1) * this.searchForm.size +
127
+                1
128
+            );
129
+          }
130
+        },
131
+        {
132
+          title: "学校名称",
133
+          key: "schoolName",
134
+          align: "center"
135
+        },
136
+        {
137
+          title: "班级",
138
+          key: "classname",
139
+          align: "center"
140
+        },
141
+        {
142
+          title: "登录名",
143
+          key: "loginname",
144
+          align: "center"
145
+        },
146
+        {
147
+          title: "姓名",
148
+          key: "username",
149
+          align: "center"
150
+        },
151
+        {
152
+          title: "设备号码",
153
+          key: "sn",
154
+          align: "center"
155
+        },
156
+        {
157
+          title: "事件",
158
+          slot: "doEventSlot",
159
+          align: "center"
160
+        },
161
+        {
162
+          title: "通知",
163
+          slot: "noticedSlot",
164
+          align: "center"
165
+        },
166
+        {
167
+          title: "锁定",
168
+          slot: "lockedSlot",
169
+          align: "center"
170
+        },
171
+        {
172
+          title: "重置",
173
+          slot: "resetedSlot",
174
+          align: "center"
175
+        },
176
+        {
177
+          title: "发邮件",
178
+          slot: "emailedSlot",
179
+          align: "center"
180
+        },
181
+        {
182
+          title: "处理结果",
183
+          slot: "handledSlot",
184
+          align: "center"
185
+        },
186
+        {
187
+          title: "时间",
188
+          key: "createtime",
189
+          width: 190,
190
+          align: "center"
191
+        }
192
+      ]
193
+    };
9 194
   },
10
-  methods: {}
195
+  created() {
196
+    this.searchList();
197
+  },
198
+  methods: {
199
+    // 搜索
200
+    searchList() {
201
+      this.searchForm.page = 1;
202
+      this.getList();
203
+    },
204
+    // 页码改变
205
+    pageChange(page) {
206
+      this.searchForm.page = page;
207
+      this.getList();
208
+    },
209
+    // 每页显示数量改变
210
+    pageSizeChange(size) {
211
+      this.searchForm.size = size;
212
+      this.searchForm.page = 1;
213
+      this.getList();
214
+    },
215
+    // 获取列表
216
+    getList() {
217
+      let _begindate = this.searchForm.dataRange[0];
218
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
219
+      let _enddate = this.searchForm.dataRange[1];
220
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
221
+      logdoperate_list_violate({
222
+        page: this.searchForm.page,
223
+        size: this.searchForm.size,
224
+        doEvent: this.searchForm.doEvent,
225
+        begindate: _begindate,
226
+        enddate: _enddate,
227
+        name: this.searchForm.name
228
+      }).then((data) => {
229
+        if (data.code === 0) {
230
+          this.searchForm.list = data.obj.data;
231
+          this.searchForm.total = data.obj.total;
232
+        } else {
233
+          this.$Message.error(data.msg);
234
+        }
235
+      });
236
+    },
237
+    toExport() {}
238
+  }
11 239
 };
12 240
 </script>
13 241
 
14
-<style lang="less" scoped></style>
242
+<style lang="less" scoped>
243
+.search_header {
244
+  display: flex;
245
+  justify-content: space-between;
246
+  align-items: center;
247
+  margin: 16px 16px;
248
+  .search_left {
249
+    display: flex;
250
+    justify-content: flex-start;
251
+    align-items: center;
252
+  }
253
+}
254
+</style>

Loading…
Cancel
Save