瀏覽代碼

日志导出

gzb
guozhongbo 9 月之前
父節點
當前提交
dc680e68c6

+ 21
- 2
src/api/log.js 查看文件

@@ -21,6 +21,11 @@ export const logPush_add = (data) => setRequest("logPush/add", data);
21 21
  */
22 22
 export const logDeviceLogin_list = (data) =>
23 23
   setRequest("logDeviceLogin/list", data);
24
+/**
25
+ * 7.3.2 设备位置日志-所有(导出)
26
+ */
27
+export const logDeviceLogin_list_all = (data) =>
28
+    setRequest("logDeviceLogin/list_all", data);
24 29
 /**
25 30
  * 7.4.1 设备事件日志-列表
26 31
  */
@@ -30,11 +35,20 @@ export const logdoperate_list_event = (data) =>
30 35
  * 7.4.2 设备事件日志-添加
31 36
  */
32 37
 export const logdoperate_add = (data) => setRequest("logdoperate/add", data);
38
+/**
39
+ * 7.4.3 设备事件日志-所有(导出)
40
+ */
41
+export const logdoperate_list_event_all = (data) => setRequest("logdoperate/list_event_all", data);
33 42
 /**
34 43
  * 7.5.1 设备违规日志-列表
35 44
  */
36 45
 export const logdoperate_list_violate = (data) =>
37 46
   setRequest("logdoperate/list_violate", data);
47
+/**
48
+ * 7.5.2 设备违规日志-所有(导出)
49
+ */
50
+export const logdoperate_list_violate_all = (data) =>
51
+    setRequest("logdoperate/list_violate_all", data);
38 52
 /**
39 53
  * 7.6.1 应用下载日志-列表
40 54
  */
@@ -55,8 +69,13 @@ export const logAppStart_add = (data) => setRequest("logAppStart/add", data);
55 69
 /**
56 70
  * 7.8.1 设备已安装应用-列表
57 71
  */
58
-export const logAppStart_list_install = (data) =>
59
-  setRequest("logAppStart/list_install", data);
72
+export const logAppDown_list_install = (data) =>
73
+  setRequest("logAppDown/list_install", data);
74
+/**
75
+ * 7.8.2 设备已安装应用-所有(导出)
76
+ */
77
+export const logAppDown_list_install_all = (data) =>
78
+    setRequest("logAppDown/list_install_all", data);
60 79
 /**
61 80
  * 7.9.1 设备导出-列表(平台、区域)
62 81
  */

+ 4
- 0
src/api/school.js 查看文件

@@ -35,6 +35,10 @@ export const school_delete = (data) => setRequest("school/delete", data);
35 35
  * 3.1.5学校--详情
36 36
  */
37 37
 export const school_detail = (data) => setRequest("school/detail", data);
38
+/**
39
+ * 3.1.6学校--区域下学校列表
40
+ */
41
+export const school_list_rs = (data) => setRequest("school/list_rs", data);
38 42
 /**
39 43
  * 3.2.0.1用户--账号登录
40 44
  */

+ 1
- 1
src/views/regionSection/log/admin.vue 查看文件

@@ -101,7 +101,7 @@ export default {
101 101
   },
102 102
   created() {
103 103
     this.userInfo = JSON.parse(
104
-        localStorage.getItem("xh_control_userInfo")
104
+      localStorage.getItem("xh_control_userInfo")
105 105
     ).content;
106 106
     this.searchList();
107 107
   },

+ 12
- 3
src/views/regionSection/log/deviceEvents.vue 查看文件

@@ -67,16 +67,21 @@
67 67
         show-sizer
68 68
       ></Page>
69 69
     </div>
70
+    <Spin fix v-if="showLoading" style="background-color: transparent">
71
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
72
+      <div>加载中</div>
73
+    </Spin>
70 74
   </div>
71 75
 </template>
72 76
 
73 77
 <script>
74 78
 import { dateFormat, doEventInfo } from "@/utils";
75
-import { logdoperate_list_event } from "@/api/log";
79
+import { logdoperate_list_event, logdoperate_list_event_all } from "@/api/log";
76 80
 import { exportToExcel } from "@/utils/exportToExcel";
