|
@@ -23,14 +23,16 @@
|
23
|
23
|
</div>
|
24
|
24
|
<div class="table_wrap">
|
25
|
25
|
<Table :columns="columns" :data="searchForm.list">
|
26
|
|
- <template slot-scope="{ row }" slot="onlineSlot">
|
27
|
|
- <!-- 1在线2离线 -->
|
28
|
|
- <div v-if="row.online === 1">在线</div>
|
29
|
|
- <div v-else-if="row.online === 2">离线</div>
|
|
26
|
+ <template slot-scope="{ row }" slot="lockStateSlot">
|
|
27
|
+ <!-- 锁定状态0未锁定1已锁定 -->
|
|
28
|
+ <div class="action_list">
|
|
29
|
+ <div class="action_success" v-if="row.lockState === 0">正常</div>
|
|
30
|
+ <div class="action_error" v-else-if="row.lockState === 1">锁定</div>
|
|
31
|
+ </div>
|
30
|
32
|
</template>
|
31
|
33
|
<template slot-scope="{ row }" slot="actionSlot">
|
32
|
34
|
<div class="action_list">
|
33
|
|
- <div @click="toView(row)">查看</div>
|
|
35
|
+ <div v-if="row.sn" @click="toView(row.sn)">查看</div>
|
34
|
36
|
</div>
|
35
|
37
|
</template>
|
36
|
38
|
</Table>
|
|
@@ -67,7 +69,11 @@
|
67
|
69
|
<script>
|
68
|
70
|
import { region_list_sel_pt } from "@/api/region";
|
69
|
71
|
import { exportToExcel } from "@/utils/exportToExcel";
|
70
|
|
-import { logDeviceBind_list, logDeviceBind_list_all } from "@/api/log";
|
|
72
|
+import {
|
|
73
|
+ deviceAuth_list_export,
|
|
74
|
+ deviceAuth_export,
|
|
75
|
+ deviceAuth_edetail
|
|
76
|
+} from "@/api/device_manager";
|
71
|
77
|
export default {
|
72
|
78
|
data() {
|
73
|
79
|
return {
|
|
@@ -111,13 +117,13 @@ export default {
|
111
|
117
|
},
|
112
|
118
|
{
|
113
|
119
|
title: "绑定时间",
|
114
|
|
- key: "snnum",
|
|
120
|
+ key: "createtime",
|
115
|
121
|
width: 190,
|
116
|
122
|
align: "center"
|
117
|
123
|
},
|
118
|
124
|
{
|
119
|
125
|
title: "解绑时间",
|
120
|
|
- key: "snnum",
|
|
126
|
+ key: "unbindtime",
|
121
|
127
|
width: 190,
|
122
|
128
|
align: "center"
|
123
|
129
|
}
|
|
@@ -164,19 +170,19 @@ export default {
|
164
|
170
|
},
|
165
|
171
|
{
|
166
|
172
|
title: "状态",
|
167
|
|
- slot: "onlineSlot",
|
168
|
|
- width: 70,
|
|
173
|
+ slot: "lockStateSlot",
|
|
174
|
+ width: 90,
|
169
|
175
|
align: "center"
|
170
|
176
|
},
|
171
|
177
|
{
|
172
|
178
|
title: "首次激活时间",
|
173
|
|
- key: "updatetime",
|
|
179
|
+ key: "firsttime",
|
174
|
180
|
width: 190,
|
175
|
181
|
align: "center"
|
176
|
182
|
},
|
177
|
183
|
{
|
178
|
184
|
title: "末次解绑时间",
|
179
|
|
- key: "updatetime",
|
|
185
|
+ key: "lasttime",
|
180
|
186
|
width: 190,
|
181
|
187
|
align: "center"
|
182
|
188
|
},
|
|
@@ -227,12 +233,11 @@ export default {
|
227
|
233
|
},
|
228
|
234
|
// 获取列表
|
229
|
235
|
getList() {
|
230
|
|
- logDeviceBind_list({
|
|
236
|
+ deviceAuth_list_export({
|
231
|
237
|
rtype: this.powerParams.rtype,
|
232
|
|
- objectid: this.powerParams.objectid,
|
|
238
|
+ regionid: this.searchForm.regionid,
|
233
|
239
|
page: this.searchForm.page,
|
234
|
|
- size: this.searchForm.size,
|
235
|
|
- name: this.searchForm.name
|
|
240
|
+ size: this.searchForm.size
|
236
|
241
|
}).then((data) => {
|
237
|
242
|
if (data.code === 0) {
|
238
|
243
|
this.searchForm.list = data.obj.data;
|
|
@@ -242,28 +247,40 @@ export default {
|
242
|
247
|
}
|
243
|
248
|
});
|
244
|
249
|
},
|
245
|
|
- toView() {
|
|
250
|
+ toView(sn) {
|
|
251
|
+ deviceAuth_edetail({ sn }).then((data) => {
|
|
252
|
+ if (data.code === 0) {
|
|
253
|
+ this.viewInfo.list = data.obj;
|
|
254
|
+ } else {
|
|
255
|
+ this.$Message.error(data.msg);
|
|
256
|
+ }
|
|
257
|
+ });
|
246
|
258
|
this.viewInfo.show = true;
|
247
|
259
|
},
|
248
|
|
- toExport(row) {
|
249
|
|
- let form = {
|
|
260
|
+ toExport() {
|
|
261
|
+ deviceAuth_export({
|
250
|
262
|
rtype: this.powerParams.rtype,
|
251
|
|
- objectid: this.powerParams.objectid
|
252
|
|
- };
|
253
|
|
- if (row) {
|
254
|
|
- form.regionid = row.regionid;
|
255
|
|
- }
|
256
|
|
- logDeviceBind_list_all(form).then((data) => {
|
|
263
|
+ regionid: this.searchForm.regionid
|
|
264
|
+ }).then((data) => {
|
257
|
265
|
if (data.code === 0) {
|
258
|
266
|
exportToExcel(
|
259
|
267
|
[
|
260
|
268
|
{
|
261
|
269
|
list: data.obj.map((item) => {
|
262
|
270
|
return {
|
263
|
|
- 区域名称: item.regionName,
|
264
|
|
- 学校数: item.schoolnum,
|
265
|
|
- 用户数: item.usernum,
|
266
|
|
- 设备数: item.snnum
|
|
271
|
+ 学校名称: item.schoolName,
|
|
272
|
+ 班级: item.classname,
|
|
273
|
+ 姓名: item.username,
|
|
274
|
+ 设备号: item.sn,
|
|
275
|
+ 设备型号: item.deviceModel,
|
|
276
|
+ 状态:
|
|
277
|
+ item.lockState === 1
|
|
278
|
+ ? "锁定"
|
|
279
|
+ : item.lockState === 0
|
|
280
|
+ ? "正常"
|
|
281
|
+ : "",
|
|
282
|
+ 首次激活时间: item.firsttime,
|
|
283
|
+ 末次解绑时间: item.lasttime
|
267
|
284
|
};
|
268
|
285
|
}),
|
269
|
286
|
name: "设备导出"
|