Browse Source

设备管理延时刷新

gzb
wangzhonglu 7 months ago
parent
commit
c0f548211c
1 changed files with 22 additions and 0 deletions
  1. 22
    0
      src/views/schoolSection/deviceManage/deviceManage.vue

+ 22
- 0
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -591,6 +591,12 @@ export default {
591 591
   },
592 592
   data() {
593 593
     return {
594
+      // 延时刷新
595
+      delayedInfo: {
596
+        // 单位秒
597
+        time: 3,
598
+        timer: null
599
+      },
594 600
       baiduMapInfo: {
595 601
         center: "郑州市",
596 602
         zoom: 13,
@@ -1445,6 +1451,15 @@ export default {
1445 1451
         });
1446 1452
       }
1447 1453
     },
1454
+    // 延时刷新
1455
+    delayedRefresh() {
1456
+      if (this.delayedInfo.timer) {
1457
+        clearTimeout(this.delayedInfo.timer);
1458
+      }
1459
+      this.delayedInfo.timer = setTimeout(() => {
1460
+        this.getList();
1461
+      }, this.delayedInfo.time * 1000);
1462
+    },
1448 1463
     // 恢复出厂设置
1449 1464
     controlRestoreFactory(snList, useridList) {
1450 1465
       let controlWSMsg = new ControlWSMsg(
@@ -1467,6 +1482,7 @@ export default {
1467 1482
       };
1468 1483
       form.userids = useridList;
1469 1484
       this.addPushLog(form);
1485
+      this.delayedRefresh();
1470 1486
     },
1471 1487
     // 发送消息
1472 1488
     controlSendMessage() {
@@ -1506,6 +1522,7 @@ export default {
1506 1522
           }
1507 1523
           this.$refs.deviceTable.selectAll(false);
1508 1524
           this.addPushLog(form);
1525
+          this.delayedRefresh();
1509 1526
         }
1510 1527
       });
1511 1528
     },
@@ -1531,6 +1548,7 @@ export default {
1531 1548
       };
1532 1549
       form.userids = useridList;
1533 1550
       this.addPushLog(form);
1551
+      this.delayedRefresh();
1534 1552
     },
1535 1553
     // 锁定
1536 1554
     controlLimitedUse(snList, useridList) {
@@ -1554,6 +1572,7 @@ export default {
1554 1572
       };
1555 1573
       form.userids = useridList;
1556 1574
       this.addPushLog(form);
1575
+      this.delayedRefresh();
1557 1576
     },
1558 1577
     // 更新策略
1559 1578
     controlUpdateStrategy(snList, useridList) {
@@ -1577,6 +1596,7 @@ export default {
1577 1596
       };
1578 1597
       form.userids = useridList;
1579 1598
       this.addPushLog(form);
1599
+      this.delayedRefresh();
1580 1600
     },
1581 1601
     // 重启设备
1582 1602
     controlRebootDevice(snList, useridList) {
@@ -1600,6 +1620,7 @@ export default {
1600 1620
       };
1601 1621
       form.userids = useridList;
1602 1622
       this.addPushLog(form);
1623
+      this.delayedRefresh();
1603 1624
     },
1604 1625
     // 解除管控
1605 1626
     controlRemoveDevice(snList, useridList) {
@@ -1623,6 +1644,7 @@ export default {
1623 1644
       };
1624 1645
       form.userids = useridList;
1625 1646
       this.addPushLog(form);
1647
+      this.delayedRefresh();
1626 1648
     },
1627 1649
     // 解除绑定
1628 1650
     controlRemoveBind(snList, useridList) {

Loading…
Cancel
Save