ソースを参照

告警规则,关闭关联设备弹窗后 弹窗内容未清空问题处理

jingyuanchao 1 年間 前
コミット
23919c425b
1 ファイル変更14 行追加4 行削除
  1. 14 4
      src/views/warnRule/addRelvance.vue

+ 14 - 4
src/views/warnRule/addRelvance.vue

@@ -154,7 +154,7 @@ import {device} from "@/api/iot/alarmRule";
 const defaultData = {
   left: {
     condition: {
-      orgId: null,
+      orgId:  null,
       deviceName: "",
       searchChild: false,
     },
@@ -165,7 +165,7 @@ const defaultData = {
   },
   right: {
     condition: {
-      orgId: null,
+      orgId:  null,
       deviceName: "",
       searchChild: false,
     },
@@ -223,7 +223,7 @@ export default {
       boundDevicesClone:JSON.parse(JSON.stringify(this.currentTempList)),
       left: {
         condition: {
-          orgId: null,
+          orgId: this.$store.getters.orgId,
           deviceName: "",
           searchChild: false,
         },
@@ -234,7 +234,7 @@ export default {
       },
       right: {
         condition: {
-          orgId: null,
+          orgId: this.$store.getters.orgId,
           deviceName: "",
           searchChild: false,
         },
@@ -323,6 +323,12 @@ export default {
       this.searchDevices = [];
       this.boundDeviceIds = [];
       this.boundDevicesClone = [];
+      this.left.data=[];
+      this.right.data=[];
+      this.left.condition.orgId=this.$store.getters.orgId;
+      this.right.condition.orgId=this.$store.getters.orgId;
+      this.left.condition.deviceName=null;
+      this.right.condition.deviceName=null;
       this.left.condition.searchChild=false;
       this.right.condition.searchChild=false;
     },
@@ -385,7 +391,10 @@ export default {
 
     },
     leftSearch() {
+      console.log("left.condition.searchChild 发生变化!")
       let { condition } = this.left;
+      console.log("this.left.prevCondition",this.left.prevCondition)
+      console.log("this.left.condition",this.left.condition)
       if (
         this.left.prevCondition &&
         JSON.stringify(condition) === JSON.stringify(this.left.prevCondition)
@@ -405,6 +414,7 @@ export default {
           this.searchDevices = result.data.records;
           this.boundDeviceIds = this.boundDevicesClone.map((d) => d.deviceId);
           let data = result.data.records.filter((row) => this.boundDeviceIds.indexOf(row.deviceId) < 0);
+        console.log("data",data)
           this.left.data = data;
         });
     },