Browse Source

平板策略违规处理调整

gzb
guozhongbo 7 months ago
parent
commit
8143aafcb4

+ 25
- 16
src/views/schoolSection/strategy/personalStrategy.vue View File

268
             </template>
268
             </template>
269
             <template slot-scope="{ row }" slot="noticed">
269
             <template slot-scope="{ row }" slot="noticed">
270
               <Checkbox
270
               <Checkbox
271
-                :disabled="strategyInfo.model === 'see'"
271
+                :disabled="strategyInfo.model === 'see' || !row.checked"
272
                 class="checked"
272
                 class="checked"
273
                 v-model="row.noticed"
273
                 v-model="row.noticed"
274
                 @on-change="headleStrategy(row, 'noticed')"
274
                 @on-change="headleStrategy(row, 'noticed')"
276
               >
276
               >
277
             </template>
277
             </template>
278
             <template slot-scope="{ row }" slot="violationHandling">
278
             <template slot-scope="{ row }" slot="violationHandling">
279
-              <RadioGroup
279
+              <CheckboxGroup
280
                 v-model="row.handleMethod"
280
                 v-model="row.handleMethod"
281
                 @on-change="headleStrategy(row, 'handleMethod')"
281
                 @on-change="headleStrategy(row, 'handleMethod')"
282
               >
282
               >
283
-                <Radio
283
+                <Checkbox
284
                   style="margin-right: 20px"
284
                   style="margin-right: 20px"
285
-                  :disabled="strategyInfo.model === 'see'"
285
+                  :disabled="strategyInfo.model === 'see' || !row.checked"
286
                   label="锁定"
286
                   label="锁定"
287
-                ></Radio>
288
-                <Radio
289
-                  :disabled="strategyInfo.model === 'see'"
287
+                ></Checkbox>
288
+                <Checkbox
289
+                  :disabled="strategyInfo.model === 'see' || !row.checked"
290
                   label="恢复出厂设置"
290
                   label="恢复出厂设置"
291
-                ></Radio>
292
-              </RadioGroup>
291
+                ></Checkbox>
292
+              </CheckboxGroup>
293
             </template>
293
             </template>
294
           </Table>
294
           </Table>
295
           <div class="nodata" v-if="!strategyInfo.hasviolate">
295
           <div class="nodata" v-if="!strategyInfo.hasviolate">
496
       this.padViolates.forEach((item) => {
496
       this.padViolates.forEach((item) => {
497
         if (item.violateType === row.violateType) {
497
         if (item.violateType === row.violateType) {
498
           item[key] = row[key];
498
           item[key] = row[key];
499
+          if (key === "checked") {
500
+            //默认锁定
501
+            item.handleMethod = ["锁定"];
502
+          } else if (key === "handleMethod") {
503
+            //只能二选一 去掉第一个
504
+            if (row.handleMethod.length === 2) {
505
+              item[key] = row[key].slice(1);
506
+            }
507
+          }
499
           if (!item.checked) {
508
           if (!item.checked) {
500
             item.noticed = false;
509
             item.noticed = false;
501
-            item.handleMethod = "";
510
+            item.handleMethod = [];
502
             this.$forceUpdate();
511
             this.$forceUpdate();
503
           }
512
           }
504
         }
513
         }
522
           this.padViolates.forEach((item) => {
531
           this.padViolates.forEach((item) => {
523
             item.checked = false;
532
             item.checked = false;
524
             item.noticed = false;
533
             item.noticed = false;
525
-            item.handleMethod = "";
534
+            item.handleMethod = [];
526
           });
535
           });
527
         }
536
         }
528
       }
537
       }
546
       this.padViolates.forEach((item) => {
555
       this.padViolates.forEach((item) => {
547
         item.checked = false;
556
         item.checked = false;
548
         item.noticed = false;
557
         item.noticed = false;
549
-        item.handleMethod = "";
558
+        item.handleMethod = [];
550
       });
559
       });
551
       this.padApps.forEach((item) => {
560
       this.padApps.forEach((item) => {
552
         item.checked = false;
561
         item.checked = false;
603
               });
612
               });
