Browse Source

学校-违规设备没有用户id不推送日志

gzb
wangzhonglu 8 months ago
parent
commit
53aad3f18b

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

14
         </Select>
14
         </Select>
15
         <Input
15
         <Input
16
           v-model="searchForm.name"
16
           v-model="searchForm.name"
17
-          placeholder="请输入姓名、登录账号、设备号、设备型号"
17
+          placeholder="请输入设备号"
18
           search
18
           search
19
           @on-search="searchList()"
19
           @on-search="searchList()"
20
           style="width: 310px"
20
           style="width: 310px"
412
         title: "提示",
412
         title: "提示",
413
         content: "确定对所选设备进行恢复出厂设置操作吗?",
413
         content: "确定对所选设备进行恢复出厂设置操作吗?",
414
         onOk: () => {
414
         onOk: () => {
415
-          this.controlRestoreFactory([row.sn], [row.userid]);
415
+          this.controlRestoreFactory([row.sn], row.userid ? [row.userid] : []);
416
         },
416
         },
417
         onCancel: () => {}
417
         onCancel: () => {}
418
       });
418
       });
451
       let useridList = [];
451
       let useridList = [];
452
       userList.forEach((item) => {
452
       userList.forEach((item) => {
453
         snList.push(item.sn);
453
         snList.push(item.sn);
454
-        useridList.push(item.userid);
454
+        if (item.userid) {
455
+          useridList.push(item.userid);
456
+        }
455
       });
457
       });
456
       if (name === "1") {
458
       if (name === "1") {
457
         // 恢复出厂
459
         // 恢复出厂
736
     },
738
     },
737
     // 添加推送日志
739
     // 添加推送日志
738
     addPushLog(form) {
740
     addPushLog(form) {
741
+      if (form.userids && form.userids.length === 0) {
742
+        return;
743
+      }
739
       logPush_add(form).then((data) => {
744
       logPush_add(form).then((data) => {
740
         if (data.code === 0) {
745
         if (data.code === 0) {
741
           this.$Message.success(data.msg);
746
           this.$Message.success(data.msg);

+ 6
- 1
src/views/schoolSection/deviceManage/deviceManage.vue View File

1271
       let useridList = [];
1271
       let useridList = [];
1272
       userList.forEach((item) => {
1272
       userList.forEach((item) => {
1273
         snList.push(item.sn);
1273
         snList.push(item.sn);
1274
-        useridList.push(item.userid);
1274
+        if (item.userid) {
1275
+          useridList.push(item.userid);
1276
+        }
1275
       });
1277
       });
1276
       if (name === "1") {
1278
       if (name === "1") {
1277
         // 恢复出厂
1279
         // 恢复出厂
1576
     },
1578
     },
1577
     // 添加推送日志
1579
     // 添加推送日志
1578
     addPushLog(form) {
1580
     addPushLog(form) {
1581
+      if (form.userids && form.userids.length === 0) {
1582
+        return;
1583
+      }
1579
       logPush_add(form).then((data) => {
1584
       logPush_add(form).then((data) => {
1580
         if (data.code !== 0) {
1585
         if (data.code !== 0) {
1581
           this.$Message.error(data.msg);
1586
           this.$Message.error(data.msg);

Loading…
Cancel
Save