77 81
 export default {
78 82
   data() {
79 83
     return {
84
+      showLoading: false,
80 85
       doEventInfo,
81 86
       searchForm: {
82 87
         dataRange: [],
@@ -185,6 +190,7 @@ export default {
185 190
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
186 191
       let _enddate = this.searchForm.dataRange[1];
187 192
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
193
+      this.showLoading = true;
188 194
       logdoperate_list_event({
189 195
         rtype: this.powerParams.rtype,
190 196
         objectid: this.powerParams.objectid,
@@ -196,6 +202,7 @@ export default {
196 202
         enddate: _enddate,
197 203
         name: this.searchForm.name
198 204
       }).then((data) => {
205
+        this.showLoading = false;
199 206
         if (data.code === 0) {
200 207
           this.searchForm.list = data.obj.data;
201 208
           this.searchForm.total = data.obj.total;
@@ -209,7 +216,8 @@ export default {
209 216
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
210 217
       let _enddate = this.searchForm.dataRange[1];
211 218
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
212
-      logdoperate_list_event({
219
+      this.showLoading = true;
220
+      logdoperate_list_event_all({
213 221
         rtype: this.powerParams.rtype,
214 222
         objectid: this.powerParams.objectid,
215 223
         regionid: this.powerParams.objectid,
@@ -218,11 +226,12 @@ export default {
218 226
         enddate: _enddate,
219 227
         name: this.searchForm.name
220 228
       }).then((data) => {
229
+        this.showLoading = false;
221 230
         if (data.code === 0) {
222 231
           exportToExcel(
223 232
             [
224 233
               {
225
-                list: data.obj.data.map((item) => {
234
+                list: data.obj.map((item) => {
226 235
                   return {
227 236
                     学校名称: item.schoolName,
228 237
                     班级: item.classname,

+ 95
- 24
src/views/regionSection/log/deviceExport.vue 查看文件

@@ -14,6 +14,22 @@
14 14
             ></Tree>
15 15
           </div>
16 16
         </div>
17
+        <Select
18
+          :transfer="true"
19
+          v-model="searchForm.schoolid"
20
+          @on-change="searchList()"
21
+          style="width: 180px; margin-left: 10px"
22
+        >
23
+          <template v-if="school_list.length > 0">
24
+            <Option :value="0">所有学校</Option>
25
+            <Option
26
+              v-for="item in school_list"
27
+              :value="item.schoolid"
28
+              :key="item.schoolid"
29
+              >{{ item.schoolName }}</Option
30
+            >
31
+          </template>
32
+        </Select>
17 33
       </div>
18 34
       <Button type="primary" class="primary_btn" @click="toExport()"
19 35
         >导出</Button
@@ -45,17 +61,25 @@
45 61
         show-sizer
46 62
       ></Page>
47 63
     </div>
64
+    <Spin fix v-if="showLoading" style="background-color: transparent">
65
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
66
+      <div>加载中</div>
67
+    </Spin>
48 68
   </div>
49 69
 </template>
50 70
 
51 71
 <script>
52
-import { logDeviceBind_list_region } from "@/api/log";
72
+import { logDeviceBind_list_region, logDeviceBind_list_user } from "@/api/log";
53 73
 import { region_list_sel_tree } from "@/api/region";
74
+import { exportToExcel } from "@/utils/exportToExcel";
75
+import { school_list_rs } from "@/api/school";
54 76
 export default {
55 77
   data() {
56 78
     return {
79
+      showLoading: false,
57 80
       searchForm: {
58 81
         regionid: 0,
82
+        schoolid: 0,
59 83
         title: "所有区域",
60 84
         page: 1,
61 85
         size: 10,
@@ -141,7 +165,6 @@ export default {
141 165
       localStorage.getItem("xh_control_userInfo")
142 166
     ).content;
143 167
     this.init();
144
-    this.searchList();
145 168
   },
146 169
   mounted() {
147 170
     window.addEventListener("click", () => {
@@ -152,30 +175,42 @@ export default {
152 175
     headerTree() {
153 176
       //打开树形区域列表
154 177
       this.isshowtree = true;
178
+      console.log(this.isshowtree);
155 179
     },
156
-    getSelectedNodes(data) {
180
+    async getSelectedNodes(data) {
157 181
       this.searchForm.title = data[0].title;
158 182
       this.searchForm.regionid = data[0].regionid;
183
+      this.searchForm.schoolid = 0;
184
+      await this.getSchoolList();
159 185
       this.searchList();
160 186
     },
161
-    init() {
162
-      region_list_sel_tree({ regionid: this.powerParams.objectid }).then(
163
-        (res) => {
164
-          if (res.code === 0) {
165
-            this.setRegionList(res.obj[0]);
166
-            this.region_list = res.obj;
167
-            this.region_list.unshift({
168
-              title: "所有区域",
169
-              regionid: 0,
170
-              children: []
171
-            });
172
-
173
-            console.log(this.region_list);
174
-          } else {
175
-            this.$Message.error(res.msg);
176
-          }
177
-        }
178
-      );
187
+    async init() {
188
+      this.showLoading = true;
189
+      let res = await region_list_sel_tree({
190
+        regionid: this.powerParams.objectid
191
+      });
192
+      this.showLoading = false;
193
+      if (res.code === 0) {
194
+        this.setRegionList(res.obj[0]);
195
+        this.region_list = res.obj;
196
+        this.searchForm.regionid = this.region_list[0].regionid;
197
+        this.searchForm.title = this.region_list[0].title;
198
+      } else {
199
+        this.$Message.error(res.msg);
200
+      }
201
+      this.searchForm.schoolid = 0;
202
+      await this.getSchoolList();
203
+      this.searchList();
204
+    },
205
+    async getSchoolList() {
206
+      this.showLoading = true;
207
+      let res = await school_list_rs({ regionid: this.searchForm.regionid });
208
+      this.showLoading = false;
209
+      if (res.code === 0) {
210
+        this.school_list = res.obj;
211
+      } else {
212
+        this.$Message.error(res.msg);
213
+      }
179 214
     },
180 215
     setRegionList(node) {
181 216
       node.title = node.regionName;
@@ -204,23 +239,59 @@ export default {
204 239
     },
205 240
     // 获取列表
206 241
     getList() {
242
+      this.showLoading = true;
207 243
       logDeviceBind_list_region({
208 244
         rtype: this.powerParams.rtype,
209 245
         objectid: this.powerParams.objectid,
210 246
         page: this.searchForm.page,
211 247
         size: this.searchForm.size,
212
-        regionid: this.searchForm.regionid
248
+        regionid: this.searchForm.regionid,
249
+        schoolid: this.searchForm.schoolid
213 250
       }).then((data) => {
251
+        this.showLoading = false;
214 252
         if (data.code === 0) {
215 253
           this.searchForm.list = data.obj.data;
216 254
           this.searchForm.total = data.obj.total;
217
-          console.log(this.searchForm.list);
218 255
         } else {
219 256
           this.$Message.error(data.msg);
220 257
         }
221 258
       });
222 259
     },
223
-    toExport() {}
260
+    toExport() {
261
+      this.showLoading = true;
262
+      logDeviceBind_list_user({
263
+        regionid: this.searchForm.regionid,
264
+        schoolid: this.searchForm.schoolid
265
+      }).then((res) => {
266
+        this.showLoading = false;
267
+        if (res.code === 0) {
268
+          let name = "";
269
+          exportToExcel(
270
+            [
271
+              {
272
+                list: res.obj.map((item) => {
273
+                  return {
274
+                    学校名称: item.schoolName,
275
+                    班级: item.classname,
276
+                    登录名: item.loginname,
277
+                    姓名: item.username,
278
+                    设备号码: item.sn,
279
+                    设备型号: item.deviceModel,
280
+                    Rom版本: item.romVersion,
281
+                    违规: item.violated === 1 ? "是" : "否",
282
+                    更新时间: item.createtime
283
+                  };
284
+                }),
285
+                name: "设备导出"
286
+              }
287
+            ],
288
+            "设备导出"
289
+          );
290
+        } else {
291
+          this.$Message.error(res.msg);
292
+        }
293
+      });
294
+    }
224 295
   }
225 296
 };
226 297
 </script>

+ 21
- 9
src/views/regionSection/log/deviceInstallation.vue 查看文件

@@ -41,12 +41,20 @@
41 41
         show-sizer
42 42
       ></Page>
43 43
     </div>
44
+    <Spin fix v-if="showLoading" style="background-color: transparent">
45
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
46
+      <div>加载中</div>
47
+    </Spin>
44 48
   </div>
45 49
 </template>
46 50
 
47 51
 <script>
48 52
 import { dateFormat } from "@/utils";
49
-import { logAppStart_list_install } from "@/api/log";
53
+import {
54
+  logAppDown_list_install,
55
+  logAppDown_list_install_all,
56
+  logAppStart_list_install
57
+} from "@/api/log";
50 58
 import { exportToExcel } from "@/utils/exportToExcel";
51 59
 export default {
52 60
   data() {
@@ -111,12 +119,12 @@ export default {
111 119
         },
112 120
         {
113 121
           title: "版本名称",
114
-          key: "versionName",
122
+          key: "appVersion",
115 123
           align: "center"
116 124
         },
117 125
         {
118 126
           title: "版本号",
119
-          key: "versionNum",
127
+          key: "appNum",
120 128
           align: "center"
121 129
         },
122 130
         {
@@ -162,7 +170,8 @@ export default {
162 170
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
163 171
       let _enddate = this.searchForm.dataRange[1];
164 172
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
165
-      logAppStart_list_install({
173
+      this.showLoading = true;
174
+      logAppDown_list_install({
166 175
         rtype: this.powerParams.rtype,
167 176
         objectid: this.powerParams.objectid,
168 177
         regionid: this.powerParams.objectid,
@@ -172,6 +181,7 @@ export default {
172 181
         enddate: _enddate,
173 182
         name: this.searchForm.name
174 183
       }).then((data) => {
184
+        this.showLoading = false;
175 185
         if (data.code === 0) {
176 186
           this.searchForm.list = data.obj.data;
177 187
           this.searchForm.total = data.obj.total;
@@ -185,7 +195,8 @@ export default {
185 195
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
186 196
       let _enddate = this.searchForm.dataRange[1];
187 197
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
188
-      logAppStart_list_install({
198
+      this.showLoading = true;
199
+      logAppDown_list_install_all({
189 200
         rtype: this.powerParams.rtype,
190 201
         objectid: this.powerParams.objectid,
191 202
         regionid: this.powerParams.objectid,
@@ -193,11 +204,12 @@ export default {
193 204
         enddate: _enddate,
194 205
         name: this.searchForm.name
195 206
       }).then((data) => {
207
+        this.showLoading = false;
196 208
         if (data.code === 0) {
197 209
           exportToExcel(
198 210
             [
199 211
               {
200
-                list: data.obj.data.map((item) => {
212
+                list: data.obj.map((item) => {
201 213
                   return {
202 214
                     学校名称: item.schoolName,
203 215
                     班级: item.classname,
@@ -205,9 +217,9 @@ export default {
205 217
                     姓名: item.username,
206 218
                     设备号码: item.sn,
207 219
                     应用名称: item.appName,
208
-                    应用包名: item.appPackage,
209
-                    版本名称: item.versionName,
210
-                    版本号: item.versionNum,
220
+                    应用包名: item.appPackage || "",
221
+                    版本名称: item.appVersion || "",
222
+                    版本号: item.appNum || "",
211 223
                     上报时间: item.createtime
212 224
                   };
213 225
                 }),

+ 12
- 3
src/views/regionSection/log/deviceLocation.vue 查看文件

@@ -41,16 +41,21 @@
41 41
         show-sizer
42 42
       ></Page>
43 43
     </div>
44
+    <Spin fix v-if="showLoading" style="background-color: transparent">
45
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
46
+      <div>加载中</div>
47
+    </Spin>
44 48
   </div>
45 49
 </template>
46 50
 
47 51
 <script>
48 52
 import { dateFormat } from "@/utils";
49
-import { logDeviceLogin_list } from "@/api/log";
53
+import {logDeviceLogin_list, logDeviceLogin_list_all} from "@/api/log";
50 54
 import { exportToExcel } from "@/utils/exportToExcel";
51 55
 export default {
52 56
   data() {
53 57
     return {
58
+      showLoading: false,
54 59
       searchForm: {
55 60
         dataRange: [],
56 61
         name: "",
@@ -150,6 +155,7 @@ export default {
150 155
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
151 156
       let _enddate = this.searchForm.dataRange[1];
152 157
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
158
+      this.showLoading = true;
153 159
       logDeviceLogin_list({
154 160
         rtype: this.powerParams.rtype,
155 161
         objectid: this.powerParams.objectid,
@@ -160,6 +166,7 @@ export default {
160 166
         enddate: _enddate,
161 167
         name: this.searchForm.name
162 168
       }).then((data) => {
169
+        this.showLoading = false;
163 170
         if (data.code === 0) {
164 171
           this.searchForm.list = data.obj.data;
165 172
           this.searchForm.total = data.obj.total;
@@ -173,7 +180,8 @@ export default {
173 180
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
174 181
       let _enddate = this.searchForm.dataRange[1];
175 182
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
176
-      logDeviceLogin_list({
183
+      this.showLoading = true;
184
+      logDeviceLogin_list_all({
177 185
         rtype: this.powerParams.rtype,
178 186
         objectid: this.powerParams.objectid,
179 187
         regionid: this.powerParams.objectid,
@@ -181,11 +189,12 @@ export default {
181 189
         enddate: _enddate,
182 190
         name: this.searchForm.name
183 191
       }).then((data) => {
192
+        this.showLoading = false;
184 193
         if (data.code === 0) {
185 194
           exportToExcel(
186 195
             [
187 196
               {
188
-                list: data.obj.data.map((item) => {
197
+                list: data.obj.map((item) => {
189 198
                   return {
190 199
                     设备号码: item.sn,
191 200
                     登录名: item.loginname,

+ 15
- 3
src/views/regionSection/log/violatingDevice.vue 查看文件

@@ -95,16 +95,24 @@
95 95
         show-sizer
96 96
       ></Page>
97 97
     </div>
98
+    <Spin fix v-if="showLoading" style="background-color: transparent">
99
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
100
+      <div>加载中</div>
101
+    </Spin>
98 102
   </div>
99 103
 </template>
100 104
 
101 105
 <script>
102 106
 import { dateFormat, doEventInfo } from "@/utils";
103
-import { logdoperate_list_violate } from "@/api/log";
107
+import {
108
+  logdoperate_list_violate,
109
+  logdoperate_list_violate_all
110
+} from "@/api/log";
104 111
 import { exportToExcel } from "@/utils/exportToExcel";
105 112
 export default {
106 113
   data() {
107 114
     return {
115
+      showLoading: false,
108 116
       doEventInfo,
109 117
       searchForm: {
110 118
         dataRange: [],
@@ -228,6 +236,7 @@ export default {
228 236
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
229 237
       let _enddate = this.searchForm.dataRange[1];
230 238
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
239
+      this.showLoading = true;
231 240
       logdoperate_list_violate({
232 241
         rtype: this.powerParams.rtype,
233 242
         objectid: this.powerParams.objectid,
@@ -239,6 +248,7 @@ export default {
239 248
         enddate: _enddate,
240 249
         name: this.searchForm.name
241 250
       }).then((data) => {
251
+        this.showLoading = false;
242 252
         if (data.code === 0) {
243 253
           this.searchForm.list = data.obj.data;
244 254
           this.searchForm.total = data.obj.total;
@@ -252,7 +262,8 @@ export default {
252 262
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
253 263
       let _enddate = this.searchForm.dataRange[1];
254 264
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
255
-      logdoperate_list_violate({
265
+      this.showLoading = true;
266
+      logdoperate_list_violate_all({
256 267
         rtype: this.powerParams.rtype,
257 268
         objectid: this.powerParams.objectid,
258 269
         regionid: this.powerParams.objectid,
@@ -261,11 +272,12 @@ export default {
261 272
         enddate: _enddate,
262 273
         name: this.searchForm.name
263 274
       }).then((data) => {
275
+        this.showLoading = false;
264 276
         if (data.code === 0) {
265 277
           exportToExcel(
266 278
             [
267 279
               {
268
-                list: data.obj.data.map((item) => {
280
+                list: data.obj.map((item) => {
269 281
                   return {
270 282
                     学校名称: item.schoolName,
271 283
                     班级: item.classname,

Loading…
取消
儲存