<template>
|
<div class="indexWarp">
|
<van-nav-bar title="电池告警历史查询" @click-left="$router.back()" left-arrow fixed safe-area-inset-top placeholder right-text="筛选" @click-right="showPopup=true">
|
</van-nav-bar>
|
<van-pull-refresh v-model="tab.refreshing" @refresh="onRefresh(tab)">
|
<van-list v-model="tab.loading" :finished="tab.finished" finished-text="没有更多了" @load="loadData(tab)">
|
<div class="pd-24">
|
<div class="card m-b-24" v-for="(item,i) in tab.listData" :key="i">
|
<div class="commonTitle cardTitle">
|
{{item.battery1}}
|
</div>
|
<div class="commonTitle">
|
<div class="label">电池组名称:</div>
|
<div class="text">
|
{{item.tes1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">告警名称:</div>
|
<div class="text">
|
{{item.tester1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">单体编号:</div>
|
<div class="text">
|
{{item.current1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">告警值:</div>
|
<div class="text">
|
{{item.capacity1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">告警等级:</div>
|
<div class="text">
|
{{item.monomer1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">告警开始时间:</div>
|
<div class="text">
|
{{item.start1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">告警确认时间:</div>
|
<div class="text">
|
{{item.alarm1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<div class="label">告警结束时间:</div>
|
<div class="text">
|
{{item.end1}}
|
</div>
|
</div>
|
<div class="commonTitle">
|
<van-button size="mini" color="#f3535f" @click="deleteUser(item)">删除</van-button>
|
</div>
|
</div>
|
</div>
|
</van-list>
|
</van-pull-refresh>
|
|
<van-popup v-model="showPopup" position="right" :style="{ width: '90%' ,height:'100%'}">
|
<div class="card">
|
<van-field v-model="selectValue1" is-link readonly name="picker" label="维护区:" placeholder="请选择维护区" @click="showPicker1 = true" />
|
<van-field v-model="selectValue2" is-link readonly name="picker" label="机房站点:" placeholder="请选择机房站点" @click="showPicker2 = true" />
|
<van-field v-model="selectLable3" is-link readonly name="picker" label="蓄电池组:" placeholder="请选择蓄电池组" @click="showPicker3 = true" />
|
<van-field v-model="startDrsj" is-link readonly name="picker" label="开始日期:" placeholder="请选择开始日期" @click="showTimePopup1 = true" />
|
<van-field v-model="endDrsj" is-link readonly name="picker" label="结束日期:" placeholder="请选择结束日期" @click="showTimePopup2 = true" />
|
<van-field label="告警条件过滤" class="lineInput">
|
<template #input>
|
<van-checkbox v-model="checkbox.usr_id.bol" shape="square" class="lineCheckBox">在线电压</van-checkbox>
|
<van-checkbox v-model="checkbox.fault_type_id.bol" shape="square" class="lineCheckBox">组端电压</van-checkbox>
|
<van-checkbox v-model="checkbox.uname.bol" shape="square" class="lineCheckBox">漏液电压</van-checkbox>
|
<van-checkbox v-model="checkbox.fault_level.bol" shape="square" class="lineCheckBox">充电电流</van-checkbox>
|
<van-checkbox v-model="checkbox.record_uid.bol" shape="square" class="lineCheckBox">放电电流</van-checkbox>
|
<van-checkbox v-model="checkbox.maint_type_id.bol" shape="square" class="lineCheckBox">单体电压</van-checkbox>
|
<van-checkbox v-model="checkbox.maint_close.bol" shape="square" class="lineCheckBox">单体内阻</van-checkbox>
|
<van-checkbox v-model="checkbox.maint_done.bol" shape="square" class="lineCheckBox">单体温度</van-checkbox>
|
<van-checkbox v-model="checkbox.fault_type.bol" shape="square" class="lineCheckBox">预估容量</van-checkbox>
|
</template>
|
</van-field>
|
<van-field label="告警阀值过滤" class="lineInput">
|
<template #input>
|
<van-checkbox v-model="checkbox.alm_id.bol" shape="square" class="lineCheckBox">上限告警</van-checkbox>
|
<van-checkbox v-model="checkbox.alm_signal_id.bol" shape="square" class="lineCheckBox">下限告警</van-checkbox>
|
</template>
|
</van-field>
|
<van-field label="告警等级过滤" class="lineInput">
|
<template #input>
|
<van-checkbox v-model="checkbox.Level_one_warn.bol" shape="square" class="lineCheckBox">一级告警</van-checkbox>
|
<van-checkbox v-model="checkbox.Level_two_warn.bol" shape="square" class="lineCheckBox">二级告警</van-checkbox>
|
<van-checkbox v-model="checkbox.master_audit.bol" shape="square" class="lineCheckBox">三级告警</van-checkbox>
|
<van-checkbox v-model="checkbox.appoint_uid.bol" shape="square" class="lineCheckBox">四级告警</van-checkbox>
|
</template>
|
</van-field>
|
<div class="subBtn" @click="selectScreen">保存</div>
|
</div>
|
</van-popup>
|
|
<van-popup v-model="showPicker1" round position="bottom">
|
<van-picker show-toolbar :columns="vindicate" value-key="label" @confirm="changeSelect1" @cancel="showPicker1 = false" title="维护区" />
|
</van-popup>
|
<van-popup v-model="showPicker2" round position="bottom">
|
<van-picker show-toolbar :columns="newRoms" value-key="label" @confirm="storageBatterys" @cancel="showPicker2 = false" title="机房站点" />
|
</van-popup>
|
<van-popup v-model="showPicker3" round position="bottom">
|
<van-picker show-toolbar :columns="options" value-key="BattGroupName" @confirm="selectBatter" @cancel="showPicker3 = false" title="蓄电池组" />
|
</van-popup>
|
<van-popup v-model="showTimePopup1" round position="bottom">
|
<van-datetime-picker v-model="startdatetime" type="date" :min-date="minDate" :max-date="maxDate" title="告警开始日期" @cancel="show = false" @confirm="confirmPicker1" />
|
</van-popup>
|
<van-popup v-model="showTimePopup2" round position="bottom">
|
<van-datetime-picker v-model="enddatetime" type="date" :min-date="minDate" :max-date="maxDate" title="告警开始日期" @cancel="show = false" @confirm="confirmPicker2" />
|
</van-popup>
|
<div class="refBtn" @click="onRefresh">
|
<van-icon name="replay" />
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import {
|
searchProvince /* 维护区 */,
|
roomsStation /* 机房站点 */,
|
batterySearch /* 蓄电池组 */,
|
historySeroom /*告警信息 */,
|
hisDelet /*删除 */
|
} from "@/pages/alarmMager/js/api"
|
export default {
|
components: {},
|
data() {
|
let thistime = new Date();
|
let yy = thistime.getFullYear();
|
let MM = thistime.getMonth() + 1;
|
let DD = thistime.getDate();
|
let day1 = yy + "-" + MM + "-" + DD;
|
return {
|
showPopup: false,
|
showPicker1: false,
|
showPicker2: false,
|
showPicker3: false,
|
/* 维护区 */
|
vindicate: [],
|
/* 机房站点 */
|
newRoms: [],
|
/* 蓄电池租 */
|
selectValue1: "",
|
selectValue2: "",
|
selectValue3: 0,
|
selectLable3: "",
|
options: [],
|
checkbox: {
|
usr_id: {
|
bol: true,
|
value1: "119001",
|
value2: 0,
|
},
|
/* 在线电压 */
|
fault_type_id: {
|
bol: true,
|
value1: "119002",
|
value2: 0,
|
} /* 组端电压 */,
|
uname: {
|
bol: true,
|
value1: "119012",
|
value2: 0,
|
},
|
/* 漏液电压 */
|
fault_level: {
|
bol: true,
|
value1: "119003",
|
value2: 0,
|
} /* 充电电流 */,
|
record_uid: {
|
bol: true,
|
value1: "119004",
|
value2: 0,
|
} /* 放电电流 */,
|
fault_type: {
|
bol: true,
|
value1: "119013",
|
value2: 0,
|
}/* 单体预估容量告警 */,
|
Level_one_warn: {
|
bol: true,
|
value1: "1",
|
value2: 0,
|
} /*一级警告 */,
|
Level_two_warn: {
|
bol: true,
|
value1: "2",
|
value2: 0,
|
} /* 二级警告 */,
|
alm_id: {
|
bol: true,
|
value1: "100",
|
value2: 0,
|
} /* 上限告警 */,
|
maint_type_id: {
|
bol: true,
|
value1: "119005",
|
value2: 0,
|
} /* 单体电压 */,
|
maint_close: {
|
bol: true,
|
value1: "119007",
|
value2: 0,
|
} /* 单体内阻 */,
|
maint_done: {
|
bol: true,
|
value1: "119006",
|
value2: 0,
|
} /* 单体温度 */,
|
master_audit: {
|
bol: true,
|
value1: "3",
|
value2: 0,
|
} /* 三级告警 */,
|
appoint_uid: {
|
bol: true,
|
value1: "4",
|
value2: 0,
|
} /* 四级告警 */,
|
alm_signal_id: {
|
bol: true,
|
value1: "100",
|
value2: 0,
|
} /* 下限告警 */,
|
},
|
tab: {
|
title: '未确认告警',
|
listData: [],
|
loading: false,
|
finished: false,
|
refreshing: false,
|
page: {
|
pageSize: 6,
|
pageCurr: 0
|
}
|
},
|
/* 日期 */
|
startDrsj: "2000-1-1",
|
startdatetime: new Date(2000, 0, 1),
|
endDrsj: day1,
|
enddatetime: new Date(yy, MM - 1, DD),
|
minDate: new Date(2000, 0, 1),
|
maxDate: new Date(yy + 5, 0, 1),
|
showTimePopup1: false,
|
showTimePopup2: false,
|
}
|
},
|
mounted() {
|
this.vindicateData(); /* 维护区 */
|
this.computerSite(); /*机房站点 */
|
this.storageBatterys(); /* 蓄电池组 */
|
},
|
methods: {
|
/* 维护区 */
|
async vindicateData() {
|
const resType = await searchProvince();
|
let typeList = JSON.parse(resType.data.result).data.map((item) => {
|
return {
|
label: item,
|
value: item,
|
};
|
});
|
let vindicate = typeList.map((item) => {
|
return item;
|
});
|
this.vindicate = vindicate;
|
},
|
/* 机房站点 */
|
async computerSite() {
|
const roomsSeation = await roomsStation({
|
UNote: this.selectValue1,
|
});
|
if (roomsSeation.data.result) {
|
let newRoms = JSON.parse(roomsSeation.data.result).data.map((item) => {
|
return {
|
label: item,
|
value: item,
|
};
|
});
|
this.newRoms = newRoms;
|
}
|
},
|
/* 蓄电池组 */
|
async storageBatterys(value) {
|
if (value) {
|
this.selectValue2 = value.value
|
}
|
// 初始化值
|
this.selectValue3 = 0;
|
this.selectLable3 = "";
|
this.showPicker2 = false
|
// 构造查询条件
|
const batteryss = await batterySearch({
|
UNote: this.selectValue1,
|
UName: this.selectValue2,
|
});
|
if (batteryss.data.result) {
|
let options = JSON.parse(batteryss.data.result).data.map((item) => {
|
item.BattGroupName = `${item.BattGroupName}-${item.MonCount}节`;
|
return item;
|
});
|
this.options = options;
|
}
|
},
|
changeSelect1(value) {
|
if (value) {
|
this.selectValue1 = value.value
|
}
|
this.selectValue2 = "";
|
this.selectValue3 = 0;
|
this.selectLable3 = "";
|
this.computerSite(); /*机房站点 */
|
this.storageBatterys(); /* 蓄电池组 */
|
this.showPicker1 = false
|
},
|
//选择电池组
|
selectBatter(value) {
|
if (value) {
|
this.selectValue3 = value.BattGroupId
|
this.selectLable3 = value.BattGroupName
|
}
|
this.showPicker3 = false
|
|
// 查询告警信息
|
this.loadData();
|
},
|
selectScreen() {
|
this.showPopup = false
|
this.onRefresh(this.tab)
|
},
|
//请求数据总触发
|
loadData(tab) {
|
if (tab) {
|
this.paramsAlram(tab)
|
} else {
|
this.paramsAlram(this.tab)
|
}
|
},
|
//区管理员请求数据
|
paramsAlram(tab) {
|
// 将 loading 设置为 true,表示处于加载状态
|
tab.loading = true;
|
tab.page.pageCurr++
|
let params = {};
|
Object.keys(this.checkbox).forEach((item, index) => {
|
if (this.checkbox[item].bol) {
|
params[item] = this.checkbox[item].value1;
|
} else {
|
params[item] = this.checkbox[item].value2;
|
}
|
});
|
// 一级和二级告警
|
params.num = this.checkbox.Level_one_warn.bol ? 1 : 0;
|
params.BattGroupId = this.checkbox.Level_two_warn.bol ? 2 : 0;
|
// 上限和下限告警
|
params.alm_id = this.checkbox.alm_id.bol ? 1 : 100;
|
params.alm_signal_id = this.checkbox.alm_signal_id.bol ? 0 : 100;
|
let postData = {
|
page: {
|
pageSize: tab.page.pageSize,
|
pageCurr: tab.page.pageCurr,
|
pageAll: 0
|
},
|
binf: {
|
StationName1: this.selectValue1,
|
StationName: this.selectValue2,
|
BattGroupId: this.selectValue3 ? this.selectValue3 : 0,
|
},
|
mainf: {
|
usr_id: params.usr_id,
|
fault_type_id: params.fault_type_id,
|
uname: params.uname,
|
fault_level: params.fault_level,
|
record_uid: params.record_uid,
|
maint_type_id: params.maint_type_id,
|
maint_done: params.maint_done,
|
maint_close: params.maint_close,
|
appoint_uid: params.appoint_uid,
|
master_audit: params.master_audit,
|
num: params.num,
|
BattGroupId: params.BattGroupId,
|
master_id: "0",
|
fault_type: params.fault_type,
|
},
|
adata_H: {
|
MonNum: "0",
|
alm_id: params.alm_id,
|
alm_start_time: this.startDrsj + " 00:00:00",
|
alm_start_time1: this.endDrsj + " 23:59:59",
|
alm_signal_id: params.alm_signal_id,
|
Record_Id: "0"
|
}
|
}
|
historySeroom(postData).then((res) => {
|
const resData = JSON.parse(res.data.result);
|
tab.loading = false;
|
if (resData.data) {
|
let arr = resData.data.map((item, index) => {
|
item.index = index + 1;
|
return {
|
room1: item.index,
|
battery1: item.binf.StationName,
|
tes1: item.binf.BattGroupName,
|
tester1: item.binf.StationName8,
|
current1: item.adata_H.MonNum,
|
capacity1: item.adata_H.alm_value,
|
monomer1: item.binf.StationName9,
|
start1: item.adata_H.alm_start_time,
|
end1: item.adata_H.alm_end_time,
|
alarm1: item.adata_H.alm_confirmed_time,
|
num: item.adata_H.num
|
};
|
});
|
tab.listData.push(...arr)
|
}
|
if (tab.page.pageCurr >= resData.data[resData.data.length - 1].page.pageAll) {
|
tab.finished = true;
|
} else {
|
tab.finished = false;
|
}
|
}).catch((err) => {
|
tab.loading = false;
|
tab.finished = true;
|
console.log(err)
|
});
|
},
|
deleteUser(value) {
|
this.$dialog.confirm({
|
title: '提示',
|
message:
|
'确定删除这条告警记录吗, 是否继续?',
|
}).then(() => {
|
hisDelet([{
|
stationname: value.battery1,
|
num: value.num,
|
note: value.tester1
|
}]).then((wk) => {
|
if (JSON.parse(wk.data.result).code !== 1) {
|
return this.$toast("删除失败");
|
}
|
this.onRefresh();
|
this.$toast("删除成功");
|
}).catch((err) => {
|
|
});
|
}).catch(() => {
|
// on cancel
|
});
|
},
|
onRefresh(tab) {
|
if (tab?.title) {
|
// 清空列表数据
|
tab.finished = false;
|
tab.refreshing = false;
|
tab.page = {
|
pageSize: 12,
|
pageCurr: 0
|
}
|
tab.listData = [];
|
// 重新加载数据
|
this.loadData(tab);
|
} else {
|
// 清空列表数据
|
this.tab.finished = false;
|
this.tab.refreshing = false;
|
this.tab.page = {
|
pageSize: 12,
|
pageCurr: 0
|
}
|
this.tab.listData = [];
|
// 重新加载数据
|
this.loadData(this.tab);
|
}
|
},
|
confirmPicker1(val) {
|
let year = val.getFullYear()
|
let month = val.getMonth() + 1
|
let day = val.getDate()
|
this.startDrsj = `${year}-${month}-${day}`
|
this.showTimePopup1 = false
|
},
|
confirmPicker2(val) {
|
let year = val.getFullYear()
|
let month = val.getMonth() + 1
|
let day = val.getDate()
|
this.endDrsj = `${year}-${month}-${day}`
|
this.showTimePopup2 = false
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.indexWarp {
|
width: 100%;
|
min-height: 100%;
|
background: #f5f5f5;
|
}
|
|
.van-tabs {
|
height: calc(100% - 92px);
|
padding-top: 92px;
|
}
|
|
.van-tabs /deep/ .van-tabs__content {
|
min-height: 100%;
|
background: #f5f5f5;
|
}
|
|
.van-tabs /deep/ .van-tabs__wrap {
|
position: fixed;
|
left: 0;
|
width: 100%;
|
top: 92px;
|
z-index: 9;
|
border-bottom: 1px solid #ededed;
|
}
|
|
.pd-24 {
|
padding: 24px;
|
}
|
|
.listWarp {
|
background: #ffffff;
|
border-radius: 16px;
|
overflow: hidden;
|
box-shadow: 0px 4px 20px 0px rgba(75, 136, 249, 0.2);
|
}
|
|
.van-tabs /deep/ .van-cell__title {
|
width: 90%;
|
}
|
|
.alarmTitle {
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
color: #323233;
|
font-size: 24px;
|
}
|
|
.alarmTitle .tag {
|
font-size: 20px;
|
margin-right: 8px;
|
background-color: #4b88f9;
|
}
|
|
.time {
|
color: #969799;
|
font-size: 20px;
|
}
|
|
.card {
|
background-color: #ffffff;
|
border-radius: 16px;
|
margin: 0 auto;
|
width: 100%;
|
padding: 24px;
|
box-shadow: 0px 4px 20px 0px rgba(75, 136, 249, 0.2);
|
}
|
.lineInput .lineCheckBox{
|
margin-bottom: 8px;
|
}
|
.lineInput .lineCheckBox:nth-of-type(2n){
|
margin-left: 18px;
|
}
|
|
.lineInput /deep/ .van-field__control--custom{
|
flex-wrap: wrap;
|
}
|
|
.subBtn {
|
flex: 1;
|
height: 98px;
|
background: #4b88f9;
|
border-radius: 8px;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
color: #ffffff;
|
font-size: 36px;
|
margin-top: 48px;
|
}
|
.m-b-24{
|
margin-bottom: 24px;
|
}
|
.commonTitle {
|
font-size: 28px;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #333333;
|
line-height: 40px;
|
padding-bottom: 24px;
|
border-bottom: 1px solid #eeeeee;
|
margin-bottom: 22px;
|
display: flex;
|
}
|
|
.cardTitle {
|
font-weight: bold;
|
}
|
|
.refBtn{
|
box-shadow: 0px 4px 20px 0px rgba(75, 136, 249, 0.2);
|
width: 88px;
|
height: 88px;
|
position: fixed;
|
right: 48px;
|
bottom: 48px;
|
border-radius: 50%;
|
background: #ffffff;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
color: #4B88F9;
|
font-size: 44px;
|
font-weight: bold;
|
}
|
</style>
|