604
               item.checked = arr.length > 0 ? true : false;
613
               item.checked = arr.length > 0 ? true : false;
605
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
614
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
606
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
615
+              item.handleMethod = arr.length > 0 ? [arr[0].handleMethod] : [];
607
             });
616
             });
608
           }
617
           }
609
           this.strategyInfo.padWifis = res.obj.padWifis || [];
618
           this.strategyInfo.padWifis = res.obj.padWifis || [];
707
         if (item.checked) {
716
         if (item.checked) {
708
           padViolates.push({
717
           padViolates.push({
709
             violateType: item.violateType,
718
             violateType: item.violateType,
710
-            handleMethod: item.handleMethod || "",
719
+            handleMethod: item.handleMethod[0] || "",
711
             noticed: item.noticed ? 1 : 0
720
             noticed: item.noticed ? 1 : 0
712
           });
721
           });
713
         }
722
         }
859
               });
868
               });
860
               item.checked = arr.length > 0 ? true : false;
869
               item.checked = arr.length > 0 ? true : false;
861
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
870
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
862
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
871
+              item.handleMethod = arr.length > 0 ? [arr[0].handleMethod] : [];
863
             });
872
             });
864
           }
873
           }
865
           this.strategyInfo.padWifis = res.obj.padWifis || [];
874
           this.strategyInfo.padWifis = res.obj.padWifis || [];
940
               });
949
               });
941
               item.checked = arr.length > 0 ? true : false;
950
               item.checked = arr.length > 0 ? true : false;
942
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
951
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
943
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
952
+              item.handleMethod = arr.length > 0 ? [arr[0].handleMethod] : [];
944
             });
953
             });
945
           }
954
           }
946
           this.strategyInfo.show = true;
955
           this.strategyInfo.show = true;

+ 30
- 13
src/views/schoolSection/strategy/publicStrategy.vue View File

219
         </template>
219
         </template>
220
         <template slot-scope="{ row }" slot="noticed">
220
         <template slot-scope="{ row }" slot="noticed">
221
           <Checkbox
221
           <Checkbox
222
-            :disabled="curState === 1"
222
+            :disabled="curState === 1 || !row.checked"
223
             class="checked"
223
             class="checked"
224
             v-model="row.noticed"
224
             v-model="row.noticed"
225
             @on-change="headleStrategy(row, 'noticed')"
225
             @on-change="headleStrategy(row, 'noticed')"
227
           >
227
           >
228
         </template>
228
         </template>
229
         <template slot-scope="{ row }" slot="violationHandling">
229
         <template slot-scope="{ row }" slot="violationHandling">
230
-          <RadioGroup
230
+          <CheckboxGroup
231
             v-model="row.handleMethod"
231
             v-model="row.handleMethod"
232
             @on-change="headleStrategy(row, 'handleMethod')"
232
             @on-change="headleStrategy(row, 'handleMethod')"
233
           >
233
           >
234
-            <Radio
234
+            <Checkbox
235
               style="margin-right: 20px"
235
               style="margin-right: 20px"
236
-              :disabled="curState === 1"
236
+              :disabled="curState === 1 || !row.checked"
237
               label="锁定"
237
               label="锁定"
238
-            ></Radio>
239
-            <Radio :disabled="curState === 1" label="恢复出厂设置"></Radio>
240
-          </RadioGroup>
238
+            ></Checkbox>
239
+            <Checkbox
240
+              :disabled="curState === 1 || !row.checked"
241
+              label="恢复出厂设置"
242
+            ></Checkbox>
243
+          </CheckboxGroup>
241
         </template>
244
         </template>
242
       </Table>
245
       </Table>
243
       <div class="nodata" v-if="!strategyInfo.hasviolate">未设置违规处理</div>
246
       <div class="nodata" v-if="!strategyInfo.hasviolate">未设置违规处理</div>
