|
@@ -44,30 +44,42 @@
|
44
|
44
|
/>
|
45
|
45
|
</div>
|
46
|
46
|
<div class="search_right">
|
47
|
|
- <Button type="primary" class="primary_btn" style="margin-right: 10px"
|
|
47
|
+ <Button
|
|
48
|
+ type="primary"
|
|
49
|
+ class="primary_btn"
|
|
50
|
+ style="margin-right: 10px"
|
|
51
|
+ @click="toDeviceExport()"
|
48
|
52
|
>设备导出</Button
|
49
|
53
|
>
|
50
|
|
- <Button type="primary" class="primary_btn" style="margin-right: 10px"
|
|
54
|
+ <Button
|
|
55
|
+ type="primary"
|
|
56
|
+ class="primary_btn"
|
|
57
|
+ style="margin-right: 10px"
|
|
58
|
+ @click="toInstallingAppExport()"
|
51
|
59
|
>安装应用导出</Button
|
52
|
60
|
>
|
53
|
|
- <Dropdown>
|
|
61
|
+ <Dropdown @on-click="dropdownSelected">
|
54
|
62
|
<div class="drop_btn">
|
55
|
63
|
其他操作<Icon type="ios-arrow-down" class="arrow_down" />
|
56
|
64
|
</div>
|
57
|
65
|
<DropdownMenu slot="list">
|
58
|
|
- <DropdownItem>恢复出厂设置</DropdownItem>
|
59
|
|
- <DropdownItem>发送消息</DropdownItem>
|
60
|
|
- <DropdownItem>整班发送消息</DropdownItem>
|
61
|
|
- <DropdownItem>解除限制</DropdownItem>
|
62
|
|
- <DropdownItem>限制使用</DropdownItem>
|
63
|
|
- <DropdownItem>更新策略</DropdownItem>
|
64
|
|
- <DropdownItem>重启设备</DropdownItem>
|
|
66
|
+ <DropdownItem name="1">恢复出厂设置</DropdownItem>
|
|
67
|
+ <DropdownItem name="2">发送消息</DropdownItem>
|
|
68
|
+ <DropdownItem name="3">整班发送消息</DropdownItem>
|
|
69
|
+ <DropdownItem name="4">解除限制</DropdownItem>
|
|
70
|
+ <DropdownItem name="5">限制使用</DropdownItem>
|
|
71
|
+ <DropdownItem name="6">更新策略</DropdownItem>
|
|
72
|
+ <DropdownItem name="7">重启设备</DropdownItem>
|
65
|
73
|
</DropdownMenu>
|
66
|
74
|
</Dropdown>
|
67
|
75
|
</div>
|
68
|
76
|
</div>
|
69
|
77
|
<div class="table_wrap">
|
70
|
|
- <Table :columns="columns" :data="searchForm.list">
|
|
78
|
+ <Table
|
|
79
|
+ :columns="columns"
|
|
80
|
+ :data="searchForm.list"
|
|
81
|
+ @on-selection-change="selectionChange"
|
|
82
|
+ >
|
71
|
83
|
<template slot-scope="{ row }" slot="onlineSlot">
|
72
|
84
|
<!-- 1在线2离线 -->
|
73
|
85
|
<div v-if="row.online === 1">在线</div>
|
|
@@ -100,8 +112,13 @@
|
100
|
112
|
</template>
|
101
|
113
|
|
102
|
114
|
<script>
|
|
115
|
+import { exportToExcel } from "@/utils/exportToExcel";
|
103
|
116
|
import { class_list } from "@/api/class";
|
104
|
|
-import { device_manager_list_d } from "@/api/device_manager";
|
|
117
|
+import {
|
|
118
|
+ device_manager_list_d,
|
|
119
|
+ device_manager_export_d,
|
|
120
|
+ device_manager_export_id
|
|
121
|
+} from "@/api/device_manager";
|
105
|
122
|
export default {
|
106
|
123
|
data() {
|
107
|
124
|
return {
|
|
@@ -114,6 +131,7 @@ export default {
|
114
|
131
|
list: [],
|
115
|
132
|
total: 0
|
116
|
133
|
},
|
|
134
|
+ tableSelection: [],
|
117
|
135
|
schoolInfo: {
|
118
|
136
|
schoolid: null,
|
119
|
137
|
schoolname: null,
|
|
@@ -185,7 +203,6 @@ export default {
|
185
|
203
|
},
|
186
|
204
|
created() {
|
187
|
205
|
this.getClassList();
|
188
|
|
- this.searchList();
|
189
|
206
|
},
|
190
|
207
|
methods: {
|
191
|
208
|
classChange(classid) {
|
|
@@ -220,6 +237,7 @@ export default {
|
220
|
237
|
schoolname: data.obj.name,
|
221
|
238
|
classList: data.obj.children
|
222
|
239
|
};
|
|
240
|
+ this.searchList();
|
223
|
241
|
} else {
|
224
|
242
|
this.$Message.error(data.msg);
|
225
|
243
|
}
|
|
@@ -227,10 +245,11 @@ export default {
|
227
|
245
|
},
|
228
|
246
|
// 获取列表
|
229
|
247
|
getList() {
|
|
248
|
+ this.tableSelection = [];
|
230
|
249
|
device_manager_list_d({
|
231
|
250
|
page: this.searchForm.page,
|
232
|
251
|
size: this.searchForm.size,
|
233
|
|
- schoolid: this.searchForm.schoolid,
|
|
252
|
+ schoolid: this.schoolInfo.schoolid,
|
234
|
253
|
classid: this.searchForm.classid,
|
235
|
254
|
atype: this.searchForm.atype,
|
236
|
255
|
name: this.searchForm.name
|
|
@@ -243,12 +262,128 @@ export default {
|
243
|
262
|
}
|
244
|
263
|
});
|
245
|
264
|
},
|
|
265
|
+ // 设备导出
|
|
266
|
+ toDeviceExport() {
|
|
267
|
+ device_manager_export_d({
|
|
268
|
+ schoolid: this.schoolInfo.schoolid,
|
|
269
|
+ classid: this.searchForm.classid,
|
|
270
|
+ atype: this.searchForm.atype,
|
|
271
|
+ name: this.searchForm.name
|
|
272
|
+ }).then((data) => {
|
|
273
|
+ if (data.code === 0) {
|
|
274
|
+ exportToExcel(
|
|
275
|
+ [
|
|
276
|
+ {
|
|
277
|
+ list: data.obj.map((item) => {
|
|
278
|
+ return {
|
|
279
|
+ 登录名: item.loginname,
|
|
280
|
+ 姓名: item.username,
|
|
281
|
+ // 1在线2离线
|
|
282
|
+ 在线状态:
|
|
283
|
+ item.online === 1
|
|
284
|
+ ? "在线"
|
|
285
|
+ : item.online === 2
|
|
286
|
+ ? "离线"
|
|
287
|
+ : "",
|
|
288
|
+ 设备型号: item.deviceModel,
|
|
289
|
+ "ID(IMEI/MEID/ESN)": item.sn,
|
|
290
|
+ Rom版本: item.romVersion,
|
|
291
|
+ 更新时间: item.updatetime
|
|
292
|
+ };
|
|
293
|
+ }),
|
|
294
|
+ name: "设备导出"
|
|
295
|
+ }
|
|
296
|
+ ],
|
|
297
|
+ "设备导出"
|
|
298
|
+ );
|
|
299
|
+ } else {
|
|
300
|
+ this.$Message.error(data.msg);
|
|
301
|
+ }
|
|
302
|
+ });
|
|
303
|
+ },
|
|
304
|
+ // 安装应用导出
|
|
305
|
+ toInstallingAppExport() {
|
|
306
|
+ device_manager_export_id({
|
|
307
|
+ schoolid: this.schoolInfo.schoolid,
|
|
308
|
+ classid: this.searchForm.classid
|
|
309
|
+ }).then((data) => {
|
|
310
|
+ if (data.code === 0) {
|
|
311
|
+ exportToExcel(
|
|
312
|
+ [
|
|
313
|
+ {
|
|
314
|
+ list: data.obj.map((item) => {
|
|
315
|
+ return {
|
|
316
|
+ 登录名: item.loginname,
|
|
317
|
+ 姓名: item.username,
|
|
318
|
+ 班级: item.classname,
|
|
319
|
+ 应用名称: item.appName,
|
|
320
|
+ 包名: item.appPackage,
|
|
321
|
+ 版本名称: item.appVersion,
|
|
322
|
+ MAC地址: item.mac,
|
|
323
|
+ 时间: item.createtime
|
|
324
|
+ };
|
|
325
|
+ }),
|
|
326
|
+ name: "安装应用导出"
|
|
327
|
+ }
|
|
328
|
+ ],
|
|
329
|
+ "安装应用导出"
|
|
330
|
+ );
|
|
331
|
+ } else {
|
|
332
|
+ this.$Message.error(data.msg);
|
|
333
|
+ }
|
|
334
|
+ });
|
|
335
|
+ },
|
246
|
336
|
// 查看
|
247
|
337
|
toView() {},
|
248
|
338
|
// 策略
|
249
|
339
|
toStrategy() {},
|
250
|
340
|
// 设备密码
|
251
|
|
- toPsw() {}
|
|
341
|
+ toPsw() {},
|
|
342
|
+ selectionChange(selection) {
|
|
343
|
+ this.tableSelection = selection;
|
|
344
|
+ },
|
|
345
|
+ // 其他操作
|
|
346
|
+ dropdownSelected(name) {
|
|
347
|
+ if (name === "1") {
|
|
348
|
+ // 恢复出厂设置
|
|
349
|
+ if (this.tableSelection.length === 0) {
|
|
350
|
+ this.$Message.error("请选择列表");
|
|
351
|
+ return;
|
|
352
|
+ }
|
|
353
|
+ } else if (name === "2") {
|
|
354
|
+ // 发送消息
|
|
355
|
+ if (this.tableSelection.length === 0) {
|
|
356
|
+ this.$Message.error("请选择列表");
|
|
357
|
+ return;
|
|
358
|
+ }
|
|
359
|
+ } else if (name === "3") {
|
|
360
|
+ // 整班发送消息
|
|
361
|
+ } else if (name === "4") {
|
|
362
|
+ // 解除限制
|
|
363
|
+ if (this.tableSelection.length === 0) {
|
|
364
|
+ this.$Message.error("请选择列表");
|
|
365
|
+ return;
|
|
366
|
+ }
|
|
367
|
+ } else if (name === "5") {
|
|
368
|
+ // 限制使用
|
|
369
|
+ if (this.tableSelection.length === 0) {
|
|
370
|
+ this.$Message.error("请选择列表");
|
|
371
|
+ return;
|
|
372
|
+ }
|
|
373
|
+ } else if (name === "6") {
|
|
374
|
+ // 更新策略
|
|
375
|
+ if (this.tableSelection.length === 0) {
|
|
376
|
+ this.$Message.error("请选择列表");
|
|
377
|
+ return;
|
|
378
|
+ }
|
|
379
|
+ } else if (name === "7") {
|
|
380
|
+ // 重启设备
|
|
381
|
+ if (this.tableSelection.length === 0) {
|
|
382
|
+ this.$Message.error("请选择列表");
|
|
383
|
+ return;
|
|
384
|
+ }
|
|
385
|
+ }
|
|
386
|
+ }
|
252
|
387
|
}
|
253
|
388
|
};
|
254
|
389
|
</script>
|