Browse Source

学校-设备管理、违规设备其他操作

gzb
wangzhonglu 9 months ago
parent
commit
0b0511c365

+ 5
- 0
src/api/device_manager.js View File

@@ -15,6 +15,11 @@ export const device_manager_list_hd = (data) =>
15 15
  */
16 16
 export const device_manager_list_vd = (data) =>
17 17
   setRequest("device_manager/list_vd", data);
18
+/**
19
+ * 11.1.3.2违规设备--违规详情
20
+ */
21
+export const device_manager_detail_vd = (data) =>
22
+  setRequest("device_manager/detail_vd", data);
18 23
 /**
19 24
  * 11.1.4设备管理--设备管理列表
20 25
  */

+ 5
- 0
src/api/log.js View File

@@ -77,3 +77,8 @@ export const logDeviceBind_list_user = (data) =>
77 77
  */
78 78
 export const logDeviceBind_list_school = (data) =>
79 79
   setRequest("logDeviceBind/list_school", data);
80
+/**
81
+ * 7.10.3 违规设备--合规处理
82
+ */
83
+export const logdoperate_edit_handled = (data) =>
84
+  setRequest("logdoperate/edit_handled", data);

+ 5
- 0
src/api/setting.js View File

@@ -56,6 +56,11 @@ export const deviceSet_edit = (data) => setRequest("deviceSet/edit", data);
56 56
  * 8.3.2.3 设备设置管理-重置
57 57
  */
58 58
 export const deviceSet_delete = (data) => setRequest("deviceSet/delete", data);
59
+/**
60
+ * 8.3.3 设备管理-获取
61
+ */
62
+export const password_detail_userpwd = (data) =>
63
+  setRequest("password/detail_userpwd", data);
59 64
 /**
60 65
  * 8.4.1 开机设置-详情
61 66
  */

+ 1
- 1
src/store/index.js View File