382
       this.padViolates.forEach((item) => {
385
       this.padViolates.forEach((item) => {
383
         if (item.violateType === row.violateType) {
386
         if (item.violateType === row.violateType) {
384
           item[key] = row[key];
387
           item[key] = row[key];
388
+          if (key === "checked") {
389
+            //默认锁定
390
+            item.handleMethod = ["锁定"];
391
+          } else if (key === "handleMethod") {
392
+            //只能二选一 去掉第一个
393
+            if (row.handleMethod.length === 2) {
394
+              item[key] = row[key].slice(1);
395
+            }
396
+          }
397
+          if (!item.checked) {
398
+            item.noticed = false;
399
+            item.handleMethod = [];
400
+            this.$forceUpdate();
401
+          }
385
         }
402
         }
386
       });
403
       });
387
     },
404
     },
403
           this.padViolates.forEach((item) => {
420
           this.padViolates.forEach((item) => {
404
             item.checked = false;
421
             item.checked = false;
405
             item.noticed = false;
422
             item.noticed = false;
406
-            item.handleMethod = "";
423
+            item.handleMethod = [];
407
           });
424
           });
408
         }
425
         }
409
       }
426
       }
469
               });
486
               });
470
               item.checked = arr.length > 0 ? true : false;
487
               item.checked = arr.length > 0 ? true : false;
471
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
488
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
472
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
489
+              item.handleMethod = arr.length > 0 ? [arr[0].handleMethod] : [];
473
             });
490
             });
474
           }
491
           }
475
           //刷新左侧树
492
           //刷新左侧树
572
         if (item.checked) {
589
         if (item.checked) {
573
           padViolates.push({
590
           padViolates.push({
574
             violateType: item.violateType,
591
             violateType: item.violateType,
575
-            handleMethod: item.handleMethod || "",
592
+            handleMethod: item.handleMethod[0] || "",
576
             noticed: item.noticed ? 1 : 0
593
             noticed: item.noticed ? 1 : 0
577
           });
594
           });
578
         }
595
         }
717
               });
734
               });
718
               item.checked = arr.length > 0 ? true : false;
735
               item.checked = arr.length > 0 ? true : false;
719
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
736
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
720
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
737
+              item.handleMethod = arr.length > 0 ? [arr[0].handleMethod] : [];
721
             });
738
             });
722
           }
739
           }
723
           this.strategyInfo.padWifis = res.obj.padWifis || [];
740
           this.strategyInfo.padWifis = res.obj.padWifis || [];
741
           this.padViolates.forEach((item) => {
758
           this.padViolates.forEach((item) => {
742
             item.checked = false;
759
             item.checked = false;
743
             item.noticed = false;
760
             item.noticed = false;
744
-            item.handleMethod = "";
761
+            item.handleMethod = [];
745
           });
762
           });
746
           this.strategyInfo.padWifis = [];
763
           this.strategyInfo.padWifis = [];
747
           this.strategyInfo.padTimes = [];
764
           this.strategyInfo.padTimes = [];
764
       this.padViolates.forEach((item) => {
781
       this.padViolates.forEach((item) => {
765
         item.checked = false;
782
         item.checked = false;
766
         item.noticed = false;
783
         item.noticed = false;
767
-        item.handleMethod = "";
784
+        item.handleMethod = [];
768
       });
785
       });
769
       //获取应用列表
786
       //获取应用列表
770
       this.showLoading = true;
787
       this.showLoading = true;

+ 23
- 16
src/views/schoolSection/strategy/strategyTemplate.vue View File

302
             </template>
302
             </template>
303
             <template slot-scope="{ row }" slot="noticed">
303
             <template slot-scope="{ row }" slot="noticed">
304
               <Checkbox
304
               <Checkbox
305
-                :disabled="strategyInfo.model === '查看'"
305
+                :disabled="strategyInfo.model === '查看' || !row.checked"
306
                 class="checked"
306
                 class="checked"
307
                 v-model="row.noticed"
307
                 v-model="row.noticed"
308
                 @on-change="headleStrategy(row, 'noticed')"
308
                 @on-change="headleStrategy(row, 'noticed')"
310
               >
310
               >
311
             </template>
311
             </template>
312
             <template slot-scope="{ row }" slot="violationHandling">
312
             <template slot-scope="{ row }" slot="violationHandling">
313
-              <RadioGroup
313
+              <CheckboxGroup
314
                 v-model="row.handleMethod"
