zhengkaixin 3 years ago
parent
commit
44a47b6116
4 changed files with 47 additions and 21 deletions
  1. 1 1
      package.json
  2. 1 1
      src/components/Common.vue
  3. 28 10
      src/projects/business/views/Other/Energy/Info.vue
  4. 17 9
      yarn.lock

+ 1 - 1
package.json

@@ -14,7 +14,7 @@
 		"axios": "^0.20.0",
 		"compression-webpack-plugin": "^6.0.2",
 		"core-js": "^3.6.4",
-		"echarts": "^4.9.0",
+		"echarts": "^5.3.2",
 		"hls.js": "^0.14.11",
 		"jquery": "^3.5.1",
 		"qrcodejs2": "^0.0.2",

+ 1 - 1
src/components/Common.vue

@@ -120,7 +120,7 @@
 				var openId=this.openId;
 			
 				if (process.env.VUE_APP_NODE_NAME == 'devlopment') {			
-					//openId=this.testOpenid;
+					openId="oHjCawigqi8SEAwutwkQ-VEgdp3k";
 				}
 				var type = type || '';
 				API_WeiXin.getDataByOpenId(openId).then(response => {

+ 28 - 10
src/projects/business/views/Other/Energy/Info.vue

@@ -140,7 +140,7 @@
 				 @click="ckDate(1)" ></i>
 			</div>
 			<dl class="returnChart returnChartBlue">
-				<dt><span>功率监测(kW)</span></dt>
+				<dt><span>功率监测(KW)</span></dt>
 				<dd>
 					<div id="kwPicture" style="width:100%;height: 300px;">
 					
@@ -149,7 +149,7 @@
 				</dd>
 			</dl>
 			<dl class="returnChart">
-				<dt><span>电监测(A)</span></dt>
+				<dt><span>电监测(A)</span></dt>
 				<dd>
 					<div id="aPicture" style="width:100%;height: 300px;">
 					
@@ -180,7 +180,7 @@
 		mapGetters,
 		mapMutations
 	} from 'vuex'
-	import echarts from 'echarts'
+	import * as echarts from 'echarts'
 	
 	import 'echarts/lib/chart/line'
 	import {
@@ -200,7 +200,7 @@
 				isLoading: false,
 				showTop:[0,0,0,0,0,0,0,0],
 				nowDate:"",
-				 
+				 timeList:[],
 				queryDate:"",
 				queryDate2:"",
 				selectType:"0",
@@ -219,7 +219,7 @@
 		created() {
 	
 			this.init()
-			//this.queryDate='2022-06-08'
+			
 			
  		},
 		methods: {
@@ -242,7 +242,7 @@
 				this.nowDate=parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
 				this.queryDate=parseUnixTime(beforeTimeStamp(0), '{y}-{m}-{d}');
 				this.queryDate2=parseUnixTime(beforeTimeStamp(0), '{y}-{m}-{d}');
-				
+				this.queryDate='2022-06-08'
 				this.showlist1=['总功率','A相功率','B相功率','C相功率'];
 			
 				this.showlist2=['A相电流','B相电流','C相电流'];
@@ -332,7 +332,11 @@
 				})
 			},
 			setMap(bl){
-				 
+				 this.timeList=[];
+				 for(var i in  this.energyCenterMapObj){
+					
+					 this.timeList.push(i)
+				 }
 				var list1=[];
 				var list2=[];
 				var list3=[];
@@ -363,7 +367,9 @@
 					var ap={
 						 name: sz1[j],
 						 type: 'line',
-						 stack: 'Total',
+						  symbol: 'none',
+						       sampling: 'lttb',
+						// stack: 'Total',
 						 data:[]
 					}
 					list.push(ap)
@@ -447,14 +453,14 @@
 							  grid: {
 								left: '3%',
 								right: '4%',
-								bottom: '3%',
+								bottom: '15%',
 								containLabel: true
 							  },
 							 
 							  xAxis: {
 								type: 'category',
 								boundaryGap: false,
-								data: ['01', '02', '03', '04', '05', '06', '07','08', '09', '10', '11', '12', '13', '14','15', '16', '17', '18', '19', '20', '21', '22', '23','24'],
+								data: this.timeList,
 								axisLabel:{
 								    textStyle:{
 								      color:colorName
@@ -469,6 +475,7 @@
 							  },
 							  yAxis: {
 								type: 'value',
+								
 								  axisLabel:{
 								      textStyle:{
 								        color:colorName
@@ -480,6 +487,17 @@
 								      }
 								    },
 							  },
+							    dataZoom: [
+							      {
+							        type: 'inside',
+							        start: 0,
+							        end: 100
+							      },
+							      {
+							        start: 0,
+							        end: 100
+							      }
+							    ],
 							  series: seriesdata
 							};
 					myChart.setOption(option);

+ 17 - 9
yarn.lock

@@ -3313,12 +3313,13 @@ ecc-jsbn@~0.1.1:
     jsbn "~0.1.0"
     safer-buffer "^2.1.0"
 
-echarts@^4.9.0:
-  version "4.9.0"
-  resolved "https://registry.npm.taobao.org/echarts/download/echarts-4.9.0.tgz#a9b9baa03f03a2a731e6340c55befb57a9e1347d"
-  integrity sha1-qbm6oD8Doqcx5jQMVb77V6nhNH0=
+echarts@^5.2.2:
+  version "5.3.2"
+  resolved "https://registry.npmmirror.com/echarts/-/echarts-5.3.2.tgz#0a7b3be8c48a48b2e7cb1b82121df0c208d42d2c"
+  integrity sha512-LWCt7ohOKdJqyiBJ0OGBmE9szLdfA9sGcsMEi+GGoc6+Xo75C+BkcT/6NNGRHAWtnQl2fNow05AQjznpap28TQ==
   dependencies:
-    zrender "4.3.2"
+    tslib "2.3.0"
+    zrender "5.3.1"
 
 ee-first@1.1.1:
   version "1.1.1"
@@ -7959,6 +7960,11 @@ ts-pnp@^1.1.6:
   resolved "https://registry.npm.taobao.org/ts-pnp/download/ts-pnp-1.2.0.tgz?cache=0&sync_timestamp=1596697408411&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-pnp%2Fdownload%2Fts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
   integrity sha1-pQCtCEsHmPHDBxrzkeZZEshrypI=
 
+tslib@2.3.0:
+  version "2.3.0"
+  resolved "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
+  integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==
+
 tslib@^1.9.0:
   version "1.13.0"
   resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.13.0.tgz?cache=0&sync_timestamp=1596751904317&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
@@ -8674,7 +8680,9 @@ yargs@^15.0.0:
     y18n "^4.0.0"
     yargs-parser "^18.1.2"
 
-zrender@4.3.2:
-  version "4.3.2"
-  resolved "https://registry.npm.taobao.org/zrender/download/zrender-4.3.2.tgz#ec7432f9415c82c73584b6b7b8c47e1b016209c6"
-  integrity sha1-7HQy+UFcgsc1hLa3uMR+GwFiCcY=
+zrender@5.3.1:
+  version "5.3.1"
+  resolved "https://registry.npmmirror.com/zrender/-/zrender-5.3.1.tgz#fa8e63ac7e719cfd563831fe8c42a9756c5af384"
+  integrity sha512-7olqIjy0gWfznKr6vgfnGBk7y4UtdMvdwFmK92vVQsQeDPyzkHW1OlrLEKg6GHz1W5ePf0FeN1q2vkl/HFqhXw==
+  dependencies:
+    tslib "2.3.0"