Browse Source

学校日志导出

gzb
wangzhonglu 9 months ago
parent
commit
225fd03e79

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

@@ -10,9 +10,9 @@
10 10
           style="width: 150px"
11 11
         />
12 12
       </div>
13
-      <!-- <Button type="primary" class="primary_btn" @click="toExport()"
13
+      <Button type="primary" class="primary_btn" @click="toExport()"
14 14
         >导出</Button
15
-      > -->
15
+      >
16 16
     </div>
17 17
     <div class="table_wrap">
18 18
       <Table :columns="columns" :data="searchForm.list">
@@ -131,30 +131,57 @@ export default {
131 131
       });
132 132
     },
133 133
     toExport(row) {
134
-      logDeviceBind_list_all({
135
-        regionid: row.regionid
136
-      }).then((data) => {
137
-        if (data.code === 0) {
138
-          exportToExcel(
139
-            [
140
-              {
141
-                list: data.obj.map((item) => {
142
-                  return {
143
-                    区域名称: item.regionName,
144
-                    学校数: item.schoolnum,
145
-                    用户数: item.usernum,
146
-                    设备数: item.snnum
147
-                  };
148
-                }),
149
-                name: row.regionName
150
-              }
151
-            ],
152
-            "设备导出"
153
-          );
154
-        } else {
155
-          this.$Message.error(data.msg);
156
-        }
157
-      });
134
+      if (row) {
135
+        logDeviceBind_list_all({
136
+          regionid: row.regionid
137
+        }).then((data) => {
138
+          if (data.code === 0) {
139
+            exportToExcel(
140
+              [
141
+                {
142
+                  list: data.obj.map((item) => {
143
+                    return {
144
+                      区域名称: item.regionName,
145
+                      学校数: item.schoolnum,
146
+                      用户数: item.usernum,
147
+                      设备数: item.snnum
148
+                    };
149
+                  }),
150
+                  name: row.regionName
151
+                }
152
+              ],
153
+              `设备导出_${row.regionName}`
154
+            );
155
+          } else {
156
+            this.$Message.error(data.msg);
157
+          }
158
+        });
159
+      } else {
160
+        logDeviceBind_list({
161
+          name: this.searchForm.name
162
+        }).then((data) => {
163
+          if (data.code === 0) {
164
+            exportToExcel(
165
+              [
166
+                {
167
+                  list: data.obj.data.map((item) => {
168
+                    return {
169
+                      区域名称: item.regionName,
170
+                      学校数: item.schoolnum,
171
+                      用户数: item.usernum,
172
+                      设备数: item.snnum
173
+                    };
174
+                  }),
175
+                  name: "设备导出"
176
+                }
177
+              ],
178
+              "设备导出"
179
+            );
180
+          } else {
181
+            this.$Message.error(data.msg);
182
+          }
183
+        });
184
+      }
158 185
     }
159 186
   }
160 187
 };

+ 8
- 3
src/views/schoolSection/deviceManage/breakRuleDevice.vue View File

@@ -25,8 +25,13 @@
25 25
             其他操作<Icon type="ios-arrow-down" class="arrow_down" />
26 26
           </div>
27 27
           <DropdownMenu slot="list">
28
-            <DropdownItem>恢复出厂</DropdownItem>
29
-            <DropdownItem>合规处理</DropdownItem>
28
+            <DropdownItem>恢复出厂设置</DropdownItem>
29
+            <DropdownItem>发送消息</DropdownItem>
30
+            <DropdownItem>解除限制</DropdownItem>
31
+            <DropdownItem>限制使用</DropdownItem>
32
+            <DropdownItem>更新策略</DropdownItem>
33
+            <DropdownItem>重启设备</DropdownItem>
34
+            <DropdownItem>合理处理</DropdownItem>
30 35
           </DropdownMenu>
31 36
         </Dropdown>
32 37
       </div>
@@ -128,7 +133,7 @@ export default {
128 133
           align: "center"
129 134
         },
