瀏覽代碼

用电监控

wkyy 1 年之前
父節點
當前提交
7005039230

+ 6 - 2
pages/abnormal/abnormalAlarmRecord.vue

@@ -76,6 +76,7 @@
 		data() {
 			return {
 				abnormalRecordsList: [], // 异常告警记录
+				queryDate: '',
 				configId: '',
 				pageIndex: 1,
 				recordsTotal: 0,
@@ -149,8 +150,9 @@
 		onLoad() {
 			var date = new Date();
 			var year = date.getFullYear();
-			var month = date.getMonth()+1 > 0 ? date.getMonth()+1 : '0'+(date.getMonth()+1);
-			this.defaultTime = year + '-' +month;
+			var month = date.getMonth()+1 >= 10 ? date.getMonth()+1 : '0'+(date.getMonth()+1);
+			this.defaultTime = year + '-' + month;
+			this.queryDate = year + '-' + month;
 			this.time = year + '年' + parseInt(month) + '月';
 			
 			this.getAbnormalAlarmRecord();
@@ -176,6 +178,7 @@
 					this.pageIndex = 1;
 				}
 				API.alarmRecord({
+					queryDate: this.queryDate,
 					configId: this.configId,
 					pageIndex: this.pageIndex,
 					pageSize: 10,
@@ -240,6 +243,7 @@
 			timeChange(params) {
 				console.log(params)
 				this.time = params.year + '年' + parseInt(params.month) + '月';
+				this.queryDate = params.year + '-' + params.month;
 				
 				this.getAbnormalAlarmRecord(true);
 			},

+ 108 - 27
pages/equipmentDataMonitoring/electronicMonitoring.vue

@@ -536,6 +536,52 @@
 					this.getElectricityStatistics();
 				}
 			},
+			getChildren(item) {
+				if(item.remoteReadingMeterList.length!=0 && item.remoteMonitorMeterList.length!=0) {
+					return [{
+						label: '抄表',
+						value: '1',
+						children: item.remoteReadingMeterList.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 if (item.remoteReadingMeterList.length!=0 && item.remoteMonitorMeterList.length==0) {
+					return [{
+						label: '抄表',
+						value: '1',
+						children: item.remoteReadingMeterList.map(item => {
+							return {
+								label: item.name,
+								value: item.id,
+							}
+						})
+					}]
+				} else {
+					return [{
+						label: '监控表',
+						value: '1',
+						children: item.remoteMonitorMeterList.map(item => {
+							return {
+								label: item.name,
+								value: item.id,
+							}
+						})
+					}]
+				}
+			},
 			getCompanyInfoList() {
 				uni.showLoading({
 					title: "加载中",
@@ -546,31 +592,66 @@
 					var list = response.data.companyInfoList;
 					this.tabsFrom.selector1 = [];
 					this.tabsFrom.selector1 = list.map(item => {
-						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.remoteMonitorMeterList.map(item => {
-										return {
-											label: item.name,
-											value: item.id,
-										}
-									})
-								}
-							]
+						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.remoteMonitorMeterList.map(item => {
+											return {
+												label: item.name,
+												value: item.id,
+											}
+										})
+									}
+								]
+							}
+						} 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,
+											}
+										})
+									}
+								]
+							}
+						} 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,
+											}
+										})
+									}
+								]
+							}
+						} else {
+							
 						}
 					})
 				}).catch(error => {
@@ -647,8 +728,8 @@
 				}
 				this.myChart.clear();
 
-				var data1 = ['0-2点', '3-4点', '5-6点', '7-8点', '9-10点', '11-12点', '13-14点', '15-16点',
-					'17-18点', '19-20点', '21-22点', '23-24点'
+				var data1 = ['0-2点', '2-4点', '4-6点', '6-8点', '8-10点', '10-12点', '12-14点', '14-16点',
+					'16-18点', '18-20点', '20-22点', '22-24点'
 				];
 				var data2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
 				var sumQuantity = 0;

+ 8 - 1
pages/statistics/statistics.vue

@@ -5,7 +5,7 @@
 			<view class="title">
 				能源中心
 			</view>
-			<view class="icon" @click="toDataMonitoringList">
+			<view class="icon" v-if="codes.indexOf('detector') != -1" @click="toDataMonitoringList">
 				<image class="img" src="@/assets/img/riLine-equalizer-line.svg" mode=""></image>
 			</view>
 		</view>
@@ -386,6 +386,7 @@
 		data() {
 			return {
 				abnormalRecordsList: [], // 异常告警记录
+				queryDate: '',
 				alarmsPercent: 0,
 				alarmsForm: {
 					okNum: 0,
@@ -411,6 +412,11 @@
 			}
 		},
 		onLoad() {
+			var date = new Date();
+			var year = date.getFullYear();
+			var month = date.getMonth()+1 >= 10 ? date.getMonth()+1 : '0'+(date.getMonth()+1);
+			this.queryDate = year + '-' + month;
+			
 			this.getPowerConsumption(0);
 			this.getEquipmentDataMonitoring(0);
 			this.getCompanyInfoList();
@@ -524,6 +530,7 @@
 					mask: true,
 				})
 				API.alarmRecord({
+					queryDate: this.queryDate,
 					configId: '',
 					pageIndex: 1,
 					pageSize: 3,