Ver código fonte

学校-设备管理其他操作优化

gzb
wangzhonglu 8 meses atrás
pai
commit
050a4076ed

+ 6
- 30
src/views/schoolSection/deviceManage/breakRuleDevice.vue Ver arquivo

@@ -542,11 +542,7 @@ export default {
542 542
         pushType: 6,
543 543
         pushObj: 1
544 544
       };
545
-      if (snList.length > 1) {
546
-        form.userids = useridList;
547
-      } else {
548
-        form.pushObjid = useridList[0];
549
-      }
545
+      form.userids = useridList;
550 546
       this.addPushLog(form);
551 547
     },
552 548
     // 发送消息
@@ -568,11 +564,7 @@ export default {
568 564
             pushObj: 1,
569 565
             content: this.controlMessageInfo.content
570 566
           };
571
-          if (snList.length > 1) {
572
-            form.userids = useridList;
573
-          } else {
574
-            form.pushObjid = useridList[0];
575
-          }
567
+          form.userids = useridList;
576 568
           this.addPushLog(form);
577 569
         }
578 570
       });
@@ -590,11 +582,7 @@ export default {
590 582
         pushType: 2,
591 583
         pushObj: 1
592 584
       };
593
-      if (snList.length > 1) {
594
-        form.userids = useridList;
595
-      } else {
596
-        form.pushObjid = useridList[0];
597
-      }
585
+      form.userids = useridList;
598 586
       this.addPushLog(form);
599 587
     },
600 588
     // 限制使用
@@ -610,11 +598,7 @@ export default {
610 598
         pushType: 3,
611 599
         pushObj: 1
612 600
       };
613
-      if (snList.length > 1) {
614
-        form.userids = useridList;
615
-      } else {
616
-        form.pushObjid = useridList[0];
617
-      }
601
+      form.userids = useridList;
618 602
       this.addPushLog(form);
619 603
     },
620 604
     // 更新策略
@@ -630,11 +614,7 @@ export default {
630 614
         pushType: 4,
631 615
         pushObj: 1
632 616
       };
633
-      if (snList.length > 1) {
634
-        form.userids = useridList;
635
-      } else {
636
-        form.pushObjid = useridList[0];
637
-      }
617
+      form.userids = useridList;
638 618
       this.addPushLog(form);
639 619
     },
640 620
     // 重启设备
@@ -650,11 +630,7 @@ export default {
650 630
         pushType: 4,
651 631
         pushObj: 1
652 632
       };
653
-      if (snList.length > 1) {
654
-        form.userids = useridList;
655
-      } else {
656
-        form.pushObjid = useridList[0];
657
-      }
633
+      form.userids = useridList;
658 634
       this.addPushLog(form);
659 635
     },
660 636
     // 添加推送日志

+ 23
- 43
src/views/schoolSection/deviceManage/deviceManage.vue Ver arquivo

