Browse Source

问题修改

Koishi 1 year ago
parent
commit
82f3b1da59
5 changed files with 99 additions and 54 deletions
  1. 9 0
      api/home.js
  2. 37 22
      pages/home/index.vue
  3. 48 29
      pages/home/stationIndex.vue
  4. 4 2
      pages/power/index.vue
  5. 1 1
      pages/type/index.vue

+ 9 - 0
api/home.js

@@ -16,4 +16,13 @@ export function stationCaldataApi(params) {
 		'method': 'GET',
 		params: params
 	})
+}
+
+// 获取场站首页数据
+export function cockpitProjectplanApi(params) {
+	return request({
+		url: '/cockpit/projectplan',
+		'method': 'GET',
+		params: params
+	})
 }

+ 37 - 22
pages/home/index.vue

@@ -334,7 +334,8 @@
 </template>
 <script>
 	import {
-		cockpitMonitor
+		cockpitMonitor,
+		cockpitProjectplanApi
 	} from '../../api/home.js'
 	import {
 		windPowerDataApi
@@ -379,7 +380,7 @@
 					if (res.data) {
 						if (res.data.qt) {
 							let datas = res.data.qt
-							that.mesExData = [{
+							let arr = [{
 									leftName: '容量',
 									leftValue: datas.zzjrl,
 									leftCode: '(MW)',
@@ -390,25 +391,10 @@
 									leftCode: '(天)',
 								},
 								{
-									leftName: '日发电量',
-									leftValue: Math.ceil(datas.rfdl / 10000),
-									leftCode: '(亿kWh)'
-								},
-								{
 									leftName: '利用小时',
 									leftValue: Math.ceil(datas.fdylyxs + datas.fdnlyxs),
 									leftCode: '(万kWh)'
-								},
-								{
-									leftName: '月发电量',
-									leftValue: Math.ceil(datas.yfdl / 10000),
-									leftCode: '(亿kWh)'
-								},
-								{
-									leftName: '年发电量',
-									leftValue: Math.ceil(datas.nfdl / 10000 / 10000),
-									leftCode: '(万亿kWh)'
-								},
+								}
 							]
 							that.windPowerData = [{
 								name: '风速',
@@ -419,13 +405,13 @@
 							}, {
 								name: '日照强度',
 								value: datas.gzzs,
-								code: '(Kw/m²)',
+								code: '(W/m²)',
 								min: 6,
 								max: 20
 							}, {
 								name: '功率',
 								value: datas.sjgl,
-								code: '(万kW)',
+								code: '(MW)',
 								min: 0,
 								max: 200
 							}, {
@@ -435,6 +421,7 @@
 								min: 0,
 								max: 500
 							}]
+							that.getHomeData2(arr)
 						}
 						if (res.data.cblpoint) {
 							that.powerstatusData = res.data.cblpoint
@@ -445,6 +432,34 @@
 					}
 				})
 			},
