zhengkaixin 11 tháng trước cách đây
mục cha
commit
cfcdf80a8c
2 tập tin đã thay đổi với 117 bổ sung144 xóa
  1. 49 50
      pages/abnormal/abnormalAlarmDetails.vue
  2. 68 94
      pages/abnormal/abnormalContrastDetails.vue

+ 49 - 50
pages/abnormal/abnormalAlarmDetails.vue

@@ -48,13 +48,21 @@
 			<view v-if="alarmConfig.code=='TPU'&&childDcMap&&childDcMap.length">
 				
 		
-				<view class="item" @click="orderByShow=true">
+				<view class="item">
 					<view class="title">
-						三项电流详情(A)
+						查询数量
 					</view>
 					<view >
-						{{orderByIndex.label}}	
-						<u-icon name="arrow-down"></u-icon>
+						 
+						<span v-for="(item,i) in queryNumSz"
+						 @click="queryNum=item,getAlarmRecordTPUDetails(id,remoteMonitorMeter.id)"
+						 :class="{
+							queryNum:1,
+							queryNumIndex:item==queryNum
+						}">
+							{{item}}
+						</span>
+					
 					</view>
 				</view>
 				<view class="item">
@@ -62,30 +70,18 @@
 						  <tr>
 						    <td>设备名称</td>
 						   
-							<td  :class="{
-								orderByIndex:(orderByIndex.value==0||orderByIndex.value==2)
-							}">A相</td>
-							 <td  :class="{
-								orderByIndex:(orderByIndex.value==0||orderByIndex.value==1)
-							}">B相</td>
-							<td  :class="{
-								orderByIndex:(orderByIndex.value==1||orderByIndex.value==2)
-							}">C相</td>
+							 <td v-for="(item,i) in keySz" :key="i" :class="'keySz'+i">
+								 {{item.name}}
+							 </td>
 							
 						  </tr> 
-						   <tr v-for="(item,i) in childDcMap" :key="i" :class="{
-							   childDcMap:i==0
+						   <tr v-for="(item1,j) in childDcMap" :key="i" :class="{
+							   childDcMap:j==0
 						   }">
-							 <td >{{item.meterName}}</td>
-						     <td  :class="{
-								orderByIndex:(orderByIndex.value==0||orderByIndex.value==2)
-							}">{{item.dcAA}}</td>
-						     <td  :class="{
-								orderByIndex:(orderByIndex.value==0||orderByIndex.value==1)
-							}">{{item.dcBa}}</td>
-						   	<td  :class="{
-								orderByIndex:(orderByIndex.value==1||orderByIndex.value==2)
-							}">{{item.dcCa}}</td>
+							 <td >{{item1.meterName}}</td>
+						    <td v-for="(item,i) in keySz" :key="i" :class="'keySz'+i">
+						    		 {{item1[item.value]}}
+						    </td>
 						  
 						   </tr> 
 						  
@@ -176,7 +172,10 @@
 					},{
 						value:"2",label:"按C与A的差值排序"
 					},
-				]
+				],
+				queryNum:5,
+				queryNumSz:[5,8,10,15],
+				keySz:[],
 			}
 		},
 		onLoad(op) {
@@ -191,27 +190,7 @@
 		},
 		methods: {
 			childDcMapsort(){
-				var id=this.remoteMonitorMeter.id;
-				var value=this.orderByIndex.value
-				var childDcMap=[]
-			
-				this.childDcMap.sort((it1,it2)=>{
-					if(it1.meterId==id){
-					
-						return -1
-					}
-					if(it2.meterId==id){
-					
-						return 1
-					}
-					if(value=='0'){
-						return it1.abDifference<it2.abDifference?1:-1
-					}else if(value=='1'){
-						return it1.bcDifference<it2.bcDifference?1:-1
-					}else if(value=='2'){
-						return it1.acDifference<it2.acDifference?1:-1
-					}
-				})
+				
 				
 			},
 			orderconfirm(e){
@@ -227,9 +206,21 @@
 				API.alarmRecordTPUDetails({
 					meterId:meterId,
 					id:id,
+					queryNum:this.queryNum,
 				}).then((response) => {
+				
 					uni.hideLoading();
 						this.childDcMap=response.data.childDcMap;
+						var sz=response.data.sort;
+							this.keySz=[]
+						for(var i in sz){
+							
+							var obj=sz[i].split(',')
+							this.keySz.push({
+								name:obj[0],
+								value:obj[1]
+							})
+						}
 				this.childDcMapsort()
 				}).catch(error => {
 					uni.showToast({
@@ -518,13 +509,21 @@
 		    background-color: #fff;  
 		  }  
 	}
-	.orderByIndex{
+	.keySz0,.keySz1{
 		font-weight: bold;
-		background-color: #CDDC39;
+		background-color: #f8f0a6;
 	}
 	.childDcMap td{
 		background-color: #1677FF !important ;
 		color:#fff !important ;
 	}
-	
+	.queryNum{
+		border: 1px solid #9E9E9E;
+		    padding: 4rpx 16rpx;
+		    margin: 8rpx ;
+	}
+	.queryNumIndex{
+		    color: #fff;
+		    background: #1677FF;
+	}
 </style>

+ 68 - 94
pages/abnormal/abnormalContrastDetails.vue

@@ -34,48 +34,44 @@
 			<view>
 
 
-				<view class="item" @click="orderByShow=true">
-					<view class="title">
-						三项电流详情(A)
-					</view>
-					<view>
-						{{orderByIndex.label}}
-						<u-icon name="arrow-down"></u-icon>
-					</view>
+				<view class="item">
+					<view class="title">
+						查询数量
+					</view>
+					<view >
+						 
+						<span v-for="(item,i) in queryNumSz"
+						 @click="queryNum=item,getAlarmRecordTPUDetails(id)"
+						 :class="{
+							queryNum:1,
+							queryNumIndex:item==queryNum
+						}">
+							{{item}}
+						</span>
+					
+					</view>
 				</view>
-				<view class="item">
-					<table class="border-table ">
-							  <tr>
-							    <td>设备名称</td>
-							   
-								<td  :class="{
-									orderByIndex:(orderByIndex.value==0||orderByIndex.value==2)
-								}">A相</td>
-								 <td  :class="{
-									orderByIndex:(orderByIndex.value==0||orderByIndex.value==1)
-								}">B相</td>
-								<td  :class="{
-									orderByIndex:(orderByIndex.value==1||orderByIndex.value==2)
-								}">C相</td>
-								
-							  </tr> 
-							   <tr v-for="(item,i) in childDcMap" :key="i" :class="{
-								   childDcMap:i==0
-							   }">
-								 <td >{{item.meterName}}</td>
-							     <td  :class="{
-									orderByIndex:(orderByIndex.value==0||orderByIndex.value==2)
-								}">{{item.dcAA}}</td>
-							     <td  :class="{
-									orderByIndex:(orderByIndex.value==0||orderByIndex.value==1)
-								}">{{item.dcBa}}</td>
-							   	<td  :class="{
-									orderByIndex:(orderByIndex.value==1||orderByIndex.value==2)
-								}">{{item.dcCa}}</td>
-							  
-							   </tr> 
-							  
-					</table>
+				<view class="item">
+					  <table class="border-table ">
+						  <tr>
+						    <td>设备名称</td>
+						   
+							 <td v-for="(item,i) in keySz" :key="i" :class="'keySz'+i">
+								 {{item.name}}
+							 </td>
+							
+						  </tr> 
+						   <tr v-for="(item1,j) in childDcMap" :key="i" :class="{
+							   childDcMap:j==0
+						   }">
+							 <td >{{item1.meterName}}</td>
+						    <td v-for="(item,i) in keySz" :key="i" :class="'keySz'+i">
+						    		 {{item1[item.value]}}
+						    </td>
+						  
+						   </tr> 
+						  
+					  </table>
 				</view>
 
 			</view>
