zhengkaixin 1 år sedan
förälder
incheckning
de50404de5
2 ändrade filer med 68 tillägg och 40 borttagningar
  1. 23 16
      pages/equipmentDataMonitoring/equipmentElectricity.vue
  2. 45 24
      pages/statistics/statistics.vue

+ 23 - 16
pages/equipmentDataMonitoring/equipmentElectricity.vue

@@ -103,7 +103,7 @@
 		
 		<!-- 子项标签 -->
 		<view class="content" style="display: flex;justify-content: center;margin-top: 40px;"
-		v-if="!getHomePageManageReady&&current!=0">
+		v-if="!getHomePageManageshowLoading&&current!=0">
 			
 			<div class="uni-toast" style="display: flex;font-size: 60rpx;    color: rgb(192, 196, 204);" >
 				<i class="uni-icon_toast uni-loading"
@@ -115,11 +115,11 @@
 			></i><p class="uni-toast__content">  </p>加载中...</div>
 			
 		</view>
-		<view class="content" v-else-if="getHomePageManageReady&&meterList.length == 0&&current!=0">
+		<view class="content" v-else-if="getHomePageManageshowLoading&&meterList.length == 0&&current!=0">
 			<u-divider :isnone="true"  nonetext="无记录"
 				border-color="#fff"></u-divider>
 		</view>
-		<view class="statistics-manage" v-show="current!=0&&getHomePageManageReady" >
+		<view class="statistics-manage" v-show="current!=0&&getHomePageManageshowLoading" >
 			
 
 			<!-- 图表 -->
@@ -127,7 +127,7 @@
 				<view class="u-subsection">
 					<u-subsection :list="list"  :current="homePageManageType" @change="sectionChange" font-size="24"></u-subsection>
 				</view>
-				<view class="incomeExpenditureClass" >
+				<view class="incomeExpenditureClass" v-show="!companyType" >
 					<view class="income1">
 						<view  class="income11">
 							电费支出