@@ -33,7 +33,7 @@ export default new Vuex.Store({
33 33
       } else if (state.userPower.atype === 3) {
34 34
         state.userPower.regionids = [info.regionid];
35 35
         state.userPower.schoolid = info.schoolid;
36
-        state.userPower.belong = [info.regionName, info.schoolname];
36
+        state.userPower.belong = [info.regionName, info.schoolName];
37 37
       }
38 38
       localStorage.setItem(
39 39
         "xh_control_userInfo",

+ 1
- 1
src/utils/ControlWSMsg.js View File

@@ -65,7 +65,7 @@ class ControlWSMsg {
65 65
     let ws = this.ws;
66 66
     if (ws && ws.readyState === 1) {
67 67
       let msg = this.toJSONString();
68
-      console.log("发送消息", msg);
68
+      // console.log("发送消息", msg);
69 69
       ws.send(msg);
70 70
       cb && cb(true);
71 71
     } else {

+ 1
- 1
src/utils/ControlWs.js View File

@@ -79,7 +79,7 @@ class ControlWs {
79 79
     this.ws.onmessage = (event) => {
80 80
       //如果获取到消息,心跳检测重置
81 81
       if (event.data && JSON.parse(event.data)) {
82
-        console.info("接收到消息", event.data);
82
+        // console.info("接收到消息", event.data);
83 83
         this.myevent.$emit("ws_getmsg", JSON.parse(event.data));
84 84
       } else {
85 85
         console.error(event.data);

+ 12
- 12
src/utils/index.js View File

@@ -588,18 +588,18 @@ export const dateRangeToSecond = ([beginDate, endDate]) => {
588 588
   };
589 589
 };
590 590
 export const doEventInfo = {
591
-  1: "更换SIM卡",
592
-  2: "违规开启蓝牙",
593
-  3: "USB连接电脑",
594
-  4: "USB拔出电脑",
595
-  5: "插入SD卡",
596
-  6: "拔出SD卡",
597
-  7: "账号登录",
598
-  8: "账号退出",
599
-  9: "安装应用",
600
-  10: "卸载应用",
601
-  11: "启动应用",
602
-  12: "首次使用"
591
+  101: "更换SIM卡",
592
+  102: "违规开启蓝牙",
593
+  103: "USB连接电脑",
594
+  104: "USB拔出电脑",
595
+  105: "插入SD卡",
596
+  106: "拔出SD卡",
597
+  201: "账号登录",
598
+  202: "首次使用",
599
+  203: "账号退出",
600
+  211: "安装应用(安装了非应用商店应用违规)",
601
+  212: "卸载应用(卸载强制安装应用违规)",
602
+  213: "启动应用"
603 603
 };
604 604
 export const pushTypeInfo = {
605 605
   1: "发送消息",

+ 5
- 1
src/views/layout.vue View File

@@ -2,7 +2,11 @@
2 2
   <div class="layout_wrap">
3 3
     <div class="layout_header">
4 4
       <div class="header_left">
5
-        <img src="@/assets/img/setting/LOGO.png" />
5
+        <img
6
+          v-if="userInfo.logoPath"
7
+          :src="$api.showImageUrl + userInfo.logoPath"
8
+        />
9
+        <img v-else src="@/assets/img/setting/LOGO.png" />
6 10
       </div>
7 11
       <div class="header_right">
8 12
         <div style="margin-right: 10px" v-if="powerParams.rtype === 2">

+ 457
- 24
src/views/schoolSection/deviceManage/breakRuleDevice.vue View File

@@ -28,11 +28,11 @@
28 28
           <DropdownMenu slot="list">
29 29
             <DropdownItem name="1">恢复出厂</DropdownItem>
30 30
             <DropdownItem name="2">发送消息</DropdownItem>
31
-            <DropdownItem name="3">解除限制</DropdownItem>
32
-            <DropdownItem name="4">限制使用</DropdownItem>
33
-            <DropdownItem name="5">更新策略</DropdownItem>
34
-            <DropdownItem name="6">重启设备</DropdownItem>
35
-            <DropdownItem name="7">合规处理</DropdownItem>
31
+            <DropdownItem name="4">解除限制</DropdownItem>
32
+            <DropdownItem name="5">限制使用</DropdownItem>
33
+            <DropdownItem name="6">更新策略</DropdownItem>
34
+            <DropdownItem name="7">重启设备</DropdownItem>
35
+            <DropdownItem name="8">合规处理</DropdownItem>
36 36
           </DropdownMenu>
37 37
         </Dropdown>
38 38
       </div>
@@ -45,9 +45,11 @@
45 45
       >
46 46
         <template slot-scope="{ row }" slot="actionSlot">
47 47
           <div class="action_list">
48
-            <div @click="toDetail(row)">违规详情</div>
49
-            <div @click="toRestore(row)">恢复出厂</div>
50
-            <div @click="toHandle(row)">合规处理</div>
48
+            <div v-if="row.sn && row.num > 0" @click="toDetail(row)">
49
+              违规详情
50
+            </div>
51
+            <div v-if="row.sn" @click="toRestore(row)">恢复出厂</div>
52
+            <div v-if="row.sn" @click="toLogHandle([row.sn])">合规处理</div>
51 53
           </div>
52 54
         </template>
53 55
       </Table>
@@ -65,14 +67,85 @@
65 67
         show-sizer
66 68
       ></Page>
67 69
     </div>
70
+    <Modal
71
+      class="modal1"
72
+      :mask-closable="false"
73
+      v-model="controlMessageInfo.show"
74
+      title="发送消息"
75
+    >
76
+      <Form
77
+        v-if="controlMessageInfo.show"
78
+        ref="sendMsgForm"
79
+        :model="controlMessageInfo"
80
+        :rules="rules"
81
+        :label-width="60"
82
+      >
83
+        <FormItem label="标题" prop="title">
84
+          <Input
85
+            v-model="controlMessageInfo.title"
86
+            :maxlength="32"
87
+            show-word-limit
88
+            placeholder="请输入标题,不超过32个字符"
89
+          ></Input>
90
+        </FormItem>
91
+        <FormItem label="内容" prop="content">
92
+          <Input
93
+            type="textarea"
94
+            v-model="controlMessageInfo.content"
95
+            :maxlength="255"
96
+            show-word-limit
97
+            placeholder="请输入内容"
98
+          ></Input>
99
+        </FormItem>
100
+      </Form>
101
+      <div slot="footer">
102
+        <Button @click="controlMessageInfo.show = false">取消</Button>
103
+        <Button @click="controlSendMessage()" type="primary" class="primary_btn"
104
+          >保存</Button
105
+        >
106
+      </div>
107
+    </Modal>
108
+    <Modal
109
+      class="modal1"
110
+      :mask-closable="false"
111
+      v-model="logDetailInfo.show"
112
+      title="违规详情"
113
+    >
114
+      <div class="table_wrap">
115
+        <Table :columns="detailColumns" :data="logDetailInfo.list">
116
+          <template slot-scope="{ row }" slot="doEventSlot">
117
+            <div>{{ doEventInfo[row.doEvent] }}</div>
118
+          </template>
119
+        </Table>
120
+      </div>
121
+      <div slot="footer" style="text-align: center">
122
+        <Button @click="logDetailInfo.show = false">关闭</Button>
123
+      </div>
124
+    </Modal>
68 125
   </div>
69 126
 </template>
70 127
 
71 128
 <script>
72
-import { device_manager_list_vd } from "@/api/device_manager";
129
+import { doEventInfo } from "@/utils";
130
+import controlWs from "@/utils/ControlWs";
131
+import ControlWSMsg from "@/utils/ControlWSMsg";
132
+import { logPush_add, logdoperate_edit_handled } from "@/api/log";
133
+import {
134
+  device_manager_list_vd,
135
+  device_manager_detail_vd
136
+} from "@/api/device_manager";
73 137
 export default {
74 138
   data() {
75 139
     return {
140
+      doEventInfo,
141
+      userInfo: {},
142
+      // ws连接后回发信息
143
+      wsEnterInfo: {
144
+        // 消息ID
145
+        mid: null,
146
+        // 是否进入
147
+        isEnter: false
148
+      },
76 149
       searchForm: {
77 150
         name: "",
78 151
         // 是否处理:0否 1是
@@ -82,7 +155,33 @@ export default {
82 155
         list: [],
83 156
         total: 0
84 157
       },
158
+      logDetailInfo: {
159
+        show: false,
160
+        list: []
161
+      },
85 162
       tableSelection: [],
163
+      controlMessageInfo: {
164
+        show: false,
165
+        title: "",
166
+        content: "",
167
+        list: []
168
+      },
169
+      rules: {
170
+        title: [
171
+          {
172
+            required: true,
173
+            message: "请输入标题",
174
+            trigger: "blur"
175
+          }
176
+        ],
177
+        content: [
178
+          {
179
+            required: true,
180
+            message: "请选择内容",
181
+            trigger: "blur"
182
+          }
183
+        ]
184
+      },
86 185
       columns: [
87 186
         {
88 187
           type: "selection",
@@ -134,14 +233,13 @@ export default {
134 233
         },
135 234
         {
136 235
           title: "更新时间",
137
-          key: "lasttime",
236
+          key: "updatetime",
138 237
           width: 190,
139 238
           align: "center"
140 239
         },
141 240
         {
142
-          title: "操作中",
241
+          title: "违规详情",
143 242
           key: "num",
144
-          width: 100,
145 243
           align: "center"
146 244
         },
147 245
         {
@@ -150,18 +248,90 @@ export default {
150 248
           width: 260,
151 249
           align: "center"
152 250
         }
251
+      ],
252
+      detailColumns: [
253
+        {
254
+          title: "序号",
255
+          type: "index",
256
+          align: "center",
257
+          width: 70
258
+        },
259
+        {
260
+          title: "设备使用人",
261
+          key: "username",
262
+          align: "center"
263
+        },
264
+        {
265
+          title: "违规事件",
266
+          slot: "doEventSlot",
267
+          align: "center"
268
+        },
269
+        {
270
+          title: "违规时间",
271
+          key: "createtime",
272
+          width: 190,
273
+          align: "center"
274
+        }
153 275
       ]
154 276
     };
155 277
   },
156 278
   created() {
279
+    this.userInfo = JSON.parse(
280
+      localStorage.getItem("xh_control_userInfo")
281
+    ).content;
157 282
     this.searchList();
283
+    this.initMonitorWS();
158 284
   },
159 285
   computed: {
160 286
     powerParams() {
161 287
       return this.$store.getters.powerParams;
162 288
     }
163 289
   },
290
+  beforeDestroy() {
291
+    controlWs.myevent.$off("ws_error");
292
+    controlWs.myevent.$off("ws_open");
293
+    controlWs.myevent.$off("ws_getmsg");
294
+    controlWs.closeWs();
295
+  },
164 296
   methods: {
297
+    initMonitorWS() {
298
+      controlWs.setWs();
299
+      this.getWSEventInfo();
300
+    },
301
+    getWSEventInfo() {
302
+      controlWs.myevent.$on("ws_error", () => {
303
+        this.$Message.error("网络异常,请检查网络");
304
+      });
305
+      controlWs.myevent.$on("ws_open", () => {
306
+        this.sendAfterConnection();
307
+      });
308
+      controlWs.myevent.$on("ws_getmsg", (data) => {
309
+        if (data.code === 666) {
310
+          if (this.wsEnterInfo.mid === data.mid) {
311
+            this.wsEnterInfo.isEnter = true;
312
+          }
313
+        }
314
+        if (!this.wsEnterInfo.isEnter) {
315
+          return;
316
+        }
317
+      });
318
+    },
319
+    // 连接后回发(需确认)
320
+    sendAfterConnection() {
321
+      this.wsEnterInfo.isEnter = false;
322
+      let controlWSMsg = new ControlWSMsg(controlWs.ws, this.userInfo.adminid);
323
+      controlWSMsg.afterConnection({
324
+        userid: String(this.userInfo.adminid),
325
+        username: this.userInfo.aname,
326
+        schoolid: this.powerParams.objectid,
327
+        usertype: 1
328
+      });
329
+      controlWSMsg.send((isSend) => {
330
+        if (isSend) {
331
+          this.wsEnterInfo.mid = controlWSMsg.mid;
332
+        }
333
+      });
334
+    },
165 335
     // 搜索
166 336
     searchList() {
167 337
       this.searchForm.page = 1;
@@ -198,35 +368,298 @@ export default {
198 368
       });
199 369
     },
200 370
     // 违规详情
201
-    toDetail() {},
371
+    toDetail(row) {
372
+      device_manager_detail_vd({
373
+        rtype: this.powerParams.rtype,
374
+        objectid: this.powerParams.objectid,
375
+        size: 20,
376
+        name: row.sn
377
+      }).then((data) => {
378
+        if (data.code === 0) {
379
+          this.logDetailInfo = {
380
+            show: true,
381
+            list: data.obj
382
+          };
383
+        } else {
384
+          this.$Message.error(data.msg);
385
+        }
386
+      });
387
+    },
202 388
     // 恢复出厂
203
-    toRestore() {},
389
+    toRestore(row) {
390
+      if (!row.sn) {
391
+        this.$Message.error("设备不存在");
392
+        return;
393
+      }
394
+      this.$Modal.confirm({
395
+        title: "提示",
396
+        content: "确定对所选设备进行恢复出厂设置操作吗?",
397
+        onOk: () => {
398
+          this.controlRestoreFactory([row.sn]);
399
+        },
400
+        onCancel: () => {}
401
+      });
402
+    },
204 403
     // 合规处理
205
-    toHandle() {},
404
+    toLogHandle(snList) {
405
+      this.$Modal.confirm({
406
+        title: "提示",
407
+        content: "确定对所选设备进行合规处理操作吗?",
408
+        onOk: () => {
409
+          logdoperate_edit_handled({
410
+            sn: snList
411
+          }).then((data) => {
412
+            if (data.code === 0) {
413
+              this.$Message.success(data.msg);
414
+              this.searchList();
415
+            } else {
416
+              this.$Message.error(data.msg);
417
+            }
418
+          });
419
+        },
420
+        onCancel: () => {}
421
+      });
422
+    },
206 423
     selectionChange(selection) {
207 424
       this.tableSelection = selection;
208 425
     },
209 426
     // 其他操作
210 427
     dropdownSelected(name) {
211
-      if (this.tableSelection.length === 0) {
212
-        this.$Message.error("请选择列表");
428
+      if (!this.wsEnterInfo.isEnter) {
429
+        this.$Message.error("推送服务不可用");
213 430
         return;
214 431
       }
432
+      let snList = this.tableSelection
433
+        .filter((row) => row.sn)
434
+        .map((item) => item.sn);
215 435
       if (name === "1") {
216
-        // 恢复出厂设置
436
+        // 恢复出厂
437
+        if (snList.length === 0) {
438
+          this.$Message.error("请勾选至少一个设备。");
439
+          return;
440
+        }
441
+        this.$Modal.confirm({
442
+          title: "提示",
443
+          content: "确定对所选设备进行恢复出厂设置操作吗?",
444
+          onOk: () => {
445
+            this.controlRestoreFactory(snList);
446
+          },
447
+          onCancel: () => {}
448
+        });
217 449
       } else if (name === "2") {
218 450
         // 发送消息
219
-      } else if (name === "3") {
220
-        // 解除限制
451
+        if (snList.length === 0) {
452
+          this.$Message.error("请勾选至少一个设备。");
453
+          return;
454
+        }
455
+        this.controlMessageInfo = {
456
+          show: true,
457
+          title: "",
458
+          content: "",
459
+          list: snList
460
+        };
221 461
       } else if (name === "4") {
222
-        // 限制使用
462
+        // 解除限制
463
+        if (snList.length === 0) {
464
+          this.$Message.error("请勾选至少一个设备。");
465
+          return;
466
+        }
467
+        this.$Modal.confirm({
468
+          title: "提示",
469
+          content: "确定对所选设备进行解除限制操作吗?",
470
+          onOk: () => {
471
+            this.controlRemoveLimit(snList);
472
+          },
473
+          onCancel: () => {}
474
+        });
223 475
       } else if (name === "5") {
224
-        // 更新策略
476
+        // 限制使用
477
+        if (snList.length === 0) {
478
+          this.$Message.error("请勾选至少一个设备。");
479
+          return;
480
+        }
481
+        this.$Modal.confirm({
482
+          title: "提示",
483
+          content: "确定对所选设备进行限制使用操作吗?",
484
+          onOk: () => {
485
+            this.controlLimitedUse(snList);
486
+          },
487
+          onCancel: () => {}
488
+        });
225 489
       } else if (name === "6") {
226
-        // 重启设备
490
+        // 更新策略
491
+        if (snList.length === 0) {
492
+          this.$Message.error("请勾选至少一个设备。");
493
+          return;
494
+        }
495
+        this.$Modal.confirm({
496
+          title: "提示",
497
+          content: "确定对所选设备进行更新策略操作吗?",
498
+          onOk: () => {
499
+            this.controlUpdateStrategy(snList);
500
+          },
501
+          onCancel: () => {}
502
+        });
227 503
       } else if (name === "7") {
228
-        // 合理处理
504
+        // 重启设备
505
+        if (snList.length === 0) {
506
+          this.$Message.error("请勾选至少一个设备。");
507
+          return;
508
+        }
509
+        this.$Modal.confirm({
510
+          title: "提示",
511
+          content: "确定对所选设备进行重启设备操作吗?",
512
+          onOk: () => {
513
+            this.controlRebootDevice(snList);
514
+          },
515
+          onCancel: () => {}
516
+        });
517
+      } else if (name === "8") {
518
+        // 合规处理
519
+        if (snList.length === 0) {
520
+          this.$Message.error("请勾选至少一个设备。");
521
+          return;
522
+        }
523
+        this.toLogHandle(snList);
524
+      }
525
+    },
526
+    // 恢复出厂设置
527
+    controlRestoreFactory(snList) {
528
+      let controlWSMsg = new ControlWSMsg(
529
+        controlWs.ws,
530
+        this.userInfo.adminid,
531
+        snList
532
+      );
533
+      controlWSMsg.restoreFactory();
534
+      controlWSMsg.send();
535
+      let form = {
536
+        pushType: 6,
537
+        pushObj: 1
538
+      };
539
+      if (snList.length > 1) {
540
+        form.userids = snList;
541
+      } else {
542
+        form.pushObjid = snList[0];
543
+      }
544
+      this.addPushLog(form);
545
+    },
546
+    // 发送消息
547
+    controlSendMessage() {
548
+      this.$refs.sendMsgForm.validate((valid) => {
549
+        if (valid) {
550
+          this.controlMessageInfo.show = false;
551
+          let snList = this.controlMessageInfo.list;
552
+          let controlWSMsg = new ControlWSMsg(
553
+            controlWs.ws,
554
+            this.userInfo.adminid,
555
+            snList
556
+          );
557
+          controlWSMsg.msgContent(this.controlMessageInfo.content);
558
+          controlWSMsg.send();
559
+          let form = {
560
+            pushType: 1,
561
+            pushObj: 1,
562
+            content: this.controlMessageInfo.content
563
+          };
564
+          if (snList.length > 1) {
565
+            form.userids = snList;
566
+          } else {
567
+            form.pushObjid = snList[0];
568
+          }
569
+          this.addPushLog(form);
570
+        }
571
+      });
572
+    },
573
+    // 解除限制
574
+    controlRemoveLimit(snList) {
575
+      let controlWSMsg = new ControlWSMsg(
576
+        controlWs.ws,
577
+        this.userInfo.adminid,
578
+        snList
579
+      );
580
+      controlWSMsg.removeLimit();
581
+      controlWSMsg.send();
582
+      let form = {
583
+        pushType: 2,
584
+        pushObj: 1
585
+      };
586
+      if (snList.length > 1) {
587
+        form.userids = snList;
588
+      } else {
589
+        form.pushObjid = snList[0];
590
+      }
591
+      this.addPushLog(form);
592
+    },
593
+    // 限制使用
594
+    controlLimitedUse(snList) {
595
+      let controlWSMsg = new ControlWSMsg(
596
+        controlWs.ws,
597
+        this.userInfo.adminid,
598
+        snList
599
+      );
600
+      controlWSMsg.limitedUse();
601
+      controlWSMsg.send();
602
+      let form = {
603
+        pushType: 3,
604
+        pushObj: 1
605
+      };
606
+      if (snList.length > 1) {
607
+        form.userids = snList;
608
+      } else {
609
+        form.pushObjid = snList[0];
610
+      }
611
+      this.addPushLog(form);
612
+    },
613
+    // 更新策略
614
+    controlUpdateStrategy(snList) {
615
+      let controlWSMsg = new ControlWSMsg(
616
+        controlWs.ws,
617
+        this.userInfo.adminid,
618
+        snList
619
+      );
620
+      controlWSMsg.updateStrategy();
621
+      controlWSMsg.send();
622
+      let form = {
623
+        pushType: 4,
624
+        pushObj: 1
625
+      };
626
+      if (snList.length > 1) {
627
+        form.userids = snList;
628
+      } else {
629
+        form.pushObjid = snList[0];
229 630
       }
631
+      this.addPushLog(form);
632
+    },
633
+    // 重启设备
634
+    controlRebootDevice(snList) {
635
+      let controlWSMsg = new ControlWSMsg(
636
+        controlWs.ws,
637
+        this.userInfo.adminid,
638
+        snList
639
+      );
640
+      controlWSMsg.rebootDevice();
641
+      controlWSMsg.send();
642
+      let form = {
643
+        pushType: 4,
644
+        pushObj: 1
645
+      };
646
+      if (snList.length > 1) {
647
+        form.userids = snList;
648
+      } else {
649
+        form.pushObjid = snList[0];
650
+      }
651
+      this.addPushLog(form);
652
+    },
653
+    // 添加推送日志
654
+    addPushLog(form) {
655
+      logPush_add(form).then((data) => {
656
+        if (data.code === 0) {
657
+          this.$refs.deviceTable.selectAll(false);
658
+          this.$Message.success(data.msg);
659
+        } else {
660
+          this.$Message.error(data.msg);
661
+        }
662
+      });
230 663
     }
231 664
   }
232 665
 };

+ 97
- 15
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -92,7 +92,7 @@
92 92
             <div class="action_list">
93 93
               <div @click="toView(row)">查看</div>
94 94
               <div @click="toStrategy(row)">策略</div>
95
-              <div @click="toPsw(row)">设备密码</div>
95
+              <div v-if="row.sn" @click="toPsw(row)">设备密码</div>
96 96
             </div>
97 97
           </template>
98 98
         </Table>
@@ -149,6 +149,22 @@
149 149
         >
150 150
       </div>
151 151
     </Modal>
152
+    <Modal
153
+      class="modal4"
154
+      :mask-closable="false"
155
+      v-model="devicePswInfo.show"
156
+      title="设备密码"
157
+    >
158
+      <div class="device_psw">
159
+        <div class="device_psw_title">设备密码</div>
160
+        <div class="device_psw_num">{{ devicePswInfo.controlPwd }}</div>
161
+        <div class="device_psw_title">注销密码</div>
162
+        <div class="device_psw_num">{{ devicePswInfo.logoutPwd }}</div>
163
+      </div>
164
+      <div slot="footer" style="text-align: center">
165
+        <Button @click="devicePswInfo.show = false">关闭</Button>
166
+      </div>
167
+    </Modal>
152 168
   </div>
153 169
 </template>
154 170
 
@@ -162,6 +178,7 @@ import {
162 178
   device_manager_export_d,
163 179
   device_manager_export_id
164 180
 } from "@/api/device_manager";
181
+import { password_detail_userpwd } from "@/api/setting";
165 182
 import { logPush_add } from "@/api/log";
166 183
 export default {
167 184
   data() {
@@ -183,6 +200,11 @@ export default {
183 200
         list: [],
184 201
         total: 0
185 202
       },
203
+      devicePswInfo: {
204
+        show: false,
205
+        controlPwd: null,
206
+        logoutPwd: null
207
+      },
186 208
       tableSelection: [],
187 209
       controlMessageInfo: {
188 210
         show: false,
@@ -473,7 +495,23 @@ export default {
473 495
     // 策略
474 496
     toStrategy() {},
475 497
     // 设备密码
476
-    toPsw() {},
498
+    toPsw(row) {
499
+      password_detail_userpwd({
500
+        rtype: this.powerParams.rtype,
501
+        objectid: this.powerParams.objectid,
502
+        sn: row.sn
503
+      }).then((data) => {
504
+        if (data.code === 0) {
505
+          this.devicePswInfo = {
506
+            show: true,
507
+            controlPwd: data.obj.controlPwd,
508
+            logoutPwd: data.obj.logoutPwd
509
+          };
510
+        } else {
511
+          this.$Message.error(data.msg);
512
+        }
513
+      });
514
+    },
477 515
     selectionChange(selection) {
478 516
       this.tableSelection = selection;
479 517
     },
@@ -603,9 +641,13 @@ export default {
603 641
       controlWSMsg.send();
604 642
       let form = {
605 643
         pushType: 6,
606
-        pushObj: 1,
607
-        pushObjid: snList
644
+        pushObj: 1
608 645
       };
646
+      if (snList.length > 1) {
647
+        form.userids = snList;
648
+      } else {
649
+        form.pushObjid = snList[0];
650
+      }
609 651
       this.addPushLog(form);
610 652
     },
611 653
     // 发送消息
@@ -624,11 +666,17 @@ export default {
624 666
           let form = {
625 667
             pushType: 1,
626 668
             pushObj: this.controlMessageInfo.classid ? 2 : 1,
627
-            pushObjid: this.controlMessageInfo.classid
628
-              ? [this.controlMessageInfo.classid]
629
-              : snList,
630 669
             content: this.controlMessageInfo.content
631 670
           };
671
+          if (this.controlMessageInfo.classid) {
672
+            form.pushObjid = this.controlMessageInfo.classid;
673
+          } else {
674
+            if (snList.length > 1) {
675
+              form.userids = snList;
676
+            } else {
677
+              form.pushObjid = snList[0];
678
+            }
679
+          }
632 680
           this.addPushLog(form);
633 681
         }
634 682
       });
@@ -644,9 +692,13 @@ export default {
644 692
       controlWSMsg.send();
645 693
       let form = {
646 694
         pushType: 2,
647
-        pushObj: 1,
648
-        pushObjid: snList
695
+        pushObj: 1
649 696
       };
697
+      if (snList.length > 1) {
698
+        form.userids = snList;
699
+      } else {
700
+        form.pushObjid = snList[0];
701
+      }
650 702
       this.addPushLog(form);
651 703
     },
652 704
     // 限制使用
@@ -660,9 +712,13 @@ export default {
660 712
       controlWSMsg.send();
661 713
       let form = {
662 714
         pushType: 3,
663
-        pushObj: 1,
664
-        pushObjid: snList
715
+        pushObj: 1
665 716
       };
717
+      if (snList.length > 1) {
718
+        form.userids = snList;
719
+      } else {
720
+        form.pushObjid = snList[0];
721
+      }
666 722
       this.addPushLog(form);
667 723
     },
668 724
     // 更新策略
@@ -676,9 +732,13 @@ export default {
676 732
       controlWSMsg.send();
677 733
       let form = {
678 734
         pushType: 4,
679
-        pushObj: 1,
680
-        pushObjid: snList
735
+        pushObj: 1
681 736
       };
737
+      if (snList.length > 1) {
738
+        form.userids = snList;
739
+      } else {
740
+        form.pushObjid = snList[0];
741
+      }
682 742
       this.addPushLog(form);
683 743
     },
684 744
     // 重启设备
@@ -692,9 +752,13 @@ export default {
692 752
       controlWSMsg.send();
693 753
       let form = {
694 754
         pushType: 4,
695
-        pushObj: 1,
696
-        pushObjid: snList
755
+        pushObj: 1
697 756
       };
757
+      if (snList.length > 1) {
758
+        form.userids = snList;
759
+      } else {
760
+        form.pushObjid = snList[0];
761
+      }
698 762
       this.addPushLog(form);
699 763
     },
700 764
     // 添加推送日志
@@ -801,4 +865,22 @@ export default {
801 865
     }
802 866
   }
803 867
 }
868
+.device_psw {
869
+  display: flex;
870
+  justify-content: center;
871
+  align-items: center;
872
+  .device_psw_title {
873
+    margin: 0 16px;
874
+    font-size: 16px;
875
+  }
876
+  .device_psw_num {
877
+    padding: 0 10px;
878
+    font-size: 24px;
879
+    line-height: 32px;
880
+    font-weight: bold;
881
+    border-radius: 8px;
882
+    border: 1px solid #ced9f2;
883
+    background: #f3f4fc;
884
+  }
885
+}
804 886
 </style>

+ 2
- 2
src/views/schoolSection/deviceManage/outControlDevice.vue View File

@@ -122,12 +122,12 @@ export default {
122 122
         },
123 123
         {
124 124
           title: "Rom版本",
125
-          key: "updatename",
125
+          key: "romVersion",
126 126
           align: "center"
127 127
         },
128 128
         {
129 129
           title: "Token更新时间",
130
-          key: "romVersion",
130
+          key: "lasttime",
131 131
           width: 190,
132 132
           align: "center"
133 133
         }

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

@@ -193,7 +193,7 @@ export default {
193 193
                     姓名: item.username,
194 194
                     设备号码: item.deviceMac,
195 195
                     设备型号: item.deviceModel,
196
-                    "SN": item.sn,
196
+                    SN: item.sn,
197 197
                     Rom版本: item.romVersion,
198 198
                     是否违规:
199 199
                       item.violated === 1

+ 64
- 52
src/views/schoolSection/setting/deviceSetting.vue View File

@@ -50,11 +50,12 @@
50 50
             <Radio :label="0">否</Radio>
51 51
           </RadioGroup>
52 52
         </FormItem>
53
-        <FormItem label="管理密码">
53
+        <FormItem label="管理密码" v-if="menuInfo.pswDetail.trend !== 1">
54 54
           <Input
55 55
             v-model="menuInfo.pswDetail.password"
56 56
             placeholder="请输入管理密码"
57 57
           ></Input>
58
+          <div style="color: #f0153f">管理密码必须是8位数字或空</div>
58 59
         </FormItem>
59 60
       </Form>
60 61
     </div>
@@ -66,24 +67,24 @@
66 67
             <Radio :label="0">否</Radio>
67 68
           </RadioGroup>
68 69
         </FormItem>
69
-        <FormItem label="启动SD卡功能">
70
+        <!-- <FormItem label="启动SD卡功能">
70 71
           <RadioGroup v-model="menuInfo.setDetail.sdcard">
71 72
             <Radio :label="1">是</Radio>
72 73
             <Radio :label="0">否</Radio>
73 74
           </RadioGroup>
74
-        </FormItem>
75
+        </FormItem> -->
75 76
         <FormItem label="启用电话短信">
76 77
           <RadioGroup v-model="menuInfo.setDetail.simcard">
77 78
             <Radio :label="1">是</Radio>
78 79
             <Radio :label="0">否</Radio>
79 80
           </RadioGroup>
80 81
         </FormItem>
81
-        <FormItem label="启用数据流量">
82
+        <!-- <FormItem label="启用数据流量">
82 83
           <RadioGroup v-model="menuInfo.setDetail.dataFlow">
83 84
             <Radio :label="1">是</Radio>
84 85
             <Radio :label="0">否</Radio>
85 86
           </RadioGroup>
86
-        </FormItem>
87
+        </FormItem> -->
87 88
         <FormItem label="是否禁用注销">
88 89
           <RadioGroup v-model="menuInfo.setDetail.logout">
89 90
             <Radio :label="1">是</Radio>
@@ -102,30 +103,30 @@
102 103
             <Radio :label="0">否</Radio>
103 104
           </RadioGroup>
104 105
         </FormItem>
105
-        <FormItem label="开启手势密码">
106
+        <!-- <FormItem label="开启手势密码">
106 107
           <RadioGroup v-model="menuInfo.setDetail.gesturePwd">
107 108
             <Radio :label="1">是</Radio>
108 109
             <Radio :label="0">否</Radio>
109 110
           </RadioGroup>
110
-        </FormItem>
111
-        <FormItem label="启用wifi高级选项">
111
+        </FormItem> -->
112
+        <!-- <FormItem label="启用wifi高级选项">
112 113
           <RadioGroup v-model="menuInfo.setDetail.wifiAdvanced">
113 114
             <Radio :label="1">是</Radio>
114 115
             <Radio :label="0">否</Radio>
115 116
           </RadioGroup>
116
-        </FormItem>
117
+        </FormItem> -->
117 118
         <FormItem label="启用截屏">
118 119
           <RadioGroup v-model="menuInfo.setDetail.screenshots">
119 120
             <Radio :label="1">是</Radio>
120 121
             <Radio :label="0">否</Radio>
121 122
           </RadioGroup>
122 123
         </FormItem>
123
-        <FormItem label="启用客户端管理员">
124
+        <!-- <FormItem label="启用客户端管理员">
124 125
           <RadioGroup v-model="menuInfo.setDetail.clientAdmin">
125 126
             <Radio :label="1">是</Radio>
126 127
             <Radio :label="0">否</Radio>
127 128
           </RadioGroup>
128
-        </FormItem>
129
+        </FormItem> -->
129 130
         <FormItem label="隐藏自动旋转">
130 131
           <RadioGroup v-model="menuInfo.setDetail.rotateSetting">
131 132
             <Radio :label="1">是</Radio>
@@ -147,12 +148,12 @@
147 148
             v-model="menuInfo.setDetail.duration"
148 149
           ></InputNumber>
149 150
         </FormItem>
150
-        <FormItem label="启用OTG功能">
151
+        <!-- <FormItem label="启用OTG功能">
151 152
           <RadioGroup v-model="menuInfo.setDetail.otg">
152 153
             <Radio :label="1">是</Radio>
153 154
             <Radio :label="0">否</Radio>
154 155
           </RadioGroup>
155
-        </FormItem>
156
+        </FormItem> -->
156 157
       </Form>
157 158
       <Form :label-width="200">
158 159
         <FormItem label="隐藏图库">
@@ -173,7 +174,7 @@
173 174
             <Radio :label="0">否</Radio>
174 175
           </RadioGroup>
175 176
         </FormItem>
176
-        <FormItem label="隐藏日">
177
+        <FormItem label="隐藏日">
177 178
           <RadioGroup v-model="menuInfo.setDetail.calendar">
178 179
             <Radio :label="1">是</Radio>
179 180
             <Radio :label="0">否</Radio>
@@ -185,36 +186,36 @@
185 186
             <Radio :label="0">否</Radio>
186 187
           </RadioGroup>
187 188
         </FormItem>
188
-        <FormItem label="限制安装来源">
189
+        <!-- <FormItem label="限制安装来源">
189 190
           <RadioGroup v-model="menuInfo.setDetail.installStore">
190 191
             <Radio :label="1">是</Radio>
191 192
             <Radio :label="0">否</Radio>
192 193
           </RadioGroup>
193
-        </FormItem>
194
+        </FormItem> -->
194 195
         <FormItem label="允许用户改密码">
195 196
           <RadioGroup v-model="menuInfo.setDetail.changePwd">
196 197
             <Radio :label="1">是</Radio>
197 198
             <Radio :label="0">否</Radio>
198 199
           </RadioGroup>
199 200
         </FormItem>
200
-        <FormItem label="组织部门显示">
201
+        <FormItem label="学校班级展示">
201 202
           <RadioGroup v-model="menuInfo.setDetail.schoolClass">
202 203
             <Radio :label="1">是</Radio>
203 204
             <Radio :label="0">否</Radio>
204 205
           </RadioGroup>
205 206
         </FormItem>
206
-        <FormItem label="启用GPS">
207
+        <!-- <FormItem label="启用GPS">
207 208
           <RadioGroup v-model="menuInfo.setDetail.gps">
208 209
             <Radio :label="1">是</Radio>
209 210
             <Radio :label="0">否</Radio>
210 211
           </RadioGroup>
211
-        </FormItem>
212
-        <FormItem label="显示隐私声明">
212
+        </FormItem> -->
213
+        <!-- <FormItem label="显示隐私声明">
213 214
           <RadioGroup v-model="menuInfo.setDetail.privacyStatement">
214 215
             <Radio :label="1">是</Radio>
215 216
             <Radio :label="0">否</Radio>
216 217
           </RadioGroup>
217
-        </FormItem>
218
+        </FormItem> -->
218 219
       </Form>
219 220
     </div>
220 221
     <div class="bottom_btns">
@@ -258,30 +259,30 @@ export default {
258 259
           dsid: null,
259 260
           rversion: null,
260 261
           forceBind: 1,
261
-          sdcard: 1,
262
+          // sdcard: 1,
262 263
           simcard: 1,
263
-          dataFlow: 1,
264
+          // dataFlow: 1,
264 265
           logout: 1,
265 266
           cleanup: 1,
266 267
           accelerate: 1,
267
-          gesturePwd: 1,
268
-          wifiAdvanced: 1,
268
+          // gesturePwd: 1,
269
+          // wifiAdvanced: 1,
269 270
           screenshots: 1,
270
-          clientAdmin: 1,
271
+          // clientAdmin: 1,
271 272
           rotateSetting: 1,
272 273
           gallery: 1,
273 274
           camera: 1,
274 275
           alarmClock: 1,
275 276
           calendar: 1,
276 277
           protectedEyes: 1,
277
-          installStore: 1,
278
+          // installStore: 1,
278 279
           changePwd: 1,
279 280
           schoolClass: 1,
280
-          gps: 1,
281
-          privacyStatement: 1,
281
+          // gps: 1,
282
+          // privacyStatement: 1,
282 283
           remindDuration: 1,
283
-          duration: 30,
284
-          otg: 1
284
+          duration: 30
285
+          // otg: 1
285 286
         }
286 287
       }
287 288
     };
@@ -376,30 +377,30 @@ export default {
376 377
               dsid: null,
377 378
               rversion: null,
378 379
               forceBind: 1,
379
-              sdcard: 1,
380
+              // sdcard: 1,
380 381
               simcard: 1,
381
-              dataFlow: 1,
382
+              // dataFlow: 1,
382 383
               logout: 1,
383 384
               cleanup: 1,
384 385
               accelerate: 1,
385
-              gesturePwd: 1,
386
-              wifiAdvanced: 1,
386
+              // gesturePwd: 1,
387
+              // wifiAdvanced: 1,
387 388
               screenshots: 1,
388
-              clientAdmin: 1,
389
+              // clientAdmin: 1,
389 390
               rotateSetting: 1,
390 391
               gallery: 1,
391 392
               camera: 1,
392 393
               alarmClock: 1,
393 394
               calendar: 1,
394 395
               protectedEyes: 1,
395
-              installStore: 1,
396
+              // installStore: 1,
396 397
               changePwd: 1,
397 398
               schoolClass: 1,
398
-              gps: 1,
399
-              privacyStatement: 1,
399
+              // gps: 1,
400
+              // privacyStatement: 1,
400 401
               remindDuration: 1,
401
-              duration: 30,
402
-              otg: 1
402
+              duration: 30
403
+              // otg: 1
403 404
             };
404 405
           }
405 406
         } else {
@@ -415,12 +416,23 @@ export default {
415 416
       }
416 417
     },
417 418
     savePswDetail() {
419
+      if (
420
+        this.menuInfo.pswDetail.trend !== 1 &&
421
+        this.menuInfo.pswDetail.password &&
422
+        !/^\d{8}$/.test(this.menuInfo.pswDetail.password)
423
+      ) {
424
+        this.$Message.error("密码格式不正确");
425
+        return;
426
+      }
418 427
       password_edit({
419 428
         rtype: this.powerParams.rtype,
420 429
         objectid: this.powerParams.objectid,
421 430
         schoolid: this.powerParams.objectid,
422 431
         trend: this.menuInfo.pswDetail.trend,
423
-        password: this.menuInfo.pswDetail.password,
432
+        password:
433
+          this.menuInfo.pswDetail.trend !== 1
434
+            ? this.menuInfo.pswDetail.password
435
+            : null,
424 436
         pwid: this.menuInfo.pswDetail.pwid,
425 437
         rversion: this.menuInfo.pswDetail.rversion
426 438
       }).then((data) => {
@@ -440,30 +452,30 @@ export default {
440 452
         dsid: this.menuInfo.setDetail.dsid,
441 453
         rversion: this.menuInfo.setDetail.rversion,
442 454
         forceBind: this.menuInfo.setDetail.forceBind,
443
-        sdcard: this.menuInfo.setDetail.sdcard,
455
+        // sdcard: this.menuInfo.setDetail.sdcard,
444 456
         simcard: this.menuInfo.setDetail.simcard,
445
-        dataFlow: this.menuInfo.setDetail.dataFlow,
457
+        // dataFlow: this.menuInfo.setDetail.dataFlow,
446 458
         logout: this.menuInfo.setDetail.logout,
447 459
         cleanup: this.menuInfo.setDetail.cleanup,
448 460
         accelerate: this.menuInfo.setDetail.accelerate,
449
-        gesturePwd: this.menuInfo.setDetail.gesturePwd,
450
-        wifiAdvanced: this.menuInfo.setDetail.wifiAdvanced,
461
+        // gesturePwd: this.menuInfo.setDetail.gesturePwd,
462
+        // wifiAdvanced: this.menuInfo.setDetail.wifiAdvanced,
451 463
         screenshots: this.menuInfo.setDetail.screenshots,
452
-        clientAdmin: this.menuInfo.setDetail.clientAdmin,
464
+        // clientAdmin: this.menuInfo.setDetail.clientAdmin,
453 465
         rotateSetting: this.menuInfo.setDetail.rotateSetting,
454 466
         gallery: this.menuInfo.setDetail.gallery,
455 467
         camera: this.menuInfo.setDetail.camera,
456 468
         alarmClock: this.menuInfo.setDetail.alarmClock,
457 469
         calendar: this.menuInfo.setDetail.calendar,
458 470
         protectedEyes: this.menuInfo.setDetail.protectedEyes,
459
-        installStore: this.menuInfo.setDetail.installStore,
471
+        // installStore: this.menuInfo.setDetail.installStore,
460 472
         changePwd: this.menuInfo.setDetail.changePwd,
461 473
         schoolClass: this.menuInfo.setDetail.schoolClass,
462
-        gps: this.menuInfo.setDetail.gps,
463
-        privacyStatement: this.menuInfo.setDetail.privacyStatement,
474
+        // gps: this.menuInfo.setDetail.gps,
475
+        // privacyStatement: this.menuInfo.setDetail.privacyStatement,
464 476
         remindDuration: this.menuInfo.setDetail.remindDuration,
465
-        duration: this.menuInfo.setDetail.duration,
466
-        otg: this.menuInfo.setDetail.otg
477
+        duration: this.menuInfo.setDetail.duration
478
+        // otg: this.menuInfo.setDetail.otg
467 479
       }).then((data) => {
468 480
         if (data.code === 0) {
469 481
           this.$Message.success(data.msg);

Loading…
Cancel
Save