@@ -975,19 +975,23 @@ export default {
975 975
           this.strategyInfo.padApps = res.obj.padApps || [];
976 976
           this.strategyInfo.padWifis = res.obj.padWifis || [];
977 977
           this.strategyInfo.padTimes = res.obj.padTimes || [];
978
-          let pdtypeInfo = {};
979
-          this.strategyInfo.padDevices = res.obj.padDevices;
980
-          this.strategyInfo.padDevices.forEach((item) => {
981
-            pdtypeInfo[item.pdtype] = item.enabled;
982
-          });
983
-          this.strategyInfo.pdtypeInfo = pdtypeInfo;
984
-          let violatesInfo = {};
985
-          this.strategyInfo.padViolates = res.obj.padViolates;
986
-          this.strategyInfo.padViolates.forEach((item) => {
987
-            violatesInfo[item.violateType] =
988
-              item.handle_method && item.handle_method.split(";");
989
-          });
990
-          this.strategyInfo.violatesInfo = violatesInfo;
978
+          if (this.strategyInfo.hasdevice) {
979
+            let pdtypeInfo = {};
980
+            this.strategyInfo.padDevices = res.obj.padDevices;
981
+            this.strategyInfo.padDevices.forEach((item) => {
982
+              pdtypeInfo[item.pdtype] = item.enabled;
983
+            });
984
+            this.strategyInfo.pdtypeInfo = pdtypeInfo;
985
+          }
986
+          if (this.strategyInfo.hasviolate) {
987
+            let violatesInfo = {};
988
+            this.strategyInfo.padViolates = res.obj.padViolates;
989
+            this.strategyInfo.padViolates.forEach((item) => {
990
+              violatesInfo[item.violateType] =
991
+                item.handle_method && item.handle_method.split(";");
992
+            });
993
+            this.strategyInfo.violatesInfo = violatesInfo;
994
+          }
991 995
           this.strategyInfo.show = true;
992 996
         } else {
993 997
           this.$Message.error(res.msg);
@@ -1149,11 +1153,7 @@ export default {
1149 1153
         pushType: 6,
1150 1154
         pushObj: 1
1151 1155
       };
1152
-      if (snList.length > 1) {
1153
-        form.userids = useridList;
1154
-      } else {
1155
-        form.pushObjid = useridList[0];
1156
-      }
1156
+      form.userids = useridList;
1157 1157
       this.addPushLog(form);
1158 1158
     },
1159 1159
     // 发送消息
@@ -1178,11 +1178,7 @@ export default {
1178 1178
           if (this.controlMessageInfo.classid) {
1179 1179
             form.pushObjid = this.controlMessageInfo.classid;
1180 1180
           } else {
1181
-            if (snList.length > 1) {
1182
-              form.userids = useridList;
1183
-            } else {
1184
-              form.pushObjid = useridList[0];
1185
-            }
1181
+            form.userids = useridList;
1186 1182
           }
1187 1183
           this.addPushLog(form);
1188 1184
         }
@@ -1201,11 +1197,7 @@ export default {
1201 1197
         pushType: 2,
1202 1198
         pushObj: 1
1203 1199
       };
1204
-      if (snList.length > 1) {
1205
-        form.userids = useridList;
1206
-      } else {
1207
-        form.pushObjid = useridList[0];
1208
-      }
1200
+      form.userids = useridList;
1209 1201
       this.addPushLog(form);
1210 1202
     },
1211 1203
     // 限制使用
@@ -1221,11 +1213,7 @@ export default {
1221 1213
         pushType: 3,
1222 1214
         pushObj: 1
1223 1215
       };
1224
-      if (snList.length > 1) {
1225
-        form.userids = useridList;
1226
-      } else {
1227
-        form.pushObjid = useridList[0];
1228
-      }
1216
+      form.userids = useridList;
1229 1217
       this.addPushLog(form);
1230 1218
     },
1231 1219
     // 更新策略
@@ -1241,11 +1229,7 @@ export default {
1241 1229
         pushType: 4,
1242 1230
         pushObj: 1
1243 1231
       };
1244
-      if (snList.length > 1) {
1245
-        form.userids = useridList;
1246
-      } else {
1247
-        form.pushObjid = useridList[0];
1248
-      }
1232
+      form.userids = useridList;
1249 1233
       this.addPushLog(form);
1250 1234
     },
1251 1235
     // 重启设备
@@ -1261,11 +1245,7 @@ export default {
1261 1245
         pushType: 4,
1262 1246
         pushObj: 1
1263 1247
       };
1264
-      if (snList.length > 1) {
1265
-        form.userids = useridList;
1266
-      } else {
1267
-        form.pushObjid = useridList[0];
1268
-      }
1248
+      form.userids = useridList;
1269 1249
       this.addPushLog(form);
1270 1250
     },
1271 1251
     // 添加推送日志

Carregando…
Cancelar
Salvar