130 135
         {
131
-          title: "违规详情",
136
+          title: "操作中",
132 137
           key: "num",
133 138
           width: 100,
134 139
           align: "center"

+ 2
- 0
src/views/schoolSection/log/admin.vue View File

@@ -120,6 +120,8 @@ export default {
120 120
       let _enddate = this.searchForm.dataRange[1];
121 121
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
122 122
       logOperate_list({
123
+        regionid: 1,
124
+        schoolid: 1,
123 125
         page: this.searchForm.page,
124 126
         size: this.searchForm.size,
125 127
         begindate: _begindate,

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

@@ -94,7 +94,7 @@ export default {
94 94
         },
95 95
         {
96 96
           title: "姓名",
97
-          key: "aname",
97
+          key: "username",
98 98
           align: "center"
99 99
         },
100 100
         {
@@ -110,6 +110,7 @@ export default {
110 110
         {
111 111
           title: "违规",
112 112
           slot: "violatedSlot",
113
+          width: 70,
113 114
           align: "center"
114 115
         },
115 116
         {
@@ -148,6 +149,8 @@ export default {
148 149
       let _enddate = this.searchForm.dataRange[1];
149 150
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
150 151
       logAppStart_list_start({
152
+        regionid: 1,
153
+        schoolid: 1,
151 154
         page: this.searchForm.page,
152 155
         size: this.searchForm.size,
153 156
         begindate: _begindate,

+ 3
- 1
src/views/schoolSection/log/applicationDownload.vue View File

@@ -86,7 +86,7 @@ export default {
86 86
         },
87 87
         {
88 88
           title: "姓名",
89
-          key: "aname",
89
+          key: "username",
90 90
           align: "center"
91 91
         },
92 92
         {
@@ -140,6 +140,8 @@ export default {
140 140
       let _enddate = this.searchForm.dataRange[1];
141 141
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
142 142
       logAppDown_list({
143
+        regionid: 1,
144
+        schoolid: 1,
143 145
         page: this.searchForm.page,
144 146
         size: this.searchForm.size,
145 147
         begindate: _begindate,

+ 50
- 1
src/views/schoolSection/log/deviceEvents.vue View File

@@ -72,6 +72,7 @@
72 72
 
73 73
 <script>
74 74
 import { dateFormat, doEventInfo } from "@/utils";
75
+import { exportToExcel } from "@/utils/exportToExcel";
75 76
 import { logdoperate_list_event } from "@/api/log";
76 77
 export default {
77 78
   data() {
@@ -138,6 +139,7 @@ export default {
138 139
         {
139 140
           title: "违规",
140 141
           slot: "violatedSlot",
142
+          width: 70,
141 143
           align: "center"
142 144
         },
143 145
         {
@@ -176,6 +178,8 @@ export default {
176 178
       let _enddate = this.searchForm.dataRange[1];
177 179
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
178 180
       logdoperate_list_event({
181
+        regionid: 3,
182
+        schoolid: 1,
179 183
         page: this.searchForm.page,
180 184
         size: this.searchForm.size,
181 185
         doEvent: this.searchForm.doEvent,
@@ -191,7 +195,52 @@ export default {
191 195
         }
192 196
       });
193 197
     },
194
-    toExport() {}
198
+    toExport() {
199
+      let _begindate = this.searchForm.dataRange[0];
200
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
201
+      let _enddate = this.searchForm.dataRange[1];
202
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
203
+      logdoperate_list_event({
204
+        regionid: 3,
205
+        schoolid: 1,
206
+        doEvent: this.searchForm.doEvent,
207
+        begindate: _begindate,
208
+        enddate: _enddate,
209
+        name: this.searchForm.name
210
+      }).then((data) => {
211
+        if (data.code === 0) {
212
+          exportToExcel(
213
+            [
214
+              {
215
+                list: data.obj.data.map((item) => {
216
+                  return {
217
+                    学校名称: item.schoolName,
218
+                    班级: item.classname,
219
+                    登录名: item.loginname,
220
+                    姓名: item.username,
221
+                    设备号码: item.sn,
222
+                    事件: this.doEventInfo[item.doEvent],
223
+                    描述: item.comm,
224
+                    // 0不违规1违规
225
+                    违规:
226
+                      item.violated === 1
227
+                        ? "违规"
228
+                        : item.violated === 0
229
+                        ? "不违规"
230
+                        : "",
231
+                    时间: item.createtime
232
+                  };
233
+                }),
234
+                name: "设备事件日志"
235
+              }
236
+            ],
237
+            "设备事件日志"
238
+          );
239
+        } else {
240
+          this.$Message.error(data.msg);
241
+        }
242
+      });
243
+    }
195 244
   }
196 245
 };
197 246
 </script>

+ 60
- 21
src/views/schoolSection/log/deviceExport.vue View File

@@ -15,13 +15,7 @@
15 15
       >
16 16
     </div>
17 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>
18
+      <Table :columns="columns" :data="searchForm.list"></Table>
25 19
     </div>
26 20
     <div class="page_wrap">
27 21
       <Page
@@ -40,7 +34,8 @@
40 34
 </template>
41 35
 
42 36
 <script>
43
-import { logDeviceBind_list } from "@/api/log";
37
+import { exportToExcel } from "@/utils/exportToExcel";
38
+import { logDeviceBind_list_school } from "@/api/log";
44 39
 export default {
45 40
   data() {
46 41
     return {
@@ -66,29 +61,39 @@ export default {
66 61
           }
67 62
         },
68 63
         {
69
-          title: "区域名称",
70
-          key: "regionName",
64
+          title: "设备号码",
65
+          key: "sn",
71 66
           align: "center"
72 67
         },
73 68
         {
74
-          title: "学校数",
75
-          key: "schoolnum",
69
+          title: "登录名",
70
+          key: "loginname",
76 71
           align: "center"
77 72
         },
78 73
         {
79
-          title: "用户数",
80
-          key: "usernum",
74
+          title: "姓名",
75
+          key: "username",
81 76
           align: "center"
82 77
         },
83 78
         {
84
-          title: "设备数",
85
-          key: "snnum",
79
+          title: "学校名称",
80
+          key: "schoolName",
86 81
           align: "center"
87 82
         },
88 83
         {
89
-          title: "操作",
90
-          slot: "actionSlot",
91
-          width: 90,
84
+          title: "班级",
85
+          key: "classname",
86
+          align: "center"
87
+        },
88
+        {
89
+          title: "地址",
90
+          key: "deviceMac",
91
+          align: "center"
92
+        },
93
+        {
94
+          title: "时间",
95
+          key: "createtime",
96
+          width: 190,
92 97
           align: "center"
93 98
         }
94 99
       ]
@@ -116,7 +121,9 @@ export default {
116 121
     },
117 122
     // 获取列表
118 123
     getList() {
119
-      logDeviceBind_list({
124
+      logDeviceBind_list_school({
125
+        regionid: 1,
126
+        schoolid: 1,
120 127
         page: this.searchForm.page,
121 128
         size: this.searchForm.size,
122 129
         name: this.searchForm.name
@@ -129,7 +136,39 @@ export default {
129 136
         }
130 137
       });
131 138
     },
132
-    toExport() {}
139
+    toExport() {
140
+      logDeviceBind_list_school({
141
+        regionid: 1,
142
+        schoolid: 1,
143
+        page: this.searchForm.page,
144
+        size: this.searchForm.size,
145
+        name: this.searchForm.name
146
+      }).then((data) => {
147
+        if (data.code === 0) {
148
+          exportToExcel(
149
+            [
150
+              {
151
+                list: data.obj.data.map((item) => {
152
+                  return {
153
+                    设备号码: item.sn,
154
+                    登录名: item.loginname,
155
+                    姓名: item.username,
156
+                    学校名称: item.schoolName,
157
+                    班级: item.classname,
158
+                    地址: item.deviceMac,
159
+                    时间: item.createtime
160
+                  };
161
+                }),
162
+                name: "设备导出"
163
+              }
164
+            ],
165
+            "设备导出"
166
+          );
167
+        } else {
168
+          this.$Message.error(data.msg);
169
+        }
170
+      });
171
+    }
133 172
   }
134 173
 };
135 174
 </script>

+ 3
- 6
src/views/schoolSection/log/deviceInstallation.vue View File

@@ -89,7 +89,7 @@ export default {
89 89
         },
90 90
         {
91 91
           title: "姓名",
92
-          key: "aname",
92
+          key: "username",
93 93
           align: "center"
94 94
         },
95 95
         {
@@ -112,11 +112,6 @@ export default {
112 112
           key: "versionName",
113 113
           align: "center"
114 114
         },
115
-        {
116
-          title: "版本号",
117
-          key: "versionNum",
118
-          align: "center"
119
-        },
120 115
         {
121 116
           title: "上报时间",
122 117
           key: "createtime",
@@ -153,6 +148,8 @@ export default {
153 148
       let _enddate = this.searchForm.dataRange[1];
154 149
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
155 150
       logAppStart_list_install({
151
+        regionid: 1,
152
+        schoolid: 1,
156 153
         page: this.searchForm.page,
157 154
         size: this.searchForm.size,
158 155
         begindate: _begindate,

+ 38
- 1
src/views/schoolSection/log/deviceLocation.vue View File

@@ -46,6 +46,7 @@
46 46
 
47 47
 <script>
48 48
 import { dateFormat } from "@/utils";
49
+import { exportToExcel } from "@/utils/exportToExcel";
49 50
 import { logDeviceLogin_list } from "@/api/log";
50 51
 export default {
51 52
   data() {
@@ -138,6 +139,8 @@ export default {
138 139
       let _enddate = this.searchForm.dataRange[1];
139 140
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
140 141
       logDeviceLogin_list({
142
+        regionid: 1,
143
+        schoolid: 1,
141 144
         page: this.searchForm.page,
142 145
         size: this.searchForm.size,
143 146
         begindate: _begindate,
@@ -152,7 +155,41 @@ export default {
152 155
         }
153 156
       });
154 157
     },
155
-    toExport() {}
158
+    toExport() {
159
+      let _begindate = this.searchForm.dataRange[0];
160
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
161
+      let _enddate = this.searchForm.dataRange[1];
162
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
163
+      logDeviceLogin_list({
164
+        begindate: _begindate,
165
+        enddate: _enddate,
166
+        name: this.searchForm.name
167
+      }).then((data) => {
168
+        if (data.code === 0) {
169
+          exportToExcel(
170
+            [
171
+              {
172
+                list: data.obj.data.map((item) => {
173
+                  return {
174
+                    设备号码: item.sn,
175
+                    登录名: item.loginname,
176
+                    姓名: item.username,
177
+                    学校名称: item.schoolName,
178
+                    班级: item.classname,
179
+                    地址: item.ipAddress,
180
+                    时间: item.createtime
181
+                  };
182
+                }),
183
+                name: "设备位置日志"
184
+              }
185
+            ],
186
+            "设备位置日志"
187
+          );
188
+        } else {
189
+          this.$Message.error(data.msg);
190
+        }
191
+      });
192
+    }
156 193
   }
157 194
 };
158 195
 </script>

+ 2
- 0
src/views/schoolSection/log/devicePush.vue View File

@@ -131,6 +131,8 @@ export default {
131 131
       let _enddate = this.searchForm.dataRange[1];
132 132
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
133 133
       logPush_list({
134
+        regionid: 1,
135
+        schoolid: 1,
134 136
         page: this.searchForm.page,
135 137
         size: this.searchForm.size,
136 138
         begindate: _begindate,

+ 53
- 1
src/views/schoolSection/log/violatingDevice.vue View File

@@ -100,6 +100,7 @@
100 100
 
101 101
 <script>
102 102
 import { dateFormat, doEventInfo } from "@/utils";
103
+import { exportToExcel } from "@/utils/exportToExcel";
103 104
 import { logdoperate_list_violate } from "@/api/log";
104 105
 export default {
105 106
   data() {
@@ -161,26 +162,31 @@ export default {
161 162
         {
162 163
           title: "通知",
163 164
           slot: "noticedSlot",
165
+          width: 70,
164 166
           align: "center"
165 167
         },
166 168
         {
167 169
           title: "锁定",
168 170
           slot: "lockedSlot",
171
+          width: 70,
169 172
           align: "center"
170 173
         },
171 174
         {
172 175
           title: "重置",
173 176
           slot: "resetedSlot",
177
+          width: 70,
174 178
           align: "center"
175 179
         },
176 180
         {
177 181
           title: "发邮件",
178 182
           slot: "emailedSlot",
183
+          width: 80,
179 184
           align: "center"
180 185
         },
181 186
         {
182 187
           title: "处理结果",
183 188
           slot: "handledSlot",
189
+          width: 100,
184 190
           align: "center"
185 191
         },
186 192
         {
@@ -219,6 +225,8 @@ export default {
219 225
       let _enddate = this.searchForm.dataRange[1];
220 226
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
221 227
       logdoperate_list_violate({
228
+        regionid: 1,
229
+        schoolid: 1,
222 230
         page: this.searchForm.page,
223 231
         size: this.searchForm.size,
224 232
         doEvent: this.searchForm.doEvent,
@@ -234,7 +242,51 @@ export default {
234 242
         }
235 243
       });
236 244
     },
237
-    toExport() {}
245
+    toExport() {
246
+      let _begindate = this.searchForm.dataRange[0];
247
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
248
+      let _enddate = this.searchForm.dataRange[1];
249
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
250
+      logdoperate_list_violate({
251
+        regionid: 1,
252
+        schoolid: 1,
253
+        page: this.searchForm.page,
254
+        size: this.searchForm.size,
255
+        doEvent: this.searchForm.doEvent,
256
+        begindate: _begindate,
257
+        enddate: _enddate,
258
+        name: this.searchForm.name
259
+      }).then((data) => {
260
+        if (data.code === 0) {
261
+          exportToExcel(
262
+            [
263
+              {
264
+                list: data.obj.data.map((item) => {
265
+                  return {
266
+                    学校名称: item.schoolName,
267
+                    班级: item.classname,
268
+                    登录名: item.loginname,
269
+                    姓名: item.username,
270
+                    设备号码: item.sn,
271
+                    事件: this.doEventInfo[item.doEvent],
272
+                    通知: item.noticed === 1 ? "是" : "否",
273
+                    锁定: item.locked === 1 ? "是" : "否",
274
+                    重置: item.reseted === 1 ? "是" : "否",
275
+                    发邮件: item.emailed === 1 ? "是" : "否",
276
+                    处理结果: item.handled === 1 ? "是" : "否",
277
+                    时间: item.createtime
278
+                  };
279
+                }),
280
+                name: "违规设备日志"
281
+              }
282
+            ],
283
+            "违规设备日志"
284
+          );
285
+        } else {
286
+          this.$Message.error(data.msg);
287
+        }
288
+      });
289
+    }
238 290
   }
239 291
 };
240 292
 </script>

Loading…
Cancel
Save