wkyy 1 year ago
parent
commit
c000aca139

+ 44 - 5
apis/pagejs/energy/index.js

@@ -1,5 +1,44 @@
 import request from '@/apis/utils/request'
- 
+
+// 异常报警记录-详细
+export function alarmRecordDetails(id) {
+	var url='/mobile/employee/alarmRecordDetails';
+	return request({
+		method: 'post',
+		data: {id: id},
+		url: url
+	})
+}
+
+// 异常报警记录-异常查询条件
+export function alarmConfiguration() {
+	var url='/mobile/employee/alarmConfiguration';
+	return request({
+		method: 'post',
+		url: url
+	})
+}
+
+// 主页-异常告警记录
+export function alarmRecord(data) {
+	var url='/mobile/employee/alarmRecord';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+// 主页-设备状态
+export function homePageDeviceStatus(data) {
+	var url='/mobile/employee/homePageDeviceStatus';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
 export function homePage(data) {
 	var url='/mobile/tenant/homePage';
 	return request({
@@ -18,7 +57,7 @@ export function findByOpenId(data) {
 	})
 }
 
-// 统计-用电量(设备远程抄表)
+// 主页-用电量(设备远程抄表)
 export function homePageKwh(data) {
 	var url='/mobile/employee/homePageKwh';
 	return request({
@@ -28,7 +67,7 @@ export function homePageKwh(data) {
 	})
 }
 
-// 统计-设备数据检测(设备巡检)
+// 主页-设备数据检测(设备巡检)
 export function homePageDeviceData(data) {
 	var url='/mobile/employee/homePageDeviceData';
 	return request({
@@ -38,7 +77,7 @@ export function homePageDeviceData(data) {
 	})
 }
 
-// 统计-拥有的设备的单位
+// 主页-拥有的设备的单位
 export function deviceCompanyList() {
 	var url='/mobile/employee/deviceCompanyList';
 	return request({
@@ -47,7 +86,7 @@ export function deviceCompanyList() {
 	})
 }
 
-// 统计-累计报警
+// 主页-累计报警
 export function deviceStatus(data) {
 	var url='/mobile/employee/deviceStatus';
 	return request({

+ 44 - 11
pages/abnormal/abnormalAlarmDetails.vue

@@ -4,10 +4,11 @@
 		<view class="main">
 			<view class="item">
 				<view class="title">
-					报警单号:A100001
+					<!-- 报警单号:A100001 -->
+					报警类型
 				</view>
 				<view class="value">
-					<text class="reason">温度异常</text>
+					<text class="reason">{{alarmConfig.name}}</text>
 				</view>
 			</view>
 			<view class="item">
@@ -15,7 +16,7 @@
 					报警设备
 				</view>
 				<view class="value equipment">
-					荆鹏集团-荆鹏软件园01
+					{{companyInfo.name}}-{{remoteMonitorMeter.name}}
 				</view>
 			</view>
 			<view class="item">
@@ -23,7 +24,7 @@
 					报警内容
 				</view>
 				<view class="value warning">
-					温度过高 120°C
+					{{alarmRecord.content}}
 				</view>
 			</view>
 			<view class="item">
@@ -31,19 +32,19 @@
 					地址
 				</view>
 				<view class="value ">
-					沙市区江津东路附155号
+					{{remoteMonitorMeter.installationAddress}}
 				</view>
 			</view>
 			<view class="item">
 				<view class="title">
-					报警内容
+					报警时间
 				</view>
 				<view class="value">
-					2024-02-04 20:00:00
+					{{alarmRecord.createTime}}
 				</view>
 			</view>
 			<!-- 异常记录 -->
-			<view class="record-chat">
+			<view class="record-chat" v-if="false">
 				<view class="title">
 					异常记录
 				</view>
@@ -61,7 +62,7 @@
 			</view>
 		</view>
 		<!-- 底部 -->
-		<view class="bottom">
+		<view class="bottom" v-if="false">
 			<button class="close" @click="closeShow=true">关闭警报</button>
 			<button class="create" @click="gotoUrl('/pages/workOrderManagement/faultReport')">创建工单</button>
 		</view>
@@ -97,20 +98,52 @@
 
 <script>
 	import * as echarts from 'echarts';
+	import * as API from '@/apis/pagejs/energy/index.js'
 	
 	export default {
 		data() {
 			return {
+				companyInfo: {}, //企业
+				remoteMonitorRecord: {}, //设备详细
+				remoteMonitorMeter: {}, //设备
+				alarmRecord: {}, //异常详细
+				alarmConfig: {}, //异常详细
+				id: '', //异常id
 				closeShow: false,
 				reasonList: ['错误告警','设备已自动恢复','不需要上门解决','平台移桩,可忽视','其他'],
 				current: 0,
 				myLineChart: null
 			}
 		},
+		onLoad(op) {
+			if(op.id) {
+				this.id = op.id;
+				this.getAlarmRecordDetails(this.id);
+			}
+		},
 		onReady() {
-			this.getLineCharts();
+			// this.getLineCharts();
 		},
 		methods: {
+			getAlarmRecordDetails(id) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.alarmRecordDetails(id).then((response) => {
+					uni.hideLoading();
+					this.companyInfo = response.data.companyInfo;
+					this.remoteMonitorRecord = response.data.remoteMonitorRecord;
+					this.remoteMonitorMeter = response.data.remoteMonitorMeter;
+					this.alarmRecord = response.data.alarmRecord;
+					this.alarmConfig = response.data.alarmConfig;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			getLineCharts() {
 				if (!this.myLineChart) {
 					this.myLineChart = echarts.init(document.getElementById('lineEcharts'), null, {
@@ -205,7 +238,7 @@
 
 				.reason {
 					display: inline-block;
-					width: 128rpx;
+					width: 160rpx;
 					line-height: 48rpx;
 					border-radius: 4px;
 					color: rgba(255, 61, 0, 1);

+ 141 - 61
pages/abnormal/abnormalAlarmRecord.vue

@@ -2,14 +2,14 @@
 	<view>
 		<u-navbar title="异常报警记录" title-color="#101010"></u-navbar>
 		<view class="dropdown">
-			<view class="dropdown-item">
-				2024年2月 <u-icon name="arrow-down" color="#999999"></u-icon>
+			<view class="dropdown-item" @click="show1=true">
+				{{time}} <u-icon name="arrow-down" color="#999999"></u-icon>
 			</view>
-			<view class="dropdown-item">
-				全部状态 <u-icon name="arrow-down" color="#999999"></u-icon>
+			<view class="dropdown-item" @click="show2=true">
+				{{state}} <u-icon name="arrow-down" color="#999999"></u-icon>
 			</view>
-			<view class="dropdown-item">
-				全部设备 <u-icon name="arrow-down" color="#999999"></u-icon>
+			<view class="dropdown-item" @click="show3=true">
+				{{device}} <u-icon name="arrow-down" color="#999999"></u-icon>
 			</view>
 			<!-- <u-dropdown-change ref="uDropdown">
 				<u-dropdown-item v-model="value1" title="全部时间" :options="options1"></u-dropdown-item>
@@ -19,79 +19,38 @@
 		</view>
 
 		<u-picker mode="time" :defaultTime="defaultTime" v-model="show1" :params="params" @confirm="timeChange"></u-picker>
+		
+		<u-select v-model="show2" mode="single-column" :list="stateList" @confirm="stateChange"></u-select>
+		
+		<u-select v-model="show3" mode="single-column" :list="deviceList" @confirm="deviceChange"></u-select>
 
 		<view class="records">
 			<view class="records-item" v-for="(item, index) in abnormalRecordsList" :key="index"
-				@click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id=')">
+				@click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id='+item.id)">
 				<view class="icon icon1">
 					<image class="img" src="@/assets/img/riFill-temp-cold-fill.svg" mode=""></image>
 				</view>
-				<view class="title">
-					<view class="name">
-						温度异常
-					</view>
-					<view class="date">
-						2024-02-14 09:00:01
-					</view>
-				</view>
-
-				<view class="equipment">
-					<view class="equipment1">
-						荆鹏软件园01
-					</view>
-					<view class="equipment2">
-						荆鹏集团
-					</view>
-				</view>
-				<view class="more">
-					<u-icon name="arrow-right" color="#acacac"></u-icon>
-				</view>
-			</view>
-
-			<view class="records-item">
-				<view class="icon icon2">
+				<!-- <view class="icon icon2">
 					<image class="img" src="@/assets/img/riFill-cloud-off-fill.svg" mode=""></image>
 				</view>
-				<view class="title">
-					<view class="name">
-						温度异常
-					</view>
-					<view class="date">
-						2024-02-14 09:00:01
-					</view>
-				</view>
-
-				<view class="equipment">
-					<view class="equipment1">
-						荆鹏软件园01
-					</view>
-					<view class="equipment2">
-						荆鹏集团
-					</view>
-				</view>
-				<view class="more">
-					<u-icon name="arrow-right" color="#acacac"></u-icon>
-				</view>
-			</view>
-			<view class="records-item">
 				<view class="icon icon3">
 					<image class="img" src="@/assets/img/outputVoltage.svg" mode=""></image>
-				</view>
+				</view> -->
 				<view class="title">
 					<view class="name">
-						电压异常
+						{{item.configName}}
 					</view>
 					<view class="date">
-						2024-02-14 09:00:01
+						{{item.createTime}}
 					</view>
 				</view>
 
 				<view class="equipment">
 					<view class="equipment1">
-						荆鹏软件园01
+						{{item.meterName}}
 					</view>
 					<view class="equipment2">
-						荆鹏集团
+						{{item.companyName}}
 					</view>
 				</view>
 				<view class="more">
@@ -99,13 +58,28 @@
 				</view>
 			</view>
 		</view>
+		
+		<u-divider :isnone="abnormalRecordsList.length==0" nonetext="暂无异常报警记录" border-color="#CFD2D5">
+			已经到底了</u-divider>
 	</view>
 </template>
 
 <script>
+	import {
+		parseUnixTime,
+		beforeTimeStamp,
+		getWeek
+	} from '@/apis/utils'
+	import * as API from '@/apis/pagejs/energy/index.js'
+	
 	export default {
 		data() {
 			return {
+				abnormalRecordsList: [], // 异常告警记录
+				configId: '',
+				pageIndex: 1,
+				recordsTotal: 0,
+				companyId: '',
 				show1: false, // 时间选择
 				defaultTime: '',
 				params: {
@@ -117,7 +91,13 @@
 					second: false,
 					timestamp: false
 				},
-				abnormalRecordsList: [], // 异常告警记录
+				time: '全部时间',
+				show2: false, // 状态选择
+				state: '全部状态',
+				stateList: [],
+				show3: false, // 设备选择
+				device: '全部设备',
+				deviceList: [],
 				value1: 1,
 				value2: 1,
 				value3: 1,
@@ -166,18 +146,118 @@
 				],
 			}
 		},
+		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;
+			this.time = year + '年' + parseInt(month) + '月';
+			
+			this.getAbnormalAlarmRecord();
+			this.getAlarmConfiguration();
+		},
+		onReady() {
+			
+		},
+		onReachBottom() {
+			if (this.abnormalRecordsList.length < this.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
 		methods: {
+			// 异常告警记录
+			getAbnormalAlarmRecord(bl) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.abnormalRecordsList = [];
+					this.pageIndex = 1;
+				}
+				API.alarmRecord({
+					configId: this.configId,
+					pageIndex: this.pageIndex,
+					pageSize: 10,
+					companyId: this.companyId
+				}).then((res) => {
+					uni.hideLoading();
+					this.abnormalRecordsList = [
+						...this.abnormalRecordsList,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			myLoadmore() {
+				this.pageIndex += 1;
+				this.getAbnormalAlarmRecord();
+			},
+			// 异常查询条件
+			getAlarmConfiguration() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.alarmConfiguration().then((response) => {
+					uni.hideLoading();
+					var list1 = response.data.alarmConfigList.map(item => {
+						return {
+							label: item.name,
+							value: item.id
+						}
+					});
+					list1.unshift({
+						value: '',
+						label: '全部状态'
+					});
+					var list2 = response.data.companyInfoList.map(item => {
+						return {
+							label: item.name,
+							value: item.id
+						}
+					});
+					list2.unshift({
+						value: '',
+						label: '全部设备'
+					});
+					
+					this.stateList = list1;
+					this.deviceList = list2;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			// 时间查询
 			timeChange(params) {
 				console.log(params)
+				this.time = params.year + '年' + parseInt(params.month) + '月';
+				
+				this.getAbnormalAlarmRecord(true);
 			},
 			// 状态查询
-			stateChange() {
+			stateChange(e) {
+				console.log(e);
+				this.configId = e[0].value;
+				this.state = e[0].label;
 				
+				this.getAbnormalAlarmRecord(true);
 			},
 			// 设备查询
-			deviceChange() {
+			deviceChange(e) {
+				console.log(e);
+				this.companyId = e[0].value;
+				this.device = e[0].label;
 				
+				this.getAbnormalAlarmRecord(true);
 			}
 		}
 	}

+ 8 - 8
pages/equipmentDataMonitoring/dataMonitoring-list.vue

@@ -18,12 +18,12 @@
 				<image class="img" src="@/assets/img/riLine-road-map-line.svg" mode=""></image>地图
 			</view>
 		</view>
-		<view class="dropdown">
+		<!-- <view class="dropdown">
 			<u-dropdown-change>
 				<u-dropdown-item v-model="value1" title="全部设备" :options="options1"></u-dropdown-item>
 				<u-dropdown-item v-model="value2" title="全部状态" :options="options2"></u-dropdown-item>
 			</u-dropdown-change>
-		</view>
+		</view> -->
 
 		<view class="main">
 			<view class="item" v-for="(item,index) in deviceList" :key="index" @click="toElectronicMonitoring(item)">
@@ -104,7 +104,7 @@
 							当前功率:
 						</view>
 						<view class="item-value">
-							{{(item.remoteMonitorRecord.totalPower).toFixed(2)}}kW
+							{{item.remoteMonitorRecord.totalPower.toFixed(2)}}kW
 						</view>
 					</view>
 					<view class="infos-item">
@@ -112,7 +112,7 @@
 							当前功率因数:
 						</view>
 						<view class="item-value">
-							{{item.remoteMonitorRecord.averPowerFactor}}
+							{{item.remoteMonitorRecord.averPowerFactor.toFixed(2)}}
 						</view>
 					</view>
 					<view class="infos-item">
@@ -126,8 +126,8 @@
 				</view>
 			</view>
 			
-			<u-divider :isnone="deviceList.length==0" v-if="deviceList.length==recordsTotal"  nonetext="没有找到相关内容"
-				border-color="#CFD2D5">已经到底了</u-divider>
+			<u-divider :isnone="deviceList.length==0" nonetext="暂无设备数据" border-color="#CFD2D5">
+				已经到底了</u-divider>
 		</view>
 	</view>
 </template>
@@ -227,9 +227,9 @@
 					url: '/pages/equipmentDataMonitoring/dataMonitoring-map'
 				})
 			},
-			toElectronicMonitoring() {
+			toElectronicMonitoring(item) {
 				uni.navigateTo({
-					url: '/pages/equipmentDataMonitoring/electronicMonitoring'
+					url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
 				})
 			}
 		}

+ 25 - 4
pages/equipmentDataMonitoring/electronicMonitoring.vue

@@ -14,16 +14,17 @@
 
 			<!-- 日期选择器 -->
 			<u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
-				mode="time" :params="params" @confirm="selector2confirm" @reset="selector2reset"></u-picker-select>
+				mode="time" :params="params" :noselect="false" @confirm="selector2confirm" @reset="selector2reset">
+			</u-picker-select>
 
 			<view class="navbar-c">
 				<view class="back" @click="backDataMonitoringList">
 					<u-icon name="arrow-left" color="#fff" size="36"></u-icon>
 				</view>
-				<view class="title">
+				<view class="title" @click="titleCk">
 					{{tabsFrom.title}}
 					<!-- <u-icon name="arrow-down" color="#fff" size="24" @click="equipmentShow=true"></u-icon> -->
-					<u-icon name="arrow-down" color="#fff" size="24" @click="tabsFrom.show1=true"></u-icon>
+					<u-icon name="arrow-down" color="#fff" size="24"></u-icon>
 				</view>
 			</view>
 		</view>
@@ -393,6 +394,7 @@
 	export default {
 		data() {
 			return {
+				clickType: 0,
 				sumQuantity: 0,
 				equipmentInfosShow: false,
 				kWhList: [],
@@ -530,6 +532,11 @@
 			this.getBarCharts(false);
 		},
 		methods: {
+			titleCk(){
+				if(this.kWhList.length>1){
+					this.tabsFrom.show1=true
+				}
+			},
 			selector1confirm(e) {
 
 				var index = e[0];
@@ -733,10 +740,24 @@
 				console.log(e)
 				this.tabsFrom.show2Text = '全部时间'
 				this.tabsFrom.show2Index = '';
+				
+				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) {
+						this.list[5].name = '指定月份';
+					}
+					this.getElectricityStatistics();
+				}
 			},
 			// 选中某个单选框时,由radio时触发
 			radioChange(e) {
-				//console.log(e);
+				console.log(`选择前的值: ${this.value}`);
+				this.clickType = this.value;
 			},
 			// 选中任一radio时,由radio-group触发
 			radioGroupChange(e) {

+ 3 - 4
pages/mine/contactService.vue

@@ -1,8 +1,7 @@
 <template>
 	<view>
 		<u-navbar title="联系客服" title-color="#101010"></u-navbar>
-		<u-divider :isnone="queryList.length==0"   nonetext="没有找到相关内容"
-			border-color="#CFD2D5">已经到底了</u-divider>
+		<u-divider :isnone="queryList.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
 		<view class="background" v-if="false">
 			<view class="common-problem">
 				<view class="headline">
@@ -22,11 +21,11 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<u-modal v-model="openModalBl" @confirm="confirmPhone" confirm-text="拨打电话" confirm-color="#606266"
 			:show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" :content="content"
 			:content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
-		
+
 		<!-- 底部 -->
 		<view class="bottom">
 			<button class="service" @click="openModalBl=true">

+ 124 - 57
pages/statistics/statistics.vue

@@ -5,7 +5,7 @@
 			<view class="title">
 				能源中心
 			</view>
-			<view class="icon" @click="toDataMonitoringList" v-if="false">
+			<view class="icon" @click="toDataMonitoringList">
 				<image class="img" src="@/assets/img/riLine-equalizer-line.svg" mode=""></image>
 			</view>
 		</view>
@@ -170,18 +170,18 @@
 					<view class="item-title">
 						<!-- <image class="img" src="@/assets/img/riFill-error-warning-fill 1.svg"></image> -->
 						<view class="name">
-							温度异常
+							{{item.configName}}
 						</view>
 						<view class="date">
-							2024-02-14 09:00:01
+							{{item.createTime}}
 						</view>
 					</view>
 					<view class="item-value">
 						<view class="value1">
-							荆鹏软件园01
+							{{item.meterName}}
 						</view>
 						<view class="value2">
-							荆鹏集团
+							{{item.companyName}}
 						</view>
 					</view>
 				</view>
@@ -277,7 +277,7 @@
 			</view>
 
 			<!--设备状态-->
-			<view class="statistics-4 statistics" v-if="false">
+			<view class="statistics-4 statistics">
 				<view class="title">
 					<view class="icon">
 						<image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
@@ -411,17 +411,18 @@
 			}
 		},
 		onLoad() {
-			this.getfindByOpenId();
 			this.getPowerConsumption(0);
 			this.getEquipmentDataMonitoring(0);
 			this.getCompanyInfoList();
 			this.getAccumulatedAlarms();
+			this.getAbnormalAlarmRecord();
+		},
+		onReady() {
+			this.getfindByOpenId();
+			this.getHomePageDeviceStatus();
+			// this.getBarCharts();
+			// this.getLineCharts();
 		},
-		// onReady() {
-		// 	this.getPieCharts();
-		// 	this.getBarCharts();
-		// 	this.getLineCharts();
-		// },
 		methods: {
 			merchantChange(item, index) {
 				var m = item;
@@ -433,6 +434,8 @@
 				this.getPowerConsumption(0);
 				this.getEquipmentDataMonitoring(0);
 				this.getAccumulatedAlarms();
+				this.getHomePageDeviceStatus();
+				this.getAbnormalAlarmRecord();
 
 				this.popShow = false;
 			},
@@ -448,6 +451,9 @@
 				API.deviceCompanyList().then((response) => {
 					uni.hideLoading();
 					this.companyList = response.data.companyInfoList;
+					for (var i = 0; i < this.companyList.length; i++) {
+						this.companyList[i].name = this.companyList[i].fullName;
+					}
 					if (this.companyList.length > 3) {
 						this.merchantList1.push(this.companyList.slice(0, 3));
 						this.merchantList2.push(this.companyList.slice(3));
@@ -513,7 +519,24 @@
 			},
 			// 异常告警记录
 			getAbnormalAlarmRecord() {
-
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.alarmRecord({
+					configId: '',
+					pageIndex: 1,
+					pageSize: 3,
+					companyId: this.companyId
+				}).then((response) => {
+					uni.hideLoading();
+					this.abnormalRecordsList = response.data.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
 			},
 			// 用电量
 			getPowerConsumption(pl) {
@@ -564,6 +587,7 @@
 					})
 				})
 			},
+			// 工单处理
 			getLineCharts() {
 				if (!this.myLineChart) {
 					this.myLineChart = echarts.init(document.getElementById('lineEcharts'));
@@ -620,6 +644,7 @@
 
 				this.myLineChart.setOption(option);
 			},
+			// 故障类型
 			getBarCharts() {
 				if (!this.myBarChart) {
 					this.myBarChart = echarts.init(document.getElementById('barEcharts'));
@@ -675,22 +700,98 @@
 
 				this.myBarChart.setOption(option);
 			},
-			getPieCharts() {
+			// 设备状态
+			getHomePageDeviceStatus() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.homePageDeviceStatus({
+					companyId: this.companyId
+				}).then((response) => {
+					uni.hideLoading();
+					var list = response.data;
+					this.getPieCharts(list);
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getPieCharts(list) {
 				if (!this.myPieChart) {
-					this.myPieChart = echarts.init(document.getElementById('pieEcharts'));
+					this.myPieChart = echarts.init(document.getElementById('pieEcharts'), null, {
+						width: uni.upx2px(700),
+						height: uni.upx2px(620)
+					});
 				}
+				this.myPieChart.clear();
 
+				var data = [{
+						value: 1,
+						name: '温度异常',
+						itemStyle: {
+							color: '#FF4F3F'
+						}
+					},
+					{
+						value: 1,
+						name: '烟感异常',
+						itemStyle: {
+							color: '#FF7B00'
+						}
+					},
+					{
+						value: 1,
+						name: '正常运行',
+						itemStyle: {
+							color: '#1677FF'
+						}
+					},
+					{
+						value: 1,
+						name: '设备异常',
+						itemStyle: {
+							color: '#F2BD42'
+						}
+					},
+					{
+						value: 1,
+						name: '设备离线',
+						itemStyle: {
+							color: '#C2C2C2'
+						}
+					},
+				];
+				var data2 = [];
+				if (list) {
+					data[0].value = list.errorTemperatureNum; //温度异常
+					data[1].value = list.errorSmokeNum; //烟感异常
+					data[2].value = list.okNum; //正常运行
+					data[3].value = list.errorDeviceNum; //设备异常
+					data[4].value = list.errorOnlineNum; //设备离线
+					
+					for (var i = 0; i < data.length; i++) {
+						if(data[i].value != 0) {
+							data2.push(data[i]);
+						}
+					}
+				}
+				
 				var option = {
 					tooltip: {
-						trigger: 'item',
+						trigger: 'item'
 					},
 					legend: {
-						top: '0%',
 						left: 'center'
 					},
 					series: [{
 						type: 'pie',
-						top: '10%',
+						top: '6%',
+						left: '3%',
+						right: '8%',
+						bottom: '8%',
 						radius: ['45%', '60%'],
 						label: {
 							formatter: '{name|{b}}\n{value|{c}}',
@@ -715,42 +816,7 @@
 								}
 							}
 						},
-						data: [{
-								value: 2,
-								name: '温度异常',
-								itemStyle: {
-									color: '#FF4F3F'
-								}
-							},
-							{
-								value: 3,
-								name: '电压异常',
-								itemStyle: {
-									color: '#FF7B00'
-								}
-							},
-							{
-								value: 8,
-								name: '正常运行',
-								itemStyle: {
-									color: '#1677FF'
-								}
-							},
-							{
-								value: 1,
-								name: '功率因素异常',
-								itemStyle: {
-									color: '#F2BD42'
-								}
-							},
-							{
-								value: 1,
-								name: '设备离线',
-								itemStyle: {
-									color: '#C2C2C2'
-								}
-							}
-						]
+						data: data2
 					}]
 				};
 
@@ -762,9 +828,10 @@
 				this.getPowerConsumption(0);
 				this.getEquipmentDataMonitoring(0);
 				this.getAccumulatedAlarms();
+				this.getHomePageDeviceStatus();
+				this.getAbnormalAlarmRecord();
 			},
 			toDataMonitoringList() {
-				return
 				uni.navigateTo({
 					url: '/pages/equipmentDataMonitoring/dataMonitoring-list'
 				})
@@ -809,7 +876,7 @@
 		font-size: 32rpx;
          
 		.tabs {
-			width: 80%;
+			width: 88%;
 			
 		}
 	}
@@ -865,7 +932,7 @@
 		justify-content: space-between;
 
 		.tabs {
-			width: 80%;
+			width: 88%;
 		}
 
 	}