Ver código fonte

异常记录

wkyy 1 ano atrás
pai
commit
5faca2b1cf

+ 1 - 0
pages/equipmentDataMonitoring/dataMonitoring-list.vue

@@ -297,6 +297,7 @@
 			toElectronicMonitoring(item) {
 				uni.navigateTo({
 					url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
+						+ '&companyId=' + item.companyId
 				})
 			}
 		}

+ 67 - 41
pages/equipmentDataMonitoring/electronicMonitoring.vue

@@ -16,7 +16,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<!-- 设备选择器 -->
 		<u-select title="设备选择" v-model="tabsFrom.show1" mode="mutil-column-auto" :list="tabsFrom.selector1"
 			@confirm="selector1confirm" cancel-text="重置" @cancel="selector1cancel">
@@ -125,7 +125,7 @@
 			<view style="text-align: center;background: white;">当日电量合计:{{sumQuantity}}度</view>
 		</view>
 		<!-- 异常波动 -->
-		<view class="abnormal">
+		<view class="abnormal" v-if="abnormalRecordsList.length != 0">
 			<view class="headline">
 				<view class="title">
 					<view class="icon">
@@ -387,7 +387,9 @@
 	export default {
 		data() {
 			return {
-				meterId: '',
+				abnormalRecordsList: [], //异常list
+				companyId: '', //企业id
+				meterId: '', //设备id
 				titleName: '',
 				clickType: 0,
 				sumQuantity: 0,
@@ -476,6 +478,7 @@
 				this.tabsFrom.title = op.name;
 				this.meterId = op.id;
 				this.titleName = op.name;
+				this.companyId = op.companyId;
 			}
 			this.endYear = new Date().getFullYear();
 			this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
@@ -485,32 +488,57 @@
 			this.getElectricityStatistics();
 			this.getTimeSlotStatistics();
 			this.getCompanyInfoList();
+			this.getAbnormalAlarmRecord();
 		},
 		onReady() {
 			this.getBarCharts(false);
 		},
 		methods: {
-			titleCk(){
-				if(this.tabsFrom.selector1.length>1){
-					this.tabsFrom.show1=true
+			// 异常告警记录
+			getAbnormalAlarmRecord() {
+				var queryDate = parseUnixTime(new Date(), '{y}-{m}');
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.alarmRecord({
+					queryDate: queryDate,
+					configId: '',
+					pageIndex: 1,
+					pageSize: 2,
+					companyId: this.companyId
+				}).then((res) => {
+					uni.hideLoading();
+					this.abnormalRecordsList = res.data.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			titleCk() {
+				if (this.tabsFrom.selector1.length > 1) {
+					this.tabsFrom.show1 = true
 				}
 			},
 			selector1confirm(e) {
 				console.log(e)
 				// var index = e[2];
 				// this.tabsFrom.show1Index = index;
-				if(e[2].value != null) {
+				if (e[2].value != null) {
 					this.tabsFrom.show1Text = e[2].label;
 					this.tabsFrom.title = e[2].label;
-					
+
 					this.FormData.meterId = e[2].value;
 					this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
 					this.FormData2.meterId = e[2].value;
 					this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
-					
+
 					this.FormData.type = 2;
 					this.value = '2';
-					
+
 					this.getTimeSlotStatistics();
 					this.getElectricityStatistics();
 				}
@@ -518,15 +546,15 @@
 			selector1cancel() {
 				this.tabsFrom.show1Text = this.titleName;
 				this.tabsFrom.title = this.titleName;
-				
+
 				this.FormData.meterId = this.meterId;
 				this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
 				this.FormData2.meterId = this.meterId;
 				this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
-				
+
 				this.FormData.type = 2;
 				this.value = '2';
-				
+
 				this.getTimeSlotStatistics();
 				this.getElectricityStatistics();
 			},
@@ -558,7 +586,7 @@
 					var list = response.data.companyInfoList;
 					this.tabsFrom.selector1 = [];
 					this.tabsFrom.selector1 = list.map(item => {
-						if(item.remoteReadingMeterList.length!=0 && item.remoteMonitorMeterList.length!=0) {
+						if (item.remoteReadingMeterList.length != 0 && item.remoteMonitorMeterList.length != 0) {
 							return {
 								label: item.fullName,
 								value: item.id,
@@ -584,40 +612,38 @@
 									}
 								]
 							}
-						} else if (item.remoteReadingMeterList.length!=0 && item.remoteMonitorMeterList.length==0) {
+						} else if (item.remoteReadingMeterList.length != 0 && item.remoteMonitorMeterList.length == 0) {
 							return {
 								label: item.fullName,
 								value: item.id,
 								children: [{
-										label: '抄表',
-										value: '1',
-										children: item.remoteReadingMeterList.map(item => {
-											return {
-												label: item.name,
-												value: item.id,
-											}
-										})
-									}
-								]
+									label: '抄表',
+									value: '1',
+									children: item.remoteReadingMeterList.map(item => {
+										return {
+											label: item.name,
+											value: item.id,
+										}
+									})
+								}]
 							}
-						} else if (item.remoteReadingMeterList.length==0 && item.remoteMonitorMeterList.length!=0) {
+						} else if (item.remoteReadingMeterList.length == 0 && item.remoteMonitorMeterList.length != 0) {
 							return {
 								label: item.fullName,
 								value: item.id,
 								children: [{
-										label: '监控表',
-										value: '1',
-										children: item.remoteMonitorMeterList.map(item => {
-											return {
-												label: item.name,
-												value: item.id,
-											}
-										})
-									}
-								]
+									label: '监控表',
+									value: '1',
+									children: item.remoteMonitorMeterList.map(item => {
+										return {
+											label: item.name,
+											value: item.id,
+										}
+									})
+								}]
 							}
 						} else {
-							
+
 						}
 					})
 				}).catch(error => {
@@ -767,15 +793,15 @@
 				console.log(e)
 				this.tabsFrom.show2Text = '全部时间'
 				this.tabsFrom.show2Index = '';
-				
-				if(e.day) {
+
+				if (e.day) {
 					this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
 					this.queryDay = parseUnixTime(new Date(this.FormData2.queryDate), '{y}年{m}月{d}日');
 					this.getTimeSlotStatistics();
 				} else {
 					this.FormData.type = this.clickType;
 					this.value = this.clickType;
-					if(this.value != 10) {
+					if (this.value != 10) {
 						this.list[5].name = '指定月份';
 					}
 					this.getElectricityStatistics();
@@ -815,7 +841,7 @@
 		font-size: 36rpx;
 		font-weight: bold;
 	}
-	
+
 	.navbar-c {
 		background-color: rgba(22, 119, 255, 1);
 		position: fixed;

+ 1 - 0
pages/equipmentDataMonitoring/equipmentElectricity.vue

@@ -251,6 +251,7 @@
 			toElectronicMonitoring(item) {
 				uni.navigateTo({
 					url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
+						+ '&companyId=' + item.companyId
 				})
 			}
 		}

+ 1 - 0
pages/statistics/statistics.vue

@@ -857,6 +857,7 @@
 			toElectronicMonitoring(item) {
 				uni.navigateTo({
 					url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
+						+ '&companyId=' + item.companyId
 				})
 			}
 		}