Browse Source

设备管理延时刷新

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

Loading…
Cancel
Save