From 884b1743406af71dbec26b7cbb0c1717211bb0fe Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Fri, 04 Aug 2023 16:45:09 +0800
Subject: [PATCH] fix:切换因子进行查询

---
 src/views/list/devicesBasic.vue |   48 +++++++++++++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/src/views/list/devicesBasic.vue b/src/views/list/devicesBasic.vue
index 0a554d1..62b48f1 100644
--- a/src/views/list/devicesBasic.vue
+++ b/src/views/list/devicesBasic.vue
@@ -139,6 +139,7 @@
               <a-input
                 v-model="AQIvalue"
                 style="width: 100px; margin-left: 15px"
+                @blur="ceAQIhandleChange"
               />
             </div>
           </div>
@@ -151,11 +152,12 @@
                 style="width: 100px; margin-left: 10px"
                 allowClear
                 :options="ceAQIoptions"
-                @change="ceAQIhandleChange"
+                @change="AQIhandleChange"
               ></a-select>
               <a-input
                 v-model="ceAQIvaluein"
                 style="width: 100px; margin-left: 15px"
+                @blur="ceAQIhandleChange"
               />
             </div>
           </div>
@@ -1284,15 +1286,18 @@
       label: '/',
     },
   ]
-  
+  private changesen:number=0
   private handleChangevalue1(value: string){
-    console.log(value);
+    if(this.changesen===1){
+      this.handleChange2(this.reskey);
+    }
+    this.changesen=1;
   }
   private AQIhandleChange(value: string){
-    console.log(value);
+       this.handleChange2(this.reskey);
   }
   private ceAQIhandleChange(value: string){
-    console.log(value);
+    this.handleChange2(this.reskey);
   }
   private tablecolumns:TableColumnType<datatable>=[
     {
@@ -1337,8 +1342,9 @@
     //   agehou:''
     // }
   ]
+ 
   private rowSelectionChange(selectedRowKeys: string[], selectedRows: DataType[]){
-    //  console.log(selectedRows);
+     console.log(selectedRows);
      this.selectedtable=selectedRows
   }
   private selectedtable:any[]=[]
@@ -1656,8 +1662,11 @@
     }
     this.loadRuleData(1)
   }
+  private reskey:any=0
   private handleChange2(res:any){
-    // console.log(res.key);
+    console.log(res.key);
+    this.reskey=res
+    console.log(this.reskey);
     if(this.selectvalue1==='���������������'){
       this.$message.warning('������������������')
       return
@@ -1671,13 +1680,13 @@
       if(this.selectvalue1==='a99054'){
          for(var i=0;i<this.datatable.length;i++){
           if(this.ceAQIvalue==='+'){
-             this.datatable[i].cel=parseFloat(this.datatable[i].cel+Number(this.ceAQIvaluein)).toFixed(2)
+             this.datatable[i].cel=Number((this.datatable[i].cel + this.ceAQIvaluein).toFixed(2))
           }else if(this.ceAQIvalue==='-'){
-            this.datatable[i].cel=parseFloat(this.datatable[i].cel-Number(this.ceAQIvaluein)).toFixed(2)
+            this.datatable[i].cel=Number((this.datatable[i].cel - this.ceAQIvaluein).toFixed(2))
           }else if(this.ceAQIvalue==='*'){
-            this.datatable[i].cel=parseFloat(this.datatable[i].cel*Number(this.ceAQIvaluein)).toFixed(3)
+            this.datatable[i].cel=Number((this.datatable[i].cel * this.ceAQIvaluein).toFixed(2))
           }else if(this.ceAQIvalue==='/'){
-             this.datatable[i].cel=parseFloat(this.datatable[i].cel/Number(this.ceAQIvaluein)).toFixed(2)
+             this.datatable[i].cel=Number((this.datatable[i].cel / this.ceAQIvaluein).toFixed(3))
           }
            this.datatable[i].agehou='ce1*'+this.datatable[i].cel
          }
@@ -1688,22 +1697,22 @@
         //   this.datatable[i].agehou='aqi*'+this.datatable[i].aqi+'+'+'ce1*'+this.datatable[i].cel
             if(this.AQIvalue1==='+'){
               // console.log(this,'+++');
-              this.datatable[i].aqi=parseFloat((this.datatable[i].aqi) + Number(this.AQIvalue)).toFixed(2)
+              this.datatable[i].aqi=Number((this.datatable[i].aqi + this.AQIvalue).toFixed(2))
             }else if(this.AQIvalue1==='-'){
-              this.datatable[i].aqi=parseFloat(this.datatable[i].aqi - Number(this.AQIvalue)).toFixed(2)
+              this.datatable[i].aqi=Number((this.datatable[i].aqi - this.AQIvalue).toFixed(2))
             } else if(this.AQIvalue1==='*'){
-              this.datatable[i].aqi=parseFloat(this.datatable[i].aqi * Number(this.AQIvalue)).toFixed(3)
+              this.datatable[i].aqi=Number((this.datatable[i].aqi * this.AQIvalue).toFixed(2))
             }else if(this.AQIvalue1==='/'){
-              this.datatable[i].aqi=parseFloat(this.datatable[i].aqi / Number(this.AQIvalue)).toFixed(2)
+              this.datatable[i].aqi=Number((this.datatable[i].aqi / this.AQIvalue).toFixed(2))
             } 
             if(this.ceAQIvalue==='+'){
-             this.datatable[i].cel=parseFloat(this.datatable[i].cel + Number(this.ceAQIvaluein)).toFixed(2)
+             this.datatable[i].cel=Number((this.datatable[i].cel + this.ceAQIvaluein).toFixed(2))
             }else if(this.ceAQIvalue==='-'){
-              this.datatable[i].cel=parseFloat(this.datatable[i].cel - Number(this.ceAQIvaluein)).toFixed(2)
+              this.datatable[i].cel=Number((this.datatable[i].cel - this.ceAQIvaluein).toFixed(2))
             }else if(this.ceAQIvalue==='*'){
-              this.datatable[i].cel=parseFloat(this.datatable[i].cel * Number(this.ceAQIvaluein)).toFixed(3)
+              this.datatable[i].cel=Number((this.datatable[i].cel * this.ceAQIvaluein).toFixed(2))
             }else if(this.ceAQIvalue==='/'){
-              this.datatable[i].cel=parseFloat(this.datatable[i].cel / Number(this.ceAQIvaluein)).toFixed(2)
+              this.datatable[i].cel=Number((this.datatable[i].cel / this.ceAQIvaluein).toFixed(3))
             }
             this.datatable[i].agehou='aqi*'+this.datatable[i].aqi+'+'+'ce1*'+this.datatable[i].cel
         }
@@ -2040,6 +2049,7 @@
     this.visibleCreateModal1=false;
     this.datatable=[]
     this.selectvalue1='���������������'
+    this.changesen=0
   }
 
   private handlerSelectChange(arr1: any, arr2: any) {

--
Gitblit v1.8.0