@@ -328,6 +328,7 @@
 			return {
 				codes:"",
 				getHomePageManageReady:false,
+				getHomePageManageshowLoading:false,
 				companyList: [], // 商户
 				merchantList1: [],
 				merchantList2: [],
@@ -626,8 +627,10 @@
 			// 设备数据监测
 			getHomePageManage(bl) {
 				
+				this.getHomePageManageReady=false
 				if(bl){
-					this.getHomePageManageReady=false
+					this.getHomePageManageshowLoading=false
+					
 				}else{
 					uni.showLoading({
 						title: "加载中",
@@ -647,14 +650,16 @@
 				}).then((response) => {
 					//uni.hideLoading();
 					
+					this.getHomePageManageReady=true
 					if(bl){
-						this.getHomePageManageReady=true
+						
+						this.getHomePageManageshowLoading=true
 					}else{
 						uni.hideLoading();
 					}
 					
 					 this.utabsone=true;
-					//this.getHomePageManageReady=true
+					
 					
 					this.codes =this.carhelp.getPersonInfo().codes;
 					
@@ -785,8 +790,9 @@
 						radius:[20, '70%']
 					},
 					angleAxis: {
-						max: parseInt(thismax+thismax/10)+3 ,
-						startAngle: 75
+						
+						startAngle: 75,
+						 rotate: 45,
 					},
 					 
 					 legend: {
@@ -804,11 +810,11 @@
 					tooltip: {},
 					series: [
 						{
-							name:'园区电量',
+							name:'电量',
 							type: 'bar',
 							data: [
-								this.homePageManageObj.parkKwh,
-							
+								
+								this.homePageManageObj.differenceKwh
 							],
 							coordinateSystem: 'polar',
 							label: {
@@ -832,12 +838,13 @@
 								formatter: '{c}度'
 							}
 						},
+						
 						{
-							name:'电量',
+							name:'园区电量',
 							type: 'bar',
 							data: [
-								
-								this.homePageManageObj.differenceKwh
+								this.homePageManageObj.parkKwh,
+							
 							],
 							coordinateSystem: 'polar',
 							label: {
@@ -845,7 +852,7 @@
 								position: 'middle',
 								formatter: '{c}度'
 							}
-						}
+						},
 					]
 				};
 				console.log(option)

+ 45 - 24
pages/statistics/statistics.vue

@@ -9,12 +9,21 @@
 		<view class="navbar">
 			<view class="title">
 				能源管理
-				<span style="padding-left: 4px;" v-if="companyList.length==1">
-					-
-				</span>
-				<span style="padding-left: 4px;" v-if="companyList.length==1">
-					{{companyList[0].name}}
-				</span>
+				<template v-if="companyList.length==1">
+					<span style="padding-left: 4px;">-</span>
+					<span style="padding-left: 4px;">{{companyList[0].name}}</span>
+				</template>
+				<template v-else >
+					
+					<span style="padding-left: 4px;" v-if="companyList.length>=1&&current!=0">
+						-
+					</span>
+					<span style="padding-left: 4px;" v-if="companyList.length>=1&&current!=0">	
+						
+						{{merchantList1[current].name}}
+					</span>
+				</template>
+				
 				
 			</view>
 
@@ -109,7 +118,9 @@
 					</view>
 				</view>
 				
-				<view class="content" v-if="!getHomePageManageReady">
+				<view class="content" 
+				 style="display: flex;justify-content: center;margin: 40px 0;"
+				v-if="!getHomePageManageshowLoading">
 					
 					<div class="uni-toast" style="display: flex;font-size: 60rpx;    color: rgb(192, 196, 204);" >
 						<i class="uni-icon_toast uni-loading"
@@ -121,18 +132,18 @@
 					></i><p class="uni-toast__content">  </p>加载中...</div>
 					
 				</view>
-				<view class="content" v-else-if="getHomePageManageReady&&meterList.length == 0">
+				<view class="content" v-else-if="getHomePageManageshowLoading&&meterList.length == 0">
 					<u-divider :isnone="true"  nonetext="无记录"
 						border-color="#fff"></u-divider>
 				</view>
 				
 				<!-- 图表 -->
-				<view class="chart" v-show="getHomePageManageReady">
+				<view class="chart" v-show="getHomePageManageshowLoading">
 					<view class="u-subsection">
 						<u-subsection :list="list" :current="homePageManageType" @change="sectionChange"
 							font-size="24"></u-subsection>
 					</view>
-					<view class="incomeExpenditureClass" >
+					<view class="incomeExpenditureClass" v-show="!companyType" >
 						<view class="income1">
 							<view  class="income11">
 								电费支出
@@ -204,7 +215,8 @@
 						查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
 					</view>
 				</view>
-				<view class="content" v-if="getHomePageKwhshowLoading">
+				<view class="content"  style="display: flex;justify-content: center;margin: 40px 0;"
+				v-if="getHomePageKwhshowLoading">
 					
 					<div class="uni-toast" style="display: flex;font-size: 60rpx;    color: rgb(192, 196, 204);" >
 						<i class="uni-icon_toast uni-loading"
@@ -504,6 +516,7 @@
 					
 				},
 				getHomePageManageReady:false,
+				
 				utabsone:true,
 				companyType:false,
 				incomeExpenditureObj:{},
@@ -809,9 +822,10 @@
 			},
 			// 设备数据监测
 			getHomePageManage(bl) {
-				
+				this.getHomePageManageReady=false
 				if(bl){
-					this.getHomePageManageReady=false
+					this.getHomePageManageshowLoading=false
+					
 				}else{
 					uni.showLoading({
 						title: "加载中",
@@ -825,9 +839,10 @@
 					companyId: this.companyId,
 					type: this.list[this.homePageManageType].value
 				}).then((response) => {
-					
+					this.getHomePageManageReady=true
 					if(bl){
-						this.getHomePageManageReady=true
+						
+						this.getHomePageManageshowLoading=true
 					}else{
 						uni.hideLoading();
 					}
@@ -952,8 +967,12 @@
 						radius:[20, '70%']
 					},
 					angleAxis: {
-						max: parseInt(thismax+thismax/10)+3 ,
-						startAngle: 75
+						
+						startAngle: 75,
+						 label: {
+						             rotate: 45, // 旋转标签,使得重叠的概率降低
+						         //    margin: 5    // 设置标签与轴线之间的距离,增加空间
+						         }
 					},
 					 
 					 legend: {
@@ -970,12 +989,14 @@
 					},
 					tooltip: {},
 					series: [
+						
+						
 						{
-							name:'园区电量',
+							name:'电量',
 							type: 'bar',
 							data: [
-								this.homePageManageObj.parkKwh,
-							
+								
+								this.homePageManageObj.differenceKwh
 							],
 							coordinateSystem: 'polar',
 							label: {
@@ -1000,11 +1021,11 @@
 							}
 						},
 						{
-							name:'电量',
+							name:'园区电量',
 							type: 'bar',
 							data: [
-								
-								this.homePageManageObj.differenceKwh
+								this.homePageManageObj.parkKwh,
+							
 							],
 							coordinateSystem: 'polar',
 							label: {
@@ -1012,7 +1033,7 @@
 								position: 'middle',
 								formatter: '{c}度'
 							}
-						}
+						},
 					]
 				};
 				console.log(option)