whyczyk
2021-06-16 b8c196575ecb74ceaf557747d24c17fefd2853bb
实时监控电池告警
2个文件已修改
205 ■■■■■ 已修改文件
src/assets/js/realTime.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/realTime.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/realTime.js
@@ -224,3 +224,31 @@
        data: "json=" + JSON.stringify(params)
    });
}
/**
 * 电池组单体告警
 * @param json:{"dev_id":618500002}
 * @returns {AxiosPromise}
 */
export const BattRtAlarmActionGetInfo = (params) => {
    // 查询后台
    return axios({
        method: "post",
        url: "BattRtAlarmAction!getInfo",
        data: "json=" + JSON.stringify(params)
    });
}
/**
 * 电池组组端告警
 * @param json:{"dev_id":618500002}
 * @returns {AxiosPromise}
 */
export const BattRsAlarmActionGetInfo = (params) => {
    // 查询后台
    return axios({
        method: "post",
        url: "BattRsAlarmAction!getInfo",
        data: "json=" + JSON.stringify(params)
    });
}
src/pages/dataTest/realTime.vue
@@ -137,24 +137,24 @@
                                :drop-vol="diagram.dropVol"></circuit-diagram>
                        </el-tab-pane>
                        <el-tab-pane label="电压" name="vol">
                            <bar-chart ref="vol" id="vol" unit="V" :show-tools="true"
                                @right-click="chartRightCLick"></bar-chart>
                            <bar-chart ref="vol" id="vol" unit="V" :show-tools="true" @right-click="chartRightCLick">
                            </bar-chart>
                        </el-tab-pane>
                        <el-tab-pane label="内阻" name="res">
                            <bar-chart ref="res" id="res" unit="mΩ" :show-tools="true" max-color="red"
                                min-color="green" @right-click="chartRightCLick"></bar-chart>
                            <bar-chart ref="res" id="res" unit="mΩ" :show-tools="true" max-color="red" min-color="green"
                                @right-click="chartRightCLick"></bar-chart>
                        </el-tab-pane>
                        <el-tab-pane label="温度" name="temp">
                            <bar-chart ref="temp" id="temp" unit="℃" :show-tools="true" max-color="red"
                                min-color="green" @right-click="chartRightCLick"></bar-chart>
                        </el-tab-pane>
                        <el-tab-pane label="电导" name="conduct">
                            <bar-chart ref="conduct" id="conduct" :show-tools="true"
                                @right-click="chartRightCLick"></bar-chart>
                            <bar-chart ref="conduct" id="conduct" :show-tools="true" @right-click="chartRightCLick">
                            </bar-chart>
                        </el-tab-pane>
                        <el-tab-pane label="均衡电流" name="curr">
                            <bar-chart ref="curr" id="curr" unit="A" :show-tools="true"
                                @right-click="chartRightCLick"></bar-chart>
                            <bar-chart ref="curr" id="curr" unit="A" :show-tools="true" @right-click="chartRightCLick">
                            </bar-chart>
                        </el-tab-pane>
                        <el-tab-pane label="漏液电压" name="leakVol">
                            <bar-chart ref="leakVol" id="leakVol" unit="V" :show-tools="true"