+			getHomeData2(arr) {
+				let that = this
+				cockpitProjectplanApi({
+					wpId: 'KGDL_FGS0'
+				}).then(res =>{
+					if (res && res.data) {
+						let item = res.data.proplanmap
+						let arr2  = [
+							{
+								leftName: '日发电量',
+								leftValue: Math.ceil(item.qy_r_sjdl / 10000),
+								leftCode: '(万kWh)'
+							},
+							{
+								leftName: '月发电量',
+								leftValue: Math.ceil(item.qy_y_sjdl / 10000),
+								leftCode: '(万kWh)'
+							},
+							{
+								leftName: '年发电量',
+								leftValue: Math.ceil(item.qy_n_sjdl / 10000 /10000),
+								leftCode: '(亿kWh)'
+							},
+						]
+						that.mesExData = [...arr, ...arr2]
+					}
+				})
+			},
 			getwindPowerData(type1, type2) {
 				windPowerDataApi({
 						company: type1,
@@ -458,7 +473,7 @@
 										let obj = {
 											name: item.wpname,
 											fs: Math.ceil(item.spped),
-											sjgl: Math.ceil(item.sjgl),
+											sjgl: Math.ceil(item.sjgl/1000),
 											cxgl: Math.ceil(item.cxgl)
 										}
 										this.windData.push(obj)
@@ -466,7 +481,7 @@
 										let obj = {
 											name: item.wpname,
 											gzqd: Math.ceil(item.spped),
-											sjgl: Math.ceil(item.sjgl),
+											sjgl: Math.ceil(item.sjgl/1000),
 											cxgl: Math.ceil(item.cxgl)
 										}
 										this.powerData.push(obj)

+ 48 - 29
pages/home/stationIndex.vue

@@ -273,7 +273,8 @@
 	} from '../../api/common.js'
 	import {
 		cockpitMonitor,
-		stationCaldataApi
+		stationCaldataApi,
+		cockpitProjectplanApi
 	} from '../../api/home.js'
 	export default {
 		onLoad: function(e) {
@@ -364,7 +365,7 @@
 				}).then(res => {
 					if (res.data.data) {
 						let datas = res.data.data
-						that.mesExData = [{
+						let arr = [{
 								leftName: '容量',
 								leftValue: Math.ceil(datas.zzjrl / 1000),
 								leftCode: '(MW)',
@@ -375,42 +376,21 @@
 								leftCode: '(天)',
 							},
 							{
-								leftName: '日发电量',
-								leftValue: Math.ceil(datas.rfdl),
-								leftCode: '(万kWh)'
-							},
-							{
 								leftName: '利用小时',
-								leftValue: Math.ceil(datas.ylyxs + datas.nlyxs),
-								leftCode: '(万kWh)'
-							},
-							{
-								leftName: '月发电量',
-								leftValue: Math.ceil(datas.yfdl),
-								leftCode: '(万kWh)'
-							},
-							{
-								leftName: '年发电量',
-								leftValue: Math.ceil(datas.nfdl),
-								leftCode: '(万kWh)'
-							},
+								leftValue: Math.ceil(datas.nlyxs),
+								leftCode: '(h/年)'
+							}
 						]
 						that.windPowerData = [{
-							name: '风速',
-							value: Math.ceil(datas.sspjfsgzd),
-							code: '(m/s)',
-							min: 6,
-							max: 8
-						}, {
 							name: '日照强度',
 							value: 0,
-							code: '(m/s)',
+							code: '(W/m²)',
 							min: 6,
 							max: 20
 						}, {
 							name: '功率',
 							value: datas.yggl,
-							code: '(万kW)',
+							code: '(MW)',
 							min: 0,
 							max: 200
 						}, {
@@ -418,8 +398,47 @@
 							value: Math.ceil(datas.fhl),
 							code: '(万kW)',
 							min: 0,
-							max: 500
+							max: 100
 						}]
+						if (this.stationWpid.indexOf('_FDC') > -1) {
+							let obj = {
+								name: '风速',
+								value: Math.ceil(datas.sspjfsgzd),
+								code: '(m/s)',
+								min: 6,
+								max: 8
+							}
+							that.windPowerData.push(obj)
+						}
+						that.getHomeData2(arr)
+					}
+				})
+			},
+			getHomeData2(arr) {
+				let that = this
+				cockpitProjectplanApi({
+					wpId: that.stationWpid
+				}).then(res =>{
+					if (res && res.data) {
+						let item = res.data.proplanmap
+						let arr2  = [
+							{
+								leftName: '日发电量',
+								leftValue: Math.ceil(item.qy_r_sjdl / 10000),
+								leftCode: '(万kWh)'
+							},
+							{
+								leftName: '月发电量',
+								leftValue: Math.ceil(item.qy_y_sjdl / 10000),
+								leftCode: '(万kWh)'
+							},
+							{
+								leftName: '年发电量',
+								leftValue: Math.ceil(item.qy_n_sjdl / 10000),
+								leftCode: '(万kWh)'
+							},
+						]
+						that.mesExData = [...arr, ...arr2]
 					}
 				})
 			},

+ 4 - 2
pages/power/index.vue

@@ -57,7 +57,7 @@
 									</view>
 									<view class="ycdl_data_col_right flex justify-between">
 										<text>{{Math.ceil(itv.dayPowerForecast/10000)}}</text>
-										<text>万MW</text>
+										<text>万kWh</text>
 									</view>
 								</view>
 							</uni-col>
@@ -220,6 +220,7 @@
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
 					],
+					dataLabel: false,
 					padding: [15, 15, 0, 5],
 					enableScroll: false,
 					legend: {
@@ -335,6 +336,7 @@
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
 						"#ea7ccc"
 					],
+					dataLabel: false,
 					padding: [15, 15, 0, 5],
 					enableScroll: false,
 					legend: {
@@ -650,7 +652,7 @@
 
 									text {
 										margin-left: 5px;
-										width: 100%;
+										width: 95%;
 										display: inline-block;
 										overflow: hidden;
 										white-space: nowrap;

+ 1 - 1
pages/type/index.vue

@@ -451,7 +451,7 @@
 
 				.qiun-chartsPie {
 					width: 100%;
-					height: 200px;
+					height: 300px;
 					margin: 10px 0;
 				}