Browse Source

增加故障报警功能(公司和场站)

SunZehao 1 year ago
parent
commit
cde8368e84

+ 6 - 0
pages.json

@@ -82,6 +82,12 @@
 				}
 			}
 		}, {
+			"path": "pages/warn/faultWarnIndex",
+			"style": {
+				"navigationBarTitleText": "故障预警",
+				"navigationStyle": "custom"
+			}
+		}, {
 			"path": "pages/warn/stationIndex",
 			"style": {
 				"navigationBarTitleText": "场站故障预警",

+ 6 - 6
pages/home/index.vue

@@ -391,8 +391,8 @@
 								},
 								{
 									leftName: '日发电量',
-									leftValue: Math.ceil(datas.rfdl),
-									leftCode: '(kWh)'
+									leftValue: Math.ceil(datas.rfdl / 10000),
+									leftCode: '(亿kWh)'
 								},
 								{
 									leftName: '利用小时',
@@ -401,13 +401,13 @@
 								},
 								{
 									leftName: '月发电量',
-									leftValue: Math.ceil(datas.yfdl),
-									leftCode: '(kWh)'
+									leftValue: Math.ceil(datas.yfdl / 10000),
+									leftCode: '(亿kWh)'
 								},
 								{
 									leftName: '年发电量',
-									leftValue: Math.ceil(datas.nfdl),
-									leftCode: '(万kWh)'
+									leftValue: Math.ceil(datas.nfdl / 10000 / 10000),
+									leftCode: '(万亿kWh)'
 								},
 							]
 							that.windPowerData = [{

+ 7 - 4
pages/power/index.vue

@@ -56,8 +56,8 @@
 										<text>{{showStationZH(itv.windpowerstationId)}}</text>
 									</view>
 									<view class="ycdl_data_col_right flex justify-between">
-										<text>{{itv.dayPowerForecast}}</text>
-										<text>MW</text>
+										<text>{{Math.ceil(itv.dayPowerForecast/10000)}}</text>
+										<text>MW</text>
 									</view>
 								</view>
 							</uni-col>
@@ -343,6 +343,7 @@
 					xAxis: {
 						disableGrid: true,
 						rotateLabel: true,
+						rotateAngle: 90,
 						axisLineColor: "#A49EAC",
 						fontColor: "#A49EAC",
 						fontSize: 10,
@@ -390,13 +391,15 @@
 					series: [{
 							name: "实际功率",
 							type: "line",
-							color: "#25a1ff",
+							textColor: "#FFFFFF",
+							textSize: 6,
 							data: sjglArr
 						},
 						{
 							name: "预测功率",
 							type: "line",
-							color: "#bc39aa",
+							textColor: "#FFFFFF",
+							textSize: 6,
 							data: ycglArr
 						}
 					]

+ 42 - 9
pages/power/stationIndex.vue

@@ -70,8 +70,8 @@
 										<text>{{it}}</text>
 									</view>
 									<view class="ycdl_data_col_right flex justify-between">
-										<text>{{item.inPower}}</text>
-										<text>MW</text>
+										<text>{{Math.ceil(item.inPower/10000)}}</text>
+										<text>MW</text>
 									</view>
 								</view>
 							</uni-col>
@@ -123,7 +123,7 @@
 			<view class="xsfsgl" v-else>
 				<view class="xsfsgl_title flex justify-center">
 					<image src="../../static/jnImage/powerPage/72clock.png" mode=""></image>
-					<text>72小时风速功率</text>
+					<text>未来3小时风速功率</text>
 				</view>
 				<view class="qiun-chartsLine">
 					<qiun-data-charts type="mix" :opts="optsLine" :chartData="chartDataLine" />
@@ -403,7 +403,7 @@
 			},
 			getSevenTwoData() {
 				let that = this
-				let threeDays = new Date(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
+				let threeDays = new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
 				let params = {
 					wpId: that.stationWpid,
 					beginDate: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date()
@@ -412,10 +412,42 @@
 				}
 				forecastShortApi(params).then(res => {
 					if (res && res.data) {
-						that.getLineBar(res.data[that.stationWpid])
+						let nowDate = new Date(that.getTimeDaya()).getTime()
+						let showData = []
+						if (res.data[that.stationWpid].length > 0) {
+							res.data[that.stationWpid].forEach((it, index) => {
+								if (nowDate === it.hours) {
+									showData = res.data[that.stationWpid].slice(index, index + 10)
+								}
+							})
+
+						}
+						// that.getLineBar(res.data[that.stationWpid])
+						that.getLineBar(showData)
 					}
 				})
 			},
+			//获取时间
+			getTimeDaya() {
+				let currentDate = new Date()
+				let year = currentDate.getFullYear()
+				let month = currentDate.getMonth() + 1
+				let day = currentDate.getDate()
+				let hour = currentDate.getHours()
+				let minute = currentDate.getMinutes() < 10 ? '0' + currentDate.getMinutes() : currentDate
+					.getMinutes()
+				let min = ''
+				if (minute > 0 && minute < 15) {
+					min = '00'
+				} else if (minute > 14 && minute < 30) {
+					min = '15'
+				} else if (minute > 29 && minute < 45) {
+					min = '30'
+				} else if (minute > 44 && minute < 59) {
+					min = '45'
+				}
+				return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':00'
+			},
 			getLineBar(values) {
 				let opts = {
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
@@ -427,8 +459,8 @@
 						show: true
 					},
 					xAxis: {
-						disableGrid: true,
 						rotateLabel: true,
+						scrollShow: true,
 						rotateAngle: 90,
 						axisLineColor: "#A49EAC",
 						fontColor: "#A49EAC",
@@ -513,9 +545,10 @@
 			},
 			//时间转换
 			changTime(date) {
-				let str = (new Date(date).getMonth() + 1) + '-' + new Date(date).getDate() + ' ' + new Date(date)
-					.getHours() + ':'
-				new Date(date).getMinutes() < 10 ? '0' + new Date(date).getMinutes() : new Date(date)
+				// let str = (new Date(date).getMonth() + 1) + '-' + new Date(date).getDate() + ' ' + new Date(date)
+				// 	.getHours() + ':'
+				let str = new Date(date).getHours() + ':' + (new Date(date).getMinutes() < 10 ? '0' + new Date(date)
+					.getMinutes() : new Date(date).getMinutes())
 				return str
 			},
 			changePowerTab(item) {

+ 5 - 3
pages/warn/faultWarnIndex.vue

@@ -5,7 +5,7 @@
 			<view class="faultwarn_main_com flex" style="margin:10px 0" v-for="(item,index) in faultwarnData"
 				:key="index">
 				<view class="faultwarn_main_com_left">
-					<view class="faultwarnLeftTop">{{item.name}}</view>
+					<view class="faultwarnLeftTop">{{item.devicename.substring(0, 3)}}</view>
 					<view class="faultwarnLeftBot">{{item.code}}</view>
 				</view>
 				<view class="faultwarn_main_com_right">
@@ -55,6 +55,7 @@
 			getcompanyhistoryFindAlarmlist() {
 				let that = this
 				that.faultwarnData = []
+				that.$modal.loading("数据查询中,请耐心等待...")
 				let params = {
 					pageNum: 1,
 					pageSize: 50,
@@ -72,6 +73,7 @@
 				};
 				companyhistoryFindAlarmlistApi(params).then(res => {
 					if (res && res.data.ls.length > 0) {
+						that.$modal.closeLoading()
 						that.faultwarnData = res.data.ls
 					}
 				})
@@ -82,7 +84,7 @@
 				let year = currentDate.getFullYear()
 				let month = currentDate.getMonth() + 1
 				let day = currentDate.getDate()
-				let hour = currentDate.getHours() + ':'
+				let hour = currentDate.getHours()
 				let minute = currentDate.getMinutes() < 10 ? '0' + currentDate.getMinutes() : currentDate
 					.getMinutes()
 				let second = currentDate.getSeconds();
@@ -90,7 +92,7 @@
 			},
 			getSty(item) {
 				let sty = ''
-				if (item.reson.length > 16) {
+				if (item.description.length > 16) {
 					sty = 'top: 5px'
 				} else {
 					sty = 'top: 15px'

+ 8 - 5
pages/warn/stationIndex.vue

@@ -8,7 +8,7 @@
 			<view class="faultwarn_main_com flex" style="margin:10px 0" v-for="(item,index) in faultwarnData"
 				:key="index">
 				<view class="faultwarn_main_com_left">
-					<view class="faultwarnLeftTop">{{item.name}}</view>
+					<view class="faultwarnLeftTop">{{item.devicename.substring(0, 3)}}</view>
 					<view class="faultwarnLeftBot">{{item.code}}</view>
 				</view>
 				<view class="faultwarn_main_com_right">
@@ -19,18 +19,19 @@
 				</view>
 			</view>
 		</view>
+		<station-bar ref="stationBar"></station-bar>
 	</view>
 </template>
 
 <script>
-	import companyHeader from '../common/companyHeader.vue'
+	import stationBar from '../common/stationTab.vue'
 	import {
 		companyhistoryFindAlarmlistApi
 	} from '../../api/warn.js'
 	export default {
 		onLoad: function() {},
 		components: {
-			companyHeader
+			stationBar
 		},
 		data() {
 			return {
@@ -62,6 +63,7 @@
 			getcompanyhistoryFindAlarmlist() {
 				let that = this
 				that.faultwarnData = []
+				that.$modal.loading("数据查询中,请耐心等待...")
 				let params = {
 					pageNum: 1,
 					pageSize: 50,
@@ -79,6 +81,7 @@
 				};
 				companyhistoryFindAlarmlistApi(params).then(res => {
 					if (res && res.data.ls.length > 0) {
+						that.$modal.closeLoading()
 						that.faultwarnData = res.data.ls
 					}
 				})
@@ -92,7 +95,7 @@
 				let year = currentDate.getFullYear()
 				let month = currentDate.getMonth() + 1
 				let day = currentDate.getDate()
-				let hour = currentDate.getHours() + ':'
+				let hour = currentDate.getHours()
 				let minute = currentDate.getMinutes() < 10 ? '0' + currentDate.getMinutes() : currentDate
 					.getMinutes()
 				let second = currentDate.getSeconds();
@@ -100,7 +103,7 @@
 			},
 			getSty(item) {
 				let sty = ''
-				if (item.reson.length > 16) {
+				if (item.description.length > 16) {
 					sty = 'top: 5px'
 				} else {
 					sty = 'top: 15px'