@@ -166,6 +166,71 @@
                                <el-table-column v-for="header in table.headers" :key="header.prop" :prop="header.prop"
                                    :label="header.label" :width="header.width" align="center"></el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="电池告警" name="dianchigaojing" class="el-table-wrapper">
                            <div class="dianchigaojing">
                                <div class="borderBox box1">
                                    <el-table stripe size="small" :data="table1.datas" height="100%">
                                        <el-table-column prop="battGroupId" align="center" label="电池组ID">
                                        </el-table-column>
                                        <el-table-column prop="recordTime" align="center" label="记录时间">
                                        </el-table-column>
                                        <el-table-column prop="groupVolAlarm" align="center" label="组电压告警">
                                            <template slot-scope="scope">
                                                <!-- <img :src="eleOffImg" class="lampImg" v-if="scope.row.groupVolAlarm==0">
                                                <img :src="eleOffImg" class="lampImg" v-else> -->
                                                <hdw-light :type="scope.row.groupVolAlarm"></hdw-light>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="testEndVol" align="center" label="测试终止电压">
                                        </el-table-column>
                                        <el-table-column prop="testEndCap" align="center" label="测试终止剩余容量">
                                        </el-table-column>
                                        <el-table-column prop="testTimeLong" align="center" label="测试终止时间(秒)">
                                        </el-table-column>
                                    </el-table>
                                </div>
                                <div class="borderBox box2">
                                    <el-table stripe size="small" :data="table2.datas" height="100%">
                                        <el-table-column prop="battGroupId" align="center" label="电池组ID">
                                        </el-table-column>
                                        <el-table-column prop="recordTime" align="center" label="记录时间">
                                        </el-table-column>
                                        <el-table-column prop="monNum" align="center" label="单体编号">
                                        </el-table-column>
                                        <el-table-column prop="monVolAlarm" align="center" label="单体电压告警">
                                            <template slot-scope="scope">
                                                <hdw-light :type="scope.row.monVolAlarm"></hdw-light>
                                                <!-- <img :src="eleOffImg" class="lampImg" v-if="scope.row.monVolAlarm==0">
                                                <img :src="eleOffImg" class="lampImg" v-else> -->
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="monTempAlarm" align="center" label="单体温度告警">
                                            <template slot-scope="scope">
                                                <!-- <img :src="eleOffImg" class="lampImg" v-if="scope.row.monTempAlarm==0">
                                                <img :src="eleOffImg" class="lampImg" v-else> -->
                                                <hdw-light :type="scope.row.monTempAlarm"></hdw-light>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="monResAlarm" align="center" label="单体内阻告警">
                                            <template slot-scope="scope">
                                                <!-- <img :src="eleOffImg" class="lampImg" v-if="scope.row.monResAlarm==0">
                                                <img :src="eleOffImg" class="lampImg" v-else> -->
                                                <hdw-light :type="scope.row.monResAlarm"></hdw-light>
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="monRestCapAlarm" align="center" label="单体剩余容量告警">
                                            <template slot-scope="scope">
                                                <!-- <img :src="eleOffImg" class="lampImg"
                                                    v-if="scope.row.monRestCapAlarm==0">
                                                <img :src="eleOffImg" class="lampImg" v-else> -->
                                                <hdw-light :type="scope.row.monRestCapAlarm"></hdw-light>
                                            </template>
                                        </el-table-column>
                                    </el-table>
                                </div>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane label="逆变信息" name="niBianInfoTab" v-if="isNiBian">
                            <ni-bian-info-tab ref="niBianInfoTab" :name="acTabs" :devId="batt.FBSDeviceId">