314
                 v-model="row.handleMethod"
315
                 @on-change="headleStrategy(row, 'handleMethod')"
315
                 @on-change="headleStrategy(row, 'handleMethod')"
316
               >
316
               >
317
-                <Radio
317
+                <Checkbox
318
                   style="margin-right: 20px"
318
                   style="margin-right: 20px"
319
-                  :disabled="strategyInfo.model === '查看'"
319
+                  :disabled="strategyInfo.model === '查看' || !row.checked"
320
                   label="锁定"
320
                   label="锁定"
321
-                  >锁定</Radio
322
-                >
323
-                <Radio
324
-                  :disabled="strategyInfo.model === '查看'"
321
+                ></Checkbox>
322
+                <Checkbox
323
+                  :disabled="strategyInfo.model === '查看' || !row.checked"
325
                   label="恢复出厂设置"
324
                   label="恢复出厂设置"
326
-                  >恢复出厂设置</Radio
327
-                >
328
-              </RadioGroup>
325
+                ></Checkbox>
326
+              </CheckboxGroup>
329
             </template>
327
             </template>
330
           </Table>
328
           </Table>
331
           <div class="nodata" v-if="!strategyInfo.hasviolate">
329
           <div class="nodata" v-if="!strategyInfo.hasviolate">
496
       this.padViolates.forEach((item) => {
494
       this.padViolates.forEach((item) => {
497
         if (item.violateType === row.violateType) {
495
         if (item.violateType === row.violateType) {
498
           item[key] = row[key];
496
           item[key] = row[key];
497
+          if (key === "checked") {
498
+            //默认锁定
499
+            item.handleMethod = ["锁定"];
500
+          } else if (key === "handleMethod") {
501
+            //只能二选一 去掉第一个
502
+            if (row.handleMethod.length === 2) {
503
+              item[key] = row[key].slice(1);
504
+            }
505
+          }
499
           if (!item.checked) {
506
           if (!item.checked) {
500
             item.noticed = false;
507
             item.noticed = false;
501
-            item.handleMethod = "";
508
+            item.handleMethod = [];
502
             this.$forceUpdate();
509
             this.$forceUpdate();
503
           }
510
           }
504
         }
511
         }
522
           this.padViolates.forEach((item) => {
529
           this.padViolates.forEach((item) => {
523
             item.checked = false;
530
             item.checked = false;
524
             item.noticed = false;
531
             item.noticed = false;
525
-            item.handleMethod = "";
532
+            item.handleMethod = [];
526
           });
533
           });
527
         }
534
         }
528
       }
535
       }
582
         if (item.checked) {
589
         if (item.checked) {
583
           padViolates.push({
590
           padViolates.push({
584
             violateType: item.violateType,
591
             violateType: item.violateType,
585
-            handleMethod: item.handleMethod || "",
592
+            handleMethod: item.handleMethod[0] || "",
586
             noticed: item.noticed ? 1 : 0
593
             noticed: item.noticed ? 1 : 0
587
           });
594
           });
588
         }
595
         }
726
       this.padViolates.forEach((item) => {
733
       this.padViolates.forEach((item) => {
727
         item.checked = false;
734
         item.checked = false;
728
         item.noticed = false;
735
         item.noticed = false;
729
-        item.handleMethod = "";
736
+        item.handleMethod = [];
730
       });
737
       });
731
       this.padApps.forEach((item) => {
738
       this.padApps.forEach((item) => {
732
         item.checked = false;
739
         item.checked = false;
842
               });
849
               });
843
               item.checked = arr.length > 0 ? true : false;
850
               item.checked = arr.length > 0 ? true : false;
844
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
851
               item.noticed = arr.length > 0 && arr[0].noticed ? true : false;
845
-              item.handleMethod = arr.length > 0 ? arr[0].handleMethod : "";
852
+              item.handleMethod = arr.length > 0 ? [arr[0].handleMethod] : [];
846
             });
853
             });
847
           }
854
           }
848
           this.strategyInfo.show = true;
855
           this.strategyInfo.show = true;

Loading…
Cancel
Save