@@ -163,7 +159,10 @@
 				}, {
 					value: "2",
 					label: "按C与A的差值排序"
-				}, ]
+				}, ],
+				queryNum:5,
+				queryNumSz:[5,8,10,15],
+				keySz:[],
 			}
 		},
 		onLoad(op) {
@@ -180,27 +179,7 @@
 		},
 		methods: {
 			childDcMapsort() {
-				var value = this.orderByIndex.value
-				var childDcMap = []
-				var id = this.remoteMonitorMeter.id;
 				
-				this.childDcMap.sort((it1, it2) => {
-					if (it1.meterId == id) {
-					
-						return -1
-					}
-					if (it2.meterId == id) {
-					
-						return 1
-					}
-					if (value == '0') {
-						return it1.abDifference < it2.abDifference ? 1 : -1
-					} else if (value == '1') {
-						return it1.bcDifference < it2.bcDifference ? 1 : -1
-					} else if (value == '2') {
-						return it1.acDifference < it2.acDifference ? 1 : -1
-					}
-				})
 			},
 			orderconfirm(e) {
 				console.log(e)
@@ -220,7 +199,16 @@
 					this.childDcMap = response.data.childDcMap;
 					this.companyInfo = response.data.companyInfo;
 					this.remoteMonitorMeter = response.data.meter;
-
+					var sz=response.data.sort;
+					this.keySz=[]
+					for(var i in sz){
+						
+						var obj=sz[i].split(',')
+						this.keySz.push({
+							name:obj[0],
+							value:obj[1]
+						})
+					}
 					this.childDcMapsort()
 				}).catch(error => {
 					uni.showToast({
@@ -230,29 +218,7 @@
 				})
 			},
 			getAlarmRecordDetails(id) {
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				API.alarmRecordDetails(id).then((response) => {
-					uni.hideLoading();
-					this.companyInfo = response.data.companyInfo;
-					this.remoteMonitorMeter = response.data.meter;
-
-					this.remoteMonitorRecord = response.data.remoteMonitorRecord;
-					this.alarmRecord = response.data.alarmRecord;
-					this.alarmConfig = response.data.alarmConfig;
-					if (this.alarmConfig.code == 'TPU') {
-						//	this.childDcMap=response.data.childDcMap;
-						this.getAlarmRecordTPUDetails(id, this.remoteMonitorMeter.id)
-					}
-
-				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-				})
+				
 			},
 			getLineCharts() {
 				if (!this.myLineChart) {
@@ -523,13 +489,21 @@
 		}
 	}
 
-	.orderByIndex {
-		font-weight: bold;
-		background-color: #CDDC39;
-	}
-
-	.childDcMap td {
-		background-color: #1677FF !important;
-		color: #fff !important;
+	.keySz0,.keySz1{
+		font-weight: bold;
+		background-color: #f8f0a6;
+	}
+	.childDcMap td{
+		background-color: #1677FF !important ;
+		color:#fff !important ;
+	}
+	.queryNum{
+		border: 1px solid #9E9E9E;
+		    padding: 4rpx 16rpx;
+		    margin: 8rpx ;
+	}
+	.queryNumIndex{
+		    color: #fff;
+		    background: #1677FF;
 	}
 </style>