@@ -247,7 +312,9 @@
    import NiBianInfoTab from "@/pages/dataTest/components/NiBianInfoTab";
    import {
        realTimeNot,
        realTimeAdd
        realTimeAdd,
        BattRtAlarmActionGetInfo,
        BattRsAlarmActionGetInfo
    } from "../../assets/js/realTime";
    import {
        realTimeSearch,
@@ -274,6 +341,7 @@
    import getMarkLineData from "@/components/chart/js/getMarkLineData";
    import BarChartThreeD from "@/components/chart/BarChartThreeD";
    import JggdInfoTab from './components/jggdInfoTab.vue';
    import HdwLight from '../dataMager/components/HdwLight.vue';
    /* import moment from "moment"; */
    let vol, resChart, temp, conduct, currChart, leakVol;
    let tblData = [];
@@ -296,6 +364,7 @@
            StopCuring,
            NiBianInfoTab,
            JggdInfoTab,
            HdwLight,
            // NiBianInfo,
        },
        watch: {
@@ -320,6 +389,8 @@
            let isCanTest = isHasPermit("batt_test_op_permit", permits);
            let stateList = const_61850.stateList;
            return {
                eleOffImg: require('../../assets/images/eleOff.png'),
                eleOnImg: require('../../assets/images/eleOn.png'),
                isCanTest: isCanTest,
                homeListShow: true,
                dev_version: "",
@@ -388,6 +459,27 @@
                        curr1: 0,
                        leakVol1: 0,
                    }, ],
                },
                table1: {
                    datas: [{
                        battGroupId: 0,
                        recordTime: 0,
                        groupVolAlarm: 0,
                        testEndVol: 0,
                        testEndCap: 0,
                        testTimeLong: 0,
                    }],
                },
                table2: {
                    datas: [{
                        battGroupId: 0,
                        recordTime: 0,
                        monNum: 0,
                        monVolAlarm: 0,
                        monTempAlarm: 0,
                        monResAlarm: 0,
                        monRestCapAlarm: 0,
                    }],
                },
                batt: {},
                stateListShow: true,
@@ -755,6 +847,27 @@
                    // 设置表格的数据
                    if (this.acTabs == "tblData") {
                        this.table.datas = tblData;
                    } else if (this.acTabs == "dianchigaojing") {
                        let postData = {
                            battGroupId: this.batt.BattGroupId
                        }
                        BattRtAlarmActionGetInfo(postData).then((res) => {
                            let rs = JSON.parse(res.data.result);
                            if (rs.code == 1) {
                                this.table2.datas = rs.data
                            }
                        }).catch((err) => {
                            console.log(err)
                        });
                        BattRsAlarmActionGetInfo(postData).then((res) => {
                            let rs = JSON.parse(res.data.result);
                            if (rs.code == 1) {
                                console.log(rs.data)
                                this.table1.datas = rs.data
                            }
                        }).catch((err) => {
                            console.log(err)
                        });
                    }
                });
            },
@@ -1914,7 +2027,9 @@
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    inputType: 'password',
                }).then(({value})=>{
                }).then(({
                    value
                }) => {
                    if(value == resetPwd) {
                        let loading = this.$layer.loading();
                        this.$apis.outline.restart(batt.FBSDeviceId).then(res=>{
@@ -1935,6 +2050,17 @@
                });
            },
            changeSkin() {
                this.$nextTick(() => {
                    if (this.skinActive == 'science-black') {
                        this.eleOffImg = require('../../assets/images/eleOff-black.png');
                        this.eleOnImg = require('../../assets/images/eleOn-black.png');
                    } else {
                        this.eleOffImg = require('../../assets/images/eleOff.png');
                        this.eleOnImg = require('../../assets/images/eleOn.png');
                    }
                })
            }
        },
        computed: {
            battFullName() {
@@ -2036,6 +2162,14 @@
                let batt = this.batt;
                return regEquipType(batt.FBSDeviceId, 'BTS9110');
            }
        },
        created() {
            this.skinActive = localStorage.getItem('setSkinItem');
            window.parent.addEventListener('setSkinItem', (e) => {
                this.skinActive = e.newValue;
                this.changeSkin();
            });
            this.changeSkin();
        },
        mounted() {
            let BattGroupId = this.$route.params.BattGroupId;
@@ -2234,4 +2368,27 @@
        flex: 1;
        overflow: hidden;
    }
    .dianchigaojing {
        padding: 5px;
        height: 100%;
    }
    .dianchigaojing .borderBox {
        border: 1px solid #00fefe;
        padding: 5px;
    }
    .dianchigaojing .borderBox.box1 {
        margin-bottom: 5px;
        height: 110px;
    }
    .dianchigaojing .borderBox.box2 {
        height: calc(100% - 140px);
    }
    .lampImg {
        height: 28px;
    }
</style>