Quellcode durchsuchen

增加故障报警服务

SunZehao vor 1 Jahr
Ursprung
Commit
39183a35bd

+ 2 - 1
api/login.js

@@ -3,7 +3,8 @@ import request from '@/utils/request'
 // 登录方法
 export function login(params) {
 	return request({
-		baseUrl: 'http://192.168.2.10:48080',
+		// baseUrl: 'http://192.168.2.4:48080',
+		baseUrl: 'http://10.81.3.127:48080',
 		url: '/admin-api/system/auth/login',
 		headers: {
 			isToken: false

+ 9 - 0
api/type.js

@@ -18,6 +18,15 @@ export function bulletinappShutdowngsjxApi(params) {
 	})
 }
 
+// 获取公司五项损失
+export function bulletinappCompanylossesApi(params) {
+	return request({
+		url: '/bulletinapp/companylosses',
+		'method': 'GET',
+		params: params
+	})
+}
+
 // 获取场站系统
 export function bulletinappShutdownczApi(params) {
 	return request({

+ 11 - 0
api/warn.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+// 获取公司故障数据
+export function companyhistoryFindAlarmlistApi(params) {
+	return request({
+		baseUrl: 'http://10.81.3.154:6015',
+		url: '/alarm/history/findAlarmlist',
+		'method': 'GET',
+		params: params
+	})
+}

+ 2 - 1
config.js

@@ -1,7 +1,8 @@
 // 应用全局配置
 module.exports = {
 	// baseUrl: 'http://api-dashboard.yudao.iocoder.cn',
-	baseUrl: 'http://192.168.2.10:6060',
+	// baseUrl: 'http://192.168.2.4:6060',
+	baseUrl: 'http://10.81.3.153:6060',
 	baseApi: '',
 	// 应用信息
 	appInfo: {

+ 1 - 1
manifest.json

@@ -43,7 +43,7 @@
             },
             "icons" : {
                 "android" : {
-                    "xhdpi" : ""
+                    "xhdpi" : "C:/Users/admin/Desktop/jn.png"
                 }
             }
         }

+ 0 - 12
pages.json

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

+ 7 - 7
pages/home/index.vue

@@ -159,7 +159,7 @@
 							<view class="windMsg_main_msg flex justify-between">
 								<view class="windMsgSty flex">
 									<view class="windMsgSty_left">
-										<image src="../../static/jnImage/indexPage/jn_jieru.png" mode=""></image>
+										<image src="../../static/jnImage/indexPage/yunxingGFNew.png" mode=""></image>
 										<text>接入</text>
 									</view>
 									<view class="windMsgSty_right flex justify-between">
@@ -278,7 +278,7 @@
 									</view>
 									<view class="msg_data_sty flex">
 										<view class="msg_data_name">
-											<text>出功率</text>
+											<text>出线功率</text>
 										</view>
 										<view class="dataSty flex">
 											<text>{{item.cxgl}}</text>
@@ -301,7 +301,7 @@
 										</view>
 										<view class="dataSty flex">
 											<text>{{item.gzqd}}</text>
-											<text>m/s</text>
+											<text>Kw/m²</text>
 										</view>
 									</view>
 									<view class="msg_data_sty flex">
@@ -315,7 +315,7 @@
 									</view>
 									<view class="msg_data_sty flex">
 										<view class="msg_data_name">
-											<text>出功率</text>
+											<text>出线功率</text>
 										</view>
 										<view class="dataSty flex">
 											<text>{{item.cxgl}}</text>
@@ -381,8 +381,8 @@
 							let datas = res.data.qt
 							that.mesExData = [{
 									leftName: '容量',
-									leftValue: Math.ceil(datas.zzjrl),
-									leftCode: '(WM)',
+									leftValue: datas.zzjrl,
+									leftCode: '(MW)',
 								},
 								{
 									leftName: '安全天数',
@@ -419,7 +419,7 @@
 							}, {
 								name: '日照强度',
 								value: datas.gzzs,
-								code: '(m/s)',
+								code: '(Kw/m²)',
 								min: 6,
 								max: 20
 							}, {

+ 2 - 2
pages/home/stationIndex.vue

@@ -152,7 +152,7 @@
 							<view class="windMsg_main_msg flex justify-between">
 								<view class="windMsgSty flex">
 									<view class="windMsgSty_left">
-										<image src="../../static/jnImage/indexPage/jn_jieru.png" mode=""></image>
+										<image src="../../static/jnImage/indexPage/yunxingGFNew.png" mode=""></image>
 										<text>接入</text>
 									</view>
 									<view class="windMsgSty_right flex justify-between">
@@ -367,7 +367,7 @@
 						that.mesExData = [{
 								leftName: '容量',
 								leftValue: Math.ceil(datas.zzjrl / 1000),
-								leftCode: '(WM)',
+								leftCode: '(MW)',
 							},
 							{
 								leftName: '安全天数',

+ 1 - 1
pages/power/index.vue

@@ -283,7 +283,7 @@
 					series: [{
 						name: '日计划电量',
 						textColor: "#FFFFFF",
-						textSize: 12,
+						textSize: 6,
 						data: series
 					}]
 				};

+ 44 - 29
pages/type/index.vue

@@ -82,7 +82,7 @@
 					</view>
 				</view>
 			</view>
-			<!-- <view class="wxss">
+			<view class="wxss">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
 						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
@@ -113,7 +113,7 @@
 						</uni-col>
 					</uni-row>
 				</view>
-			</view> -->
+			</view>
 		</view>
 	</view>
 </template>
@@ -122,7 +122,8 @@
 	import companyHeader from '../common/companyHeader.vue'
 	import {
 		bulletinappShutdowngsApi,
-		bulletinappShutdowngsjxApi
+		bulletinappShutdowngsjxApi,
+		bulletinappCompanylossesApi
 	} from '../../api/type.js'
 	export default {
 		onLoad: function() {},
@@ -211,33 +212,8 @@
 
 				}
 			]
-			this.wxssTypeData = [{
-					data: 1865,
-					name: '发电机'
-				},
-				{
-					data: 1865,
-					name: '传动变速'
-				},
-				{
-					data: 696,
-					name: '远程监控'
-				},
-				{
-					data: 527,
-					name: '电气控制'
-				},
-				{
-					data: 935,
-					name: '变桨'
-				},
-				{
-					data: 1022,
-					name: '变频'
-				}
-			]
-
 			this.getXTGZCSdata()
+			this.getWXSSdata()
 		},
 		methods: {
 			//获取系统故障次数
@@ -302,6 +278,44 @@
 					this.chartDataJX = JSON.parse(JSON.stringify(res));
 				}
 			},
+			//获取五项损失数据
+			getWXSSdata() {
+				let that = this
+				bulletinappCompanylossesApi({
+					wpId: 'KGDL_FGS0'
+				}).then(res => {
+					if (res.data) {
+						let item = res.data
+						that.wxssTypeData = [{
+								data: this.yearTab === 'day' ? item.rxnssdl : this.yearTab === 'month' ? item
+									.yxnssdl : item.nxnssdl,
+								name: '性能损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rwhssdl : this.yearTab === 'month' ? item
+									.ywhssdl : item.nwhssdl,
+								name: '检修损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rgzssdl : this.yearTab === 'month' ? item
+									.ygzssdl : item.ngzssdl,
+								name: '故障损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rxdssdl : this.yearTab === 'month' ? item
+									.yxdssdl : item.nxdssdl,
+								name: '限电损失'
+							},
+							{
+								data: this.yearTab === 'day' ? item.rslssdl : this.yearTab === 'month' ? item
+									.yslssdl : item.nslssdl,
+								name: '受累损失'
+							}
+						]
+						that.getPieBarwxss()
+					}
+				})
+			},
 			getPieBarwxss() {
 				let proColor = ['#5CB2EF', '#3E78C5', '#00299D', '#3EAD9F', '#3F3A99', '#5EAC88', '#5D56D0', '#CD8D23',
 					'#9F65C1', '#FD8974', '#C745B9', '#FF6B3E'
@@ -361,6 +375,7 @@
 				} else {
 					this.getJXGZCSdata()
 				}
+				this.getWXSSdata()
 			},
 		}
 	}

+ 0 - 1
pages/type/stationIndex.vue

@@ -147,7 +147,6 @@
 				chartDataXTgzcs: {},
 				chartDataJXgzcs: {},
 				chartDatawxss: {},
-				opts: {},
 				faultTypeXTgzcsData: [],
 				faultTypeJXgzcsData: [],
 				czxtgzcs: 0,

+ 43 - 2
pages/warn/faultWarnIndex.vue

@@ -9,9 +9,9 @@
 					<view class="faultwarnLeftBot">{{item.code}}</view>
 				</view>
 				<view class="faultwarn_main_com_right">
-					<view class="faultwarnRightTop" :style="getSty(item)">{{item.reson}}
+					<view class="faultwarnRightTop" :style="getSty(item)">{{item.description}}
 					</view>
-					<view class="faultwarnRightBot" :style="getSty(item)">{{item.date}}
+					<view class="faultwarnRightBot" :style="getSty(item)">{{getTimeDaya(item.ts)}}
 					</view>
 				</view>
 			</view>
@@ -21,6 +21,9 @@
 
 <script>
 	import companyHeader from '../common/companyHeader.vue'
+	import {
+		companyhistoryFindAlarmlistApi
+	} from '../../api/warn.js'
 	export default {
 		onLoad: function() {},
 		components: {
@@ -45,8 +48,46 @@
 					date: '2017-01-06  13:34:34'
 				},
 			]
+			this.getcompanyhistoryFindAlarmlist()
 		},
 		methods: {
+			//获取故障数据
+			getcompanyhistoryFindAlarmlist() {
+				let that = this
+				that.faultwarnData = []
+				let params = {
+					pageNum: 1,
+					pageSize: 50,
+					alarmId: "",
+					alarmType: 'windturbine',
+					deviceType: '',
+					stationid: "",
+					deviceid: "",
+					modelId: "",
+					components: "",
+					description: "",
+					isclose: false,
+					begin: that.getTimeDaya(new Date().getTime() - 60 * 60 * 1000),
+					end: that.getTimeDaya(new Date().getTime()),
+				};
+				companyhistoryFindAlarmlistApi(params).then(res => {
+					if (res && res.data.ls.length > 0) {
+						that.faultwarnData = res.data.ls
+					}
+				})
+			},
+			//获取时间
+			getTimeDaya(date) {
+				let currentDate = new Date(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 second = currentDate.getSeconds();
+				return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
+			},
 			getSty(item) {
 				let sty = ''
 				if (item.reson.length > 16) {

+ 63 - 28
pages/warn/stationIndex.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="stationFaultwarn">
+	<view class="stationfaultwarn">
 		<view class="box-bg">
 			<uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' :title="stationName"
 				@clickLeft="back" />
@@ -12,56 +12,92 @@
 					<view class="faultwarnLeftBot">{{item.code}}</view>
 				</view>
 				<view class="faultwarn_main_com_right">
-					<view class="faultwarnRightTop" :style="getSty(item)">{{item.reson}}
+					<view class="faultwarnRightTop" :style="getSty(item)">{{item.description}}
 					</view>
-					<view class="faultwarnRightBot" :style="getSty(item)">{{item.date}}
+					<view class="faultwarnRightBot" :style="getSty(item)">{{getTimeDaya(item.ts)}}
 					</view>
 				</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() {
-			this.stationName = uni.getStorageSync('stationName')
-		},
+		onLoad: function() {},
 		components: {
-			companyHeader,
-			stationBar
+			companyHeader
 		},
 		data() {
 			return {
 				stationName: '',
+				stationWpid: '',
 				faultwarnData: []
 			}
 		},
 		created() {
-			this.faultwarnData = [{
-					name: '乌力吉',
-					code: 'A25',
-					reson: '通讯站点诊断类故障',
-					date: '2017-01-06  13:34:34'
-				},
-				{
-					name: '宝龙山',
-					code: 'A25',
-					reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
-					date: '2017-01-06  13:34:34'
-				},
-			]
-		},
-		mounted() {
-			this.$refs.stationBar.showTab = '故障预警'
+			this.stationName = uni.getStorageSync('stationName')
+			this.stationWpid = uni.getStorageSync('stationWpid')
+			// this.faultwarnData = [{
+			// 		name: '乌力吉',
+			// 		code: 'A25',
+			// 		reson: '通讯站点诊断类故障',
+			// 		date: '2017-01-06  13:34:34'
+			// 	},
+			// 	{
+			// 		name: '宝龙山',
+			// 		code: 'A25',
+			// 		reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
+			// 		date: '2017-01-06  13:34:34'
+			// 	},
+			// ]
+			this.getcompanyhistoryFindAlarmlist()
 		},
 		methods: {
+			//获取故障数据
+			getcompanyhistoryFindAlarmlist() {
+				let that = this
+				that.faultwarnData = []
+				let params = {
+					pageNum: 1,
+					pageSize: 50,
+					alarmId: "",
+					alarmType: 'windturbine',
+					deviceType: '',
+					stationid: that.stationWpid,
+					deviceid: "",
+					modelId: "",
+					components: "",
+					description: "",
+					isclose: false,
+					begin: that.getTimeDaya(new Date().getTime() - 60 * 60 * 1000),
+					end: that.getTimeDaya(new Date().getTime()),
+				};
+				companyhistoryFindAlarmlistApi(params).then(res => {
+					if (res && res.data.ls.length > 0) {
+						that.faultwarnData = res.data.ls
+					}
+				})
+			},
 			back() {
 				this.$tab.switchTab('/pages/home/index')
 			},
+			//获取时间
+			getTimeDaya(date) {
+				let currentDate = new Date(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 second = currentDate.getSeconds();
+				return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
+			},
 			getSty(item) {
 				let sty = ''
 				if (item.reson.length > 16) {
@@ -86,7 +122,7 @@
 		background-color: #202246;
 	}
 
-	.stationFaultwarn {
+	.stationfaultwarn {
 		width: 100vw;
 		background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
 		background-repeat: no-repeat, repeat;
@@ -106,7 +142,6 @@
 
 		.falutWarn_main {
 			padding: 0 20px;
-			margin-top: 20px;
 
 			.faultwarn_main_com {
 				height: 60px;

+ 24 - 20
permission.js

@@ -19,23 +19,27 @@ function checkWhite(url) {
 // 页面跳转验证拦截器
 // let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
 // list.forEach(item => {
-//   uni.addInterceptor(item, {
-//     invoke(to) {
-//       if (getAccessToken()) {
-//         if (to.path === loginPage) {
-//           uni.reLaunch({ url: "/" })
-//         }
-//         return true
-//       } else {
-//         if (checkWhite(to.url)) {
-//           return true
-//         }
-//         uni.reLaunch({ url: loginPage })
-//         return false
-//       }
-//     },
-//     fail(err) {
-//       console.log(err)
-//     }
-//   })
-// })
+// 	uni.addInterceptor(item, {
+// 		invoke(to) {
+// 			if (getAccessToken()) {
+// 				if (to.path === loginPage) {
+// 					uni.reLaunch({
+// 						url: "/"
+// 					})
+// 				}
+// 				return true
+// 			} else {
+// 				if (checkWhite(to.url)) {
+// 					return true
+// 				}
+// 				uni.reLaunch({
+// 					url: loginPage
+// 				})
+// 				return false
+// 			}
+// 		},
+// 		fail(err) {
+// 			console.log(err)
+// 		}
+// 	})
+// })