Browse Source

设备管理选中优化

gzb
wangzhonglu 7 months ago
parent
commit
9d4b0dad72

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

388
         name: this.searchForm.name
388
         name: this.searchForm.name
389
       }).then((data) => {
389
       }).then((data) => {
390
         if (data.code === 0) {
390
         if (data.code === 0) {
391
-          this.searchForm.list = data.obj.data;
391
+          this.searchForm.list = data.obj.data || [];
392
+          this.searchForm.list.forEach((item) => {
393
+            item._checked = false;
394
+          });
392
           this.searchForm.total = data.obj.total;
395
           this.searchForm.total = data.obj.total;
393
         } else {
396
         } else {
394
           this.$Message.error(data.msg);
397
           this.$Message.error(data.msg);
607
           this.$Message.error("推送失败");
610
           this.$Message.error("推送失败");
608
         }
611
         }
609
       });
612
       });
610
-      this.$refs.deviceTable.selectAll(false);
613
+      this.tableSelection.forEach((item) => {
614
+        item._checked = false;
615
+      });
616
+      this.tableSelection = [];
611
       let form = {
617
       let form = {
612
         pushType: 6,
618
         pushType: 6,
613
         pushObj: 1
619
         pushObj: 1
647
             content: this.controlMessageInfo.content
653
             content: this.controlMessageInfo.content
648
           };
654
           };
649
           form.userids = useridList;
655
           form.userids = useridList;
650
-          this.$refs.deviceTable.selectAll(false);
656
+          this.tableSelection.forEach((item) => {
657
+            item._checked = false;
658
+          });
659
+          this.tableSelection = [];
651
           this.addPushLog(form);
660
           this.addPushLog(form);
652
         }
661
         }
653
       });
662
       });
667
           this.$Message.error("推送失败");
676
           this.$Message.error("推送失败");
668
         }
677
         }
669
       });
678
       });
670
-      this.$refs.deviceTable.selectAll(false);
679
+      this.tableSelection.forEach((item) => {
680
+        item._checked = false;
681
+      });
682
+      this.tableSelection = [];
671
       let form = {
683
       let form = {
672
         pushType: 2,
684
         pushType: 2,
673
         pushObj: 1
685
         pushObj: 1
690
           this.$Message.error("推送失败");
702
           this.$Message.error("推送失败");
691
         }
703
         }
692
       });
704
       });
693
-      this.$refs.deviceTable.selectAll(false);
705
+      this.tableSelection.forEach((item) => {
706
+        item._checked = false;
707
+      });
708
+      this.tableSelection = [];
694
       let form = {
709
       let form = {
695
         pushType: 3,
710
         pushType: 3,
696
         pushObj: 1
711
         pushObj: 1
713
           this.$Message.error("推送失败");
728
           this.$Message.error("推送失败");
714
         }
729
         }
715
       });
730
       });
716
-      this.$refs.deviceTable.selectAll(false);
731
+      this.tableSelection.forEach((item) => {
732
+        item._checked = false;
733
+      });
734
+      this.tableSelection = [];
717
       let form = {
735
       let form = {
718
         pushType: 4,
736
         pushType: 4,
719
         pushObj: 1
737
         pushObj: 1
736
           this.$Message.error("推送失败");
754
           this.$Message.error("推送失败");
737
         }
755
         }
738
       });
756
       });
739
-      this.$refs.deviceTable.selectAll(false);
757
+      this.tableSelection.forEach((item) => {
758
+        item._checked = false;
759
+      });
760
+      this.tableSelection = [];
740
       let form = {
761
       let form = {
741
         pushType: 5,
762
         pushType: 5,
742
         pushObj: 1
763
         pushObj: 1
759
           this.$Message.error("推送失败");
780
           this.$Message.error("推送失败");
760
         }
781
         }
761
       });
782
       });
762
-      this.$refs.deviceTable.selectAll(false);
783
+      this.tableSelection.forEach((item) => {
784
+        item._checked = false;
785
+      });
786
+      this.tableSelection = [];
763
       let form = {
787
       let form = {
764
         pushType: 7,
788
         pushType: 7,
765
         pushObj: 1
789
         pushObj: 1

+ 36
- 9
src/views/schoolSection/deviceManage/deviceManage.vue View File

1062
         name: this.searchForm.name
1062
         name: this.searchForm.name
1063
       }).then((data) => {
1063
       }).then((data) => {
1064
         if (data.code === 0) {
1064
         if (data.code === 0) {
1065
-          this.searchForm.list = data.obj.data;
1065
+          this.searchForm.list = data.obj.data || [];
1066
+          this.searchForm.list.forEach((item) => {
1067
+            item._checked = false;
1068
+          });
1066
           this.searchForm.total = data.obj.total;
1069
           this.searchForm.total = data.obj.total;
1067
         } else {
1070
         } else {
1068
           this.$Message.error(data.msg);
1071
           this.$Message.error(data.msg);
1450
           this.$Message.error("推送失败");
1453
           this.$Message.error("推送失败");
1451
         }
1454
         }
1452
       });
1455
       });
1453
-      this.$refs.deviceTable.selectAll(false);
1456
+      this.tableSelection.forEach((item) => {
1457
+        item._checked = false;
1458
+      });
1459
+      this.tableSelection = [];
1454
       let form = {
1460
       let form = {
1455
         pushType: 6,
1461
         pushType: 6,
1456
         pushObj: 1
1462
         pushObj: 1
1494
           } else {
1500
           } else {
1495
             form.userids = useridList;
1501
             form.userids = useridList;
1496
           }
1502
           }
1497
-          this.$refs.deviceTable.selectAll(false);
1503
+          this.tableSelection.forEach((item) => {
1504
+            item._checked = false;
1505
+          });
1506
+          this.tableSelection = [];
1498
           this.addPushLog(form);
1507
           this.addPushLog(form);
1499
         }
1508
         }
1500
       });
1509
       });
1514
           this.$Message.error("推送失败");
1523
           this.$Message.error("推送失败");
1515
         }
1524
         }
1516
       });
1525
       });
1517
-      this.$refs.deviceTable.selectAll(false);
1526
+      this.tableSelection.forEach((item) => {
1527
+        item._checked = false;
1528
+      });
1529
+      this.tableSelection = [];
1518
       let form = {
1530
       let form = {
1519
         pushType: 2,
1531
         pushType: 2,
1520
         pushObj: 1
1532
         pushObj: 1
1537
           this.$Message.error("推送失败");
1549
           this.$Message.error("推送失败");
1538
         }
1550
         }
1539
       });
1551
       });
1540
-      this.$refs.deviceTable.selectAll(false);
1552
+      this.tableSelection.forEach((item) => {
1553
+        item._checked = false;
1554
+      });
1555
+      this.tableSelection = [];
1541
       let form = {
1556
       let form = {
1542
         pushType: 3,
1557
         pushType: 3,
1543
         pushObj: 1
1558
         pushObj: 1
1560
           this.$Message.error("推送失败");
1575
           this.$Message.error("推送失败");
1561
         }
1576
         }
1562
       });
1577
       });
1563
-      this.$refs.deviceTable.selectAll(false);
1578
+      this.tableSelection.forEach((item) => {
1579
+        item._checked = false;
1580
+      });
1581
+      this.tableSelection = [];
1564
       let form = {
1582
       let form = {
1565
         pushType: 4,
1583
         pushType: 4,
1566
         pushObj: 1
1584
         pushObj: 1
1583
           this.$Message.error("推送失败");
1601
           this.$Message.error("推送失败");
1584
         }
1602
         }
1585
       });
1603
       });
1586
-      this.$refs.deviceTable.selectAll(false);
1604
+      this.tableSelection.forEach((item) => {
1605
+        item._checked = false;
1606
+      });
1607
+      this.tableSelection = [];
1587
       let form = {
1608
       let form = {
1588
         pushType: 5,
1609
         pushType: 5,
1589
         pushObj: 1
1610
         pushObj: 1
1606
           this.$Message.error("推送失败");
1627
           this.$Message.error("推送失败");
1607
         }
1628
         }
1608
       });
1629
       });
1609
-      this.$refs.deviceTable.selectAll(false);
1630
+      this.tableSelection.forEach((item) => {
1631
+        item._checked = false;
1632
+      });
1633
+      this.tableSelection = [];
1610
       let form = {
1634
       let form = {
1611
         pushType: 7,
1635
         pushType: 7,
1612
         pushObj: 1
1636
         pushObj: 1
1629
           this.$Message.error("推送失败");
1653
           this.$Message.error("推送失败");
1630
         }
1654
         }
1631
       });
1655
       });
1632
-      this.$refs.deviceTable.selectAll(false);
1656
+      this.tableSelection.forEach((item) => {
1657
+        item._checked = false;
1658
+      });
1659
+      this.tableSelection = [];
1633
       let form = {
1660
       let form = {
1634
         pushType: 8,
1661
         pushType: 8,
1635
         pushObj: 1
1662
         pushObj: 1

Loading…
Cancel
Save