Browse Source

学校日志导出

gzb
wangzhonglu 9 months ago
parent
commit
225fd03e79

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

10
           style="width: 150px"
10
           style="width: 150px"
11
         />
11
         />
12
       </div>
12
       </div>
13
-      <!-- <Button type="primary" class="primary_btn" @click="toExport()"
13
+      <Button type="primary" class="primary_btn" @click="toExport()"
14
         >导出</Button
14
         >导出</Button
15
-      > -->
15
+      >
16
     </div>
16
     </div>
17
     <div class="table_wrap">
17
     <div class="table_wrap">
18
       <Table :columns="columns" :data="searchForm.list">
18
       <Table :columns="columns" :data="searchForm.list">
131
       });
131
       });
132
     },
132
     },
133
     toExport(row) {
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
             其他操作<Icon type="ios-arrow-down" class="arrow_down" />
25
             其他操作<Icon type="ios-arrow-down" class="arrow_down" />
26
           </div>
26
           </div>
27
           <DropdownMenu slot="list">
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
           </DropdownMenu>
35
           </DropdownMenu>
31
         </Dropdown>
36
         </Dropdown>
32
       </div>
37
       </div>
128
           align: "center"
133
           align: "center"
129
         },
134
         },
130
         {
135
         {
131
-          title: "违规详情",
136
+          title: "操作中",
132
           key: "num",
137
           key: "num",
133
           width: 100,
138
           width: 100,
134
           align: "center"
139
           align: "center"

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

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

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

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

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

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

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

72
 
72
 
73
 <script>
73
 <script>
74
 import { dateFormat, doEventInfo } from "@/utils";
74
 import { dateFormat, doEventInfo } from "@/utils";
75
+import { exportToExcel } from "@/utils/exportToExcel";
75
 import { logdoperate_list_event } from "@/api/log";
76
 import { logdoperate_list_event } from "@/api/log";
76
 export default {
77
 export default {
77
   data() {
78
   data() {
138
         {
139
         {
139
           title: "违规",
140
           title: "违规",
140
           slot: "violatedSlot",
141
           slot: "violatedSlot",
142
+          width: 70,
141
           align: "center"
143
           align: "center"
142
         },
144
         },
143
         {
145
         {
176
       let _enddate = this.searchForm.dataRange[1];
178
       let _enddate = this.searchForm.dataRange[1];
177
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
179
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
178
       logdoperate_list_event({
180
       logdoperate_list_event({
181
+        regionid: 3,
182
+        schoolid: 1,
179
         page: this.searchForm.page,
183
         page: this.searchForm.page,
180
         size: this.searchForm.size,
184
         size: this.searchForm.size,
181
         doEvent: this.searchForm.doEvent,
185
         doEvent: this.searchForm.doEvent,
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
 </script>
246
 </script>

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

15
       >
15
       >
16
     </div>
16
     </div>
17
     <div class="table_wrap">
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
     </div>
19
     </div>
26
     <div class="page_wrap">
20
     <div class="page_wrap">
27
       <Page
21
       <Page
40
 </template>
34
 </template>
41
 
35
 
42
 <script>
36
 <script>
43
-import { logDeviceBind_list } from "@/api/log";
37
+import { exportToExcel } from "@/utils/exportToExcel";
38
+import { logDeviceBind_list_school } from "@/api/log";
44
 export default {
39
 export default {
45
   data() {
40
   data() {
46
     return {
41
     return {
66
           }
61
           }
67
         },
62
         },
68
         {
63
         {
69
-          title: "区域名称",
70
-          key: "regionName",
64
+          title: "设备号码",
65
+          key: "sn",
71
           align: "center"
66
           align: "center"
72
         },
67
         },
73
         {
68
         {
74
-          title: "学校数",
75
-          key: "schoolnum",
69
+          title: "登录名",
70
+          key: "loginname",
76
           align: "center"
71
           align: "center"
77
         },
72
         },
78
         {
73
         {
79
-          title: "用户数",
80
-          key: "usernum",
74
+          title: "姓名",
75
+          key: "username",
81
           align: "center"
76
           align: "center"
82
         },
77
         },
83
         {
78
         {
84
-          title: "设备数",
85
-          key: "snnum",
79
+          title: "学校名称",
80
+          key: "schoolName",
86
           align: "center"
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
           align: "center"
97
           align: "center"
93
         }
98
         }
94
       ]
99
       ]
116
     },
121
     },
117
     // 获取列表
122
     // 获取列表
118
     getList() {
123
     getList() {
119
-      logDeviceBind_list({
124
+      logDeviceBind_list_school({
125
+        regionid: 1,
126
+        schoolid: 1,
120
         page: this.searchForm.page,
127
         page: this.searchForm.page,
121
         size: this.searchForm.size,
128
         size: this.searchForm.size,
122
         name: this.searchForm.name
129
         name: this.searchForm.name
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
 </script>
174
 </script>

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

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

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

46
 
46
 
47
 <script>
47
 <script>
48
 import { dateFormat } from "@/utils";
48
 import { dateFormat } from "@/utils";
49
+import { exportToExcel } from "@/utils/exportToExcel";
49
 import { logDeviceLogin_list } from "@/api/log";
50
 import { logDeviceLogin_list } from "@/api/log";
50
 export default {
51
 export default {
51
   data() {
52
   data() {
138
       let _enddate = this.searchForm.dataRange[1];
139
       let _enddate = this.searchForm.dataRange[1];
139
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
140
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
140
       logDeviceLogin_list({
141
       logDeviceLogin_list({
142
+        regionid: 1,
143
+        schoolid: 1,
141
         page: this.searchForm.page,
144
         page: this.searchForm.page,
142
         size: this.searchForm.size,
145
         size: this.searchForm.size,
143
         begindate: _begindate,
146
         begindate: _begindate,
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
 </script>
195
 </script>

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

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

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

100
 
100
 
101
 <script>
101
 <script>
102
 import { dateFormat, doEventInfo } from "@/utils";
102
 import { dateFormat, doEventInfo } from "@/utils";
103
+import { exportToExcel } from "@/utils/exportToExcel";
103
 import { logdoperate_list_violate } from "@/api/log";
104
 import { logdoperate_list_violate } from "@/api/log";
104
 export default {
105
 export default {
105
   data() {
106
   data() {
161
         {
162
         {
162
           title: "通知",
163
           title: "通知",
163
           slot: "noticedSlot",
164
           slot: "noticedSlot",
165
+          width: 70,
164
           align: "center"
166
           align: "center"
165
         },
167
         },
166
         {
168
         {
167
           title: "锁定",
169
           title: "锁定",
168
           slot: "lockedSlot",
170
           slot: "lockedSlot",
171
+          width: 70,
169
           align: "center"
172
           align: "center"
170
         },
173
         },
171
         {
174
         {
172
           title: "重置",
175
           title: "重置",
173
           slot: "resetedSlot",
176
           slot: "resetedSlot",
177
+          width: 70,
174
           align: "center"
178
           align: "center"
175
         },
179
         },
176
         {
180
         {
177
           title: "发邮件",
181
           title: "发邮件",
178
           slot: "emailedSlot",
182
           slot: "emailedSlot",
183
+          width: 80,
179
           align: "center"
184
           align: "center"
180
         },
185
         },
181
         {
186
         {
182
           title: "处理结果",
187
           title: "处理结果",
183
           slot: "handledSlot",
188
           slot: "handledSlot",
189
+          width: 100,
184
           align: "center"
190
           align: "center"
185
         },
191
         },
186
         {
192
         {
219
       let _enddate = this.searchForm.dataRange[1];
225
       let _enddate = this.searchForm.dataRange[1];
220
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
226
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
221
       logdoperate_list_violate({
227
       logdoperate_list_violate({
228
+        regionid: 1,
229
+        schoolid: 1,
222
         page: this.searchForm.page,
230
         page: this.searchForm.page,
223
         size: this.searchForm.size,
231
         size: this.searchForm.size,
224
         doEvent: this.searchForm.doEvent,
232
         doEvent: this.searchForm.doEvent,
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
 </script>
292
 </script>

Loading…
Cancel
Save