Browse Source

告警页面

wy 1 year ago
parent
commit
466ab381ee

+ 5 - 5
common/http.js

@@ -61,6 +61,10 @@ export function alarmList(data) {
 export function alarmDispose(data) {
 	return request.post("/alarm/dispose", data)
 }
+// 确认消防换仓
+export function getfireProtection(data) {
+	return request.post("/device/fireProtection", data)
+}
 //开始充电
 export function startCharge(params) {
 	return request.post(`/discharge/startCharge?chargerId=${params.chargerId}&sn=${params.sn}`)
@@ -112,11 +116,7 @@ export function FireChangestorage(data) {
 }
 //消防告警
 export function getwarnList(data) {
-	return request.post("/alarm/toDayAlarm", data)
-}
-// 处理告警
-export function getfireProtection(data) {
-	return request.post("/device/fireProtection", data)
+	return request.post("/alarm/realList", data)
 }
 //首页数据概览
 export function getoverview() {

+ 2 - 2
components/lyy-table/lyy-table.vue

@@ -51,7 +51,7 @@
 									:class="[content[header.key] ==2?'warnColor':'']">{{content[header.key] === 0 ? '待处理':content[header.key] === 1 ? '处理中' : '已处理'}}</text>
 							</template>
 							<template v-else>
-								<view v-if="header.label == '操作' && !battery" class="editColor" @click="EditAlarm(content)">处理
+								<view v-if="header.label == '操作' && !battery" class="editColor" @click="EditAlarm(content)">消防换仓
 								</view>
 								<view v-if="header.label == '操作' && battery" class="editColor" @click="EditAlarmInfo(content)">详情
 								</view>
@@ -424,7 +424,7 @@
 		width: 100%;
 		height: 5px;
 		position: sticky;
-		z-index: 999;
+		z-index: 99;
 		background: #111827;
 		top: -5px;
 	}

+ 2 - 2
config.js

@@ -1,8 +1,8 @@
 export default {
 	web_name: "智小狸",
 	// uni_app_web_api_url: "http://zk.li-ai.com.cn:8080/api", //后端统一接口路径
-	uni_app_web_api_url: "http://192.168.3.4:8080/api",
+	uni_app_web_api_url: "http://192.168.3.110:8080/api",
 	// web_socket_url:'ws://zk.li-ai.com.cn:8080/ws/',
-	web_socket_url:'ws://192.168.3.4:8080/ws/',
+	web_socket_url:'ws://192.168.3.110:8080/ws/',
 	debug: true
 }

+ 39 - 21
pages/fault-alarm/components/Fault.vue

@@ -2,17 +2,17 @@
 	<view class="recharge_box">
 		<view class="search_box box">
 			<uni-forms :modelValue="queryParams" class="search_box_from">
-				<uni-forms-item label="告警设备:" label-width="80px" label-align="right" name="equipment">
+				<uni-forms-item label="告警设备:"  label-align="right" name="equipment">
 					<uni-easyinput type="text" v-model="queryParams.equipment" placeholder="请输入" />
 				</uni-forms-item>
-				<uni-forms-item label="告警信息:" label-width="80px" label-align="right" name="info">
+				<uni-forms-item label="告警信息:"  label-align="right" name="info">
 					<uni-easyinput type="text" v-model="queryParams.info" placeholder="请输入" />
 				</uni-forms-item>
-				<uni-forms-item label="告警时间:" name="dateArr" label-width="80px" label-align="right" class="last_box">
+				<uni-forms-item label="告警时间:" name="dateArr" label-align="right" class="last_box">
 					<uni-datetime-picker v-model="dateArr" type="daterange" rangeSeparator="至" />
 				</uni-forms-item>
-				<uni-forms-item label="告警状态:" name="state" label-width="80px" label-align="right" class="select_box">
-					<uni-data-select v-model="queryParams.state" :localdata="range"
+				<uni-forms-item label="告警类型:" name="type"  label-align="right" class="select_box">
+					<uni-data-select v-model="queryParams.type" :localdata="range" style="width: 102px;"
 						@change="changeId"></uni-data-select>
 				</uni-forms-item>
 
@@ -71,22 +71,25 @@
 				alarmFrom: {
 					id: 0,
 					remark: null,
-					state: undefined,
+					type: undefined,
 					equipment: undefined,
 					info: undefined,
 					beginTime: undefined,
 				},
 				range: [{
-						value: 0,
-						text: "待处理"
-					},
-					{
 						value: 1,
-						text: "处理中"
+						text: "充电机告警"
 					},
 					{
 						value: 2,
-						text: "已处理"
+						text: "BMS告警"
+					},
+					{
+						value: 3,
+						text: "机器人告警"
+					},{
+						value: 4,
+						text: "消防告警"
 					},
 				],
 				datalist: [],
@@ -98,7 +101,7 @@
 					info: undefined, //告警信息
 					beginTime: undefined,
 					endTime: undefined,
-					state: undefined, //告警状态
+					type: undefined, //告警状态
 					orderByField: 'id', //排序字段
 					orderByWays: 'desc' //排序方式
 				},
@@ -125,14 +128,14 @@
 					key: 'endTime',
 					widtd: 186,
 
-				}, {
+				},{
 					label: '告警状态',
 					key: 'state',
 					widtd: 112,
-				}, {
-					label: '操作',
-					key: 'id',
-					widtd: 98,
+				},{
+					label: '告警类型',
+					key: 'type',
+					widtd: 112,
 				}],
 				showLoadMore: false,
 				loadMore: 'more',
@@ -155,7 +158,7 @@
 				console.log(this.alarmFrom)
 				const params = {
 					id: this.alarmFrom.id,
-					state: this.alarmFrom.state,
+					type: this.alarmFrom.type,
 					remark: this.alarmFrom.remark
 				}
 				this.$http.alarmDispose(params)
@@ -188,6 +191,17 @@
 					// console.log(res.data.records)
 					this.showLoadMore = false
 					if (res.code === 0) {
+						res.data.records.forEach(item=>{
+							if(item.type == 1){
+								item.type = '充电机告警'
+							}else if(item.type == 2){
+								item.type = 'BMS告警'
+							}else if(item.type == 3){
+								item.type = '机器人告警'
+							}else if(item.type == 4){
+								item.type = '消防告警'
+							}
+						})
 						this.datalist.push(...res.data.records)
 						this.total = res.data.total
 					}
@@ -207,7 +221,7 @@
 					info: undefined,
 					beginTime: undefined,
 					endTime: undefined,
-					state: undefined
+					type: undefined
 				}
 				this.alarmList()
 			},
@@ -216,6 +230,9 @@
 				if (this.dateArr.length > 0) {
 					this.queryParams.beginTime = this.dateArr[0]+' ' +'00:00:00'
 					this.queryParams.endTime = this.dateArr[1]+' ' +'23:59:59'
+				}else{
+					this.queryParams.beginTime = undefined
+					this.queryParams.endTime = undefined
 				}
 				this.queryParams.page = 1
 				this.datalist = []
@@ -275,7 +292,7 @@
 		.box_btn {
 			display: flex;
 			margin-top: 16px;
-			padding-right: 16px;
+			padding-right: 10px;
 
 			.cx_btn {
 				width: 60px;
@@ -323,6 +340,7 @@
 	::v-deep .uni-forms-item__label {
 		font-size: 14px;
 		color: white;
+		padding: 0 2px 0 0;
 	}
 
 	::v-deep .uni-select__selector {

+ 53 - 38
pages/fault-alarm/components/FireAlarm.vue

@@ -11,10 +11,10 @@
 				<uni-forms-item label="告警时间:" name="dateArr" label-width="80px" label-align="right" class="last_box">
 					<uni-datetime-picker v-model="dateArr" type="daterange" rangeSeparator="至" />
 				</uni-forms-item>
-				<!-- <uni-forms-item label="告警状态:" name="state" label-width="80px" label-align="right" class="select_box">
-					<uni-data-select v-model="queryParams.state" :localdata="range"
+				<uni-forms-item label="告警状态:" name="type" label-width="80px" label-align="right" class="select_box">
+					<uni-data-select v-model="queryParams.type" :localdata="range" style="width: 104px;"
 						@change="changeId"></uni-data-select>
-				</uni-forms-item> -->
+				</uni-forms-item>
 
 			</uni-forms>
 			<view class="box_btn">
@@ -86,24 +86,22 @@
 				popupMessage: '成功消息',
 				popupType: 'success',
 				alarmFrom: {
-					// id: 0,
-					// remark: null,
-					// state: undefined,
-					// equipment: undefined,
-					// info: undefined,
-					// beginTime: undefined,
+					
 				},
 				range: [{
-						value: 0,
-						text: "待处理"
-					},
-					{
 						value: 1,
-						text: "处理中"
+						text: "充电机告警"
 					},
 					{
 						value: 2,
-						text: "已处理"
+						text: "BMS告警"
+					},
+					{
+						value: 3,
+						text: "机器人告警"
+					},{
+						value: 4,
+						text: "消防告警"
 					},
 				],
 				datalist: [],
@@ -121,28 +119,30 @@
 				headers: [{
 					label: '告警设备',
 					key: 'equipment',
-					widtd: 100
+					widtd: 150
+				},{
+					label: '告警类型',
+					key: 'type',
+					widtd: 200,
+				},{
+					label: '告警标识',
+					key: 'code',
+					widtd: 150,
 				},{
 					label: '告警信息',
 					key: 'info',
 					widtd: 330
-				}, {
-					label: '告警时间',
-					key: 'beginTime',
-					widtd: 196,
-				}, {
-					label: '是否处理',
-					key: 'state',
-					widtd: 128,
-				}, {
-					label: '正在告警',
-					key: 'state',
-					widtd: 128,
-				}, {
+				},   {
 					label: '操作',
 					key: 'id',
-					widtd: 98,
-				}],
+					widtd: 120,
+				},
+				// {
+				// 	label: '告警开始时间',
+				// 	key: 'beginTime',
+				// 	widtd: 196,
+				// },
+				],
 				showLoadMore: false,
 				loadMore: 'more',
 			}
@@ -164,11 +164,11 @@
 			alarmDispose() {
 				console.log(this.alarmFrom)
 				//这里数据都拿到了 接口也写好了   就看后端需要传什么参数了 参数写好放开下面的注释就行
-				// const params = {
-				// 	id: this.alarmFrom.id,
-				// 	state: this.alarmFrom.state,
-				// 	remark: this.alarmFrom.remark
-				// }
+				const params = {
+					targetCode: this.alarmFrom.chargerCode,
+					// type: this.alarmFrom.type,
+					// remark: this.alarmFrom.remark
+				}
 				// this.$http.getfireProtection(params)
 				// 	.then(res => {
 				// 		this.$refs.AlarmDrawer.close();
@@ -199,7 +199,18 @@
 					// console.log(res.data.records)
 					this.showLoadMore = false
 					if (res.code === 0) {
-						this.datalist.push(...res.data)
+						res.data.list.forEach(item=>{
+							if(item.type == 1){
+								item.type = '充电机告警'
+							}else if(item.type == 2){
+								item.type = 'BMS告警'
+							}else if(item.type == 3){
+								item.type = '机器人告警'
+							}else if(item.type == 4){
+								item.type = '消防告警'
+							}
+						})
+						this.datalist.push(...res.data.list)
 						this.total = res.data.total
 					}
 				});
@@ -215,7 +226,8 @@
 					info: undefined,
 					beginTime: undefined,
 					endTime: undefined,
-					state: undefined
+					type: undefined,
+					orderByWays:"desc"
 				}
 				this.alarmList()
 			},
@@ -224,6 +236,9 @@
 				if (this.dateArr.length > 0) {
 					this.queryParams.beginTime = this.dateArr[0] +' ' +'00:00:00'
 					this.queryParams.endTime = this.dateArr[1]+' ' +'23:59:59'
+				}else{
+					this.queryParams.beginTime = undefined
+					this.queryParams.endTime = undefined
 				}
 				this.queryParams.page = 1
 				this.datalist = []

+ 5 - 4
pages/fault-alarm/index.vue

@@ -5,12 +5,13 @@
 				
 			</view> -->
 			<view class="service_header_right">
-				<view class="btn" :class="isSlecte?'active':''" @click="isSlecte=true">
+				<view class="btn" :class="!isSlecte?'active':''" @click="isSlecte=false">
 					当前告警
 				</view>
-				<view class="btn" :class="!isSlecte?'active':''" @click="isSlecte=false">
-					告警记录
+				<view class="btn" :class="isSlecte?'active':''" @click="isSlecte=true">
+					 告警记录
 				</view>
+				
 			</view>
 		</view>
 		<view class="recharge" v-if="!isSlecte">
@@ -31,7 +32,7 @@
 		},
 		data() {
 			return {
-				isSlecte:true,
+				isSlecte:false,
 			}
 		},
 		mounted() {