Browse Source

学校-设备管理-解除绑定

gzb
wangzhonglu 9 months ago
parent
commit
b6ad789b3e

+ 4
- 0
src/utils/ControlWSMsg.js View File

53
   removeControl() {
53
   removeControl() {
54
     this.code = 2007;
54
     this.code = 2007;
55
   }
55
   }
56
+  // 解除绑定
57
+  removeBind() {
58
+    this.code = 2008;
59
+  }
56
   toJSONString() {
60
   toJSONString() {
57
     let tempObj = {};
61
     let tempObj = {};
58
     for (let key in this) {
62
     for (let key in this) {

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

707
       });
707
       });
708
       this.$refs.deviceTable.selectAll(false);
708
       this.$refs.deviceTable.selectAll(false);
709
       let form = {
709
       let form = {
710
-        pushType: 4,
710
+        pushType: 5,
711
         pushObj: 1
711
         pushObj: 1
712
       };
712
       };
713
       form.userids = useridList;
713
       form.userids = useridList;
730
       });
730
       });
731
       this.$refs.deviceTable.selectAll(false);
731
       this.$refs.deviceTable.selectAll(false);
732
       let form = {
732
       let form = {
733
-        pushType: 4,
733
+        pushType: 7,
734
         pushObj: 1
734
         pushObj: 1
735
       };
735
       };
736
       form.userids = useridList;
736
       form.userids = useridList;

+ 56
- 6
src/views/schoolSection/deviceManage/deviceManage.vue View File

73
               <DropdownItem name="6">更新策略</DropdownItem>
73
               <DropdownItem name="6">更新策略</DropdownItem>
74
               <DropdownItem name="7">重启设备</DropdownItem>
74
               <DropdownItem name="7">重启设备</DropdownItem>
75
               <DropdownItem name="9">解除管控</DropdownItem>
75
               <DropdownItem name="9">解除管控</DropdownItem>
76
+              <DropdownItem name="10">解除绑定</DropdownItem>
76
             </DropdownMenu>
77
             </DropdownMenu>
77
           </Dropdown>
78
           </Dropdown>
78
         </div>
79
         </div>
96
               <div v-if="row.sn" @click="toView(row)">查看</div>
97
               <div v-if="row.sn" @click="toView(row)">查看</div>
97
               <div @click="toStrategy(row)">策略</div>
98
               <div @click="toStrategy(row)">策略</div>
98
               <div v-if="row.sn" @click="toPsw(row)">设备密码</div>
99
               <div v-if="row.sn" @click="toPsw(row)">设备密码</div>
100
+              <div v-if="row.sn" @click="toUnbind(row)">解除绑定</div>
99
             </div>
101
             </div>
100
           </template>
102
           </template>
101
         </Table>
103
         </Table>
670
         {
672
         {
671
           title: "状态",
673
           title: "状态",
672
           slot: "onlineSlot",
674
           slot: "onlineSlot",
673
-          width: 70,
675
+          width: 90,
674
           align: "center"
676
           align: "center"
675
         },
677
         },
676
         {
678
         {
697
         {
699
         {
698
           title: "操作",
700
           title: "操作",
699
           slot: "actionSlot",
701
           slot: "actionSlot",
700
-          width: 200,
702
+          width: 275,
701
           align: "center"
703
           align: "center"
702
         }
704
         }
703
       ],
705
       ],
1257
         }
1259
         }
1258
       });
1260
       });
1259
     },
1261
     },
1262
+    // 解除绑定
1263
+    toUnbind(row) {
1264
+      this.$Modal.confirm({
1265
+        title: "提示",
1266
+        content: "确定对所选设备进行解除绑定操作吗?",
1267
+        onOk: () => {
1268
+          this.controlRemoveBind([row.sn], [row.userid]);
1269
+        },
1270
+        onCancel: () => {}
1271
+      });
1272
+    },
1260
     selectionChange(selection) {
1273
     selectionChange(selection) {
1261
       this.tableSelection = selection;
1274
       this.tableSelection = selection;
1262
     },
1275
     },
1391
           title: "提示",
1404
           title: "提示",
1392
           content: "确定对所选设备进行解除管控操作吗?",
1405
           content: "确定对所选设备进行解除管控操作吗?",
1393
           onOk: () => {
1406
           onOk: () => {
1394
-            this.controlRemovetDevice(snList, useridList);
1407
+            this.controlRemoveDevice(snList, useridList);
1408
+          },
1409
+          onCancel: () => {}
1410
+        });
1411
+      } else if (name === "10") {
1412
+        // 解除绑定
1413
+        if (snList.length === 0) {
1414
+          this.$Message.error("请勾选至少一个设备。");
1415
+          return;
1416
+        }
1417
+        this.$Modal.confirm({
1418
+          title: "提示",
1419
+          content: "确定对所选设备进行解除绑定操作吗?",
1420
+          onOk: () => {
1421
+            this.controlRemoveBind(snList, useridList);
1395
           },
1422
           },
1396
           onCancel: () => {}
1423
           onCancel: () => {}
1397
         });
1424
         });
1547
       });
1574
       });
1548
       this.$refs.deviceTable.selectAll(false);
1575
       this.$refs.deviceTable.selectAll(false);
1549
       let form = {
1576
       let form = {
1550
-        pushType: 4,
1577
+        pushType: 5,
1551
         pushObj: 1
1578
         pushObj: 1
1552
       };
1579
       };
1553
       form.userids = useridList;
1580
       form.userids = useridList;
1554
       this.addPushLog(form);
1581
       this.addPushLog(form);
1555
     },
1582
     },
1556
     // 解除管控
1583
     // 解除管控
1557
-    controlRemovetDevice(snList, useridList) {
1584
+    controlRemoveDevice(snList, useridList) {
1558
       let controlWSMsg = new ControlWSMsg(
1585
       let controlWSMsg = new ControlWSMsg(
1559
         controlWs.ws,
1586
         controlWs.ws,
1560
         this.userInfo.adminid,
1587
         this.userInfo.adminid,
1570
       });
1597
       });
1571
       this.$refs.deviceTable.selectAll(false);
1598
       this.$refs.deviceTable.selectAll(false);
1572
       let form = {
1599
       let form = {
1573
-        pushType: 4,
1600
+        pushType: 7,
1601
+        pushObj: 1
1602
+      };
1603
+      form.userids = useridList;
1604
+      this.addPushLog(form);
1605
+    },
1606
+    // 解除绑定
1607
+    controlRemoveBind(snList, useridList) {
1608
+      let controlWSMsg = new ControlWSMsg(
1609
+        controlWs.ws,
1610
+        this.userInfo.adminid,
1611
+        snList
1612
+      );
1613
+      controlWSMsg.removeBind();
1614
+      controlWSMsg.send((isSend) => {
1615
+        if (isSend) {
1616
+          this.$Message.success("推送成功");
1617
+        } else {
1618
+          this.$Message.error("推送失败");
1619
+        }
1620
+      });
1621
+      this.$refs.deviceTable.selectAll(false);
1622
+      let form = {
1623
+        pushType: 8,
1574
         pushObj: 1
1624
         pushObj: 1
1575
       };
1625
       };
1576
       form.userids = useridList;
1626
       form.userids = useridList;

Loading…
Cancel
Save