whychdw
2019-08-19 67d28766d72edc9bc6a1d1b39d020118c4c23acf
实时数据提交
5个文件已修改
1个文件已添加
709 ■■■■■ 已修改文件
public/index.html 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/common.css 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/battInfo.js 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/libs/common.js 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/monitor/realTime.vue 377 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html
@@ -5,7 +5,12 @@
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>ld9</title>
    <title>蓄电池监控平台</title>
    <!-- 导入百度地图API -->
    <link rel="stylesheet" href="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css" />
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=QAerSFEiGDCx1oHPB7Z5XYcBHI6R3qwx"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
    <script type="text/javascript" src="http://unpkg.com/inmap/dist/inmap.min.js"></script>
  </head>
  <body class="science-page">
    <noscript>
src/assets/css/common.css
@@ -232,3 +232,36 @@
.ivu-spin-fix {
    background-color: rgba(255,255,255,.5);
}
/* ivu-table */
.ivu-table .table-info-cell {
    background-color: #187;
    color: #fff;
}
.ivu-table .table-number-cell {
    background-color: #dcdee2;
    color: #000000;
}
.ivu-table .table-error-cell {
    background-color: #ed4014;
    color: #fff;
}
.ivu-table .table-success-cell {
    background-color: #19be6b;
    color: #fff;
}
.ivu-table .table-warning-cell {
    background-color: #ff9900;
    color: #fff;
}
/* ivu-table special */
.ivu-table .table-tmp-high-cell {
    background-color: #ed4014;
    color: #fff;
}
.ivu-table .table-tmp-low-cell {
    background-color: #19be6b;
    color: #fff;
}
src/assets/js/battInfo.js
New file
@@ -0,0 +1,108 @@
var battstate=['未知','浮充','充电','放电','均充'];
function getBattstate(state){
    //console.info(state);
    var str="";
    switch(state){
        case 1:str = battstate[1];break;
        case 2:str = battstate[2];break;
        case 3:str = battstate[3];break;
        case 4:str = battstate[4];break;
        default:str = battstate[0];
    }
    return str;
}
// 开关状态的判断
function BTSCircle(batt, model, mygraph, callback) {
    var lasttype = mygraph.graphtype;
    var _str = "";
    if(model.code == 1) {
        var data = model.data[0];
        var alarmstatus = data.dev_alarmstate;    //[0:'无',1:'暂停',2:'放电测试',3:'放电等待',4:'限流充电',5:'直流充电',6:'充电等待',7:'测试时间到',8:'测试容量到',9:'单体下限到',10:'组端下限到',11:'市电异常',12:'存储卡不足',13:'负载温度高',14:'电流异常',15:'远程通信坏',16:'负载通信坏',17:'选择通信坏',18:'负载电流坏',19:'内存申请坏',20:'未知'];
        var workstatus =parseInt(data.dev_workstate) ;    //[0:'在线监测',1:'放电测试',2:'充电测试',3:'内阻测试',4:'未知'];
        if(typeof callback == 'function') {
            callback.call({}, data);
        }
        // 判断workstatus
        switch(workstatus) {
            case 0:    {    // 浮充状态
                mygraph.graphtype = 0;
                _str = '(开关闭合)';
                if(mygraph.battstate == 3){
                    mygraph.graphtype = 1;
                    _str = '(开关断开)';                                //停电放电的情况
                }
                // 当前设备是BTS设备
                if(data.dev_res_test_state != 0) {
                    _str += '(内阻测试)';
                }
            }
            break;
            case 1:{ // 放电测试
                if(data.dev_testgroupnum>0 && (data.dev_testgroupnum == (batt.GroupIndexInFBSDevice+1))){
                    mygraph.graphtype = 1;
                    _str = '(开关断开)';
                }else{
                    if(mygraph.battstate == 3){
                        mygraph.graphtype = 1;
                        _str = '(开关断开)';
                    }else{
                        mygraph.graphtype = 0;
                        _str = '(开关闭合)';
                    }
                }
                // 当前设备是BTS设备
                if(data.dev_testtype == 81) {
                    _str += '(KD测试)';
                    mygraph.graphtype = 5;
                }
            }
            break;
            case 2: {
                //辨别当前电池组是否在充电
                if(mygraph.battstate == 2 || ((data.dev_testgroupnum >0) && data.dev_testgroupnum == (batt.GroupIndexInFBSDevice+1))){
                    //充电
                    if(alarmstatus == 1 || alarmstatus == 2 || alarmstatus == 3 || alarmstatus == 4 || alarmstatus == 6){
                        //限流充电      -->常闭接触器断开
                        mygraph.graphtype = 2;
                        _str = '(开关断开)';
                    }else{
                        //直流充电     -->常闭接触器闭合
                        mygraph.graphtype = 3 ;
                        _str = '(开关闭合)';
                    }
                }else{
                    mygraph.graphtype = 0;
                    _str = '(开关闭合)';
                }
            }
            break;
            default:{
                //未知
                mygraph.graphtype = 4 ;
                _str = '(未知)';
            }
            break;
        }
    }else {
        mygraph.graphtype = 4 ;
        _str = '(未连接)';
        // 回调函数
        if(typeof callback == 'function') {
            callback();
        }
    }
    // 判断是否更新拓扑图
    if(lasttype != mygraph.graphtype){
        mygraph.ischange = 1;
    }
    //console.log(mygraph);
    return _str;
}
export {
    getBattstate
}
src/libs/common.js
@@ -80,6 +80,25 @@
    var newArray = arr.join(",").split(",");
    return Math.min.apply({},newArray);
}
/*从多维数组中获取和*/
function getSumFromArr (arr) {
    var newArray = arr.join(",").split(",");
    var sum =0;
    for(var i=0; i<newArray.length; i++) {
        var _newArray = newArray[i];
        sum += Number(_newArray);
    }
    return sum;
}
/*从多维数组中获取平均值*/
function getAvgFromArr (arr) {
    var avg = 0;
    if(arr.length !=0) {
        var sum = getSumFromArr(arr);
        avg = sum/arr.length;
    }
    return avg;
}
function ajax(option) {
    $.ajax({
@@ -167,6 +186,138 @@
    return format;
};
function Title(){
    this.min=0;                //最小值
    this.max=0;                //最大值
    this.avg=0;                //平均值
    this.sum=0;                //总和
    this.ahight=0;            //高告警阀值
    this.alow=0;            //低告警阀值
    this.clow=0;            //次低更换阀值
    this.lc=0;                //低告警单体数
    this.lp=0;                //低告警百分比
}
function createTitle(){
    var obj=new Object();
    obj.min=0;
    obj.max=0;
    obj.avg=0;
    obj.sum=0;
    obj.ahight=0;
    obj.alow=0;
    obj.clow=0;
    obj.lc=0;
    obj.lp=0;
    return obj;
}
Title.prototype.setMin=function(min){
    this.min=min;
};
Title.prototype.getMin=function(){
    return this.min;
};
Title.prototype.setMax=function(max){
    this.max=max;
};
Title.prototype.getMax=function(){
    return this.max;
};
Title.prototype.setAvg=function(avg){
    this.avg=avg;
};
Title.prototype.getAvg=function(){
    return this.avg;
};
Title.prototype.setSum=function(sum){
    this.sum=sum;
};
Title.prototype.getSum=function(){
    return this.sum;
};
Title.prototype.setAhight=function(ahight){
    this.ahight=ahight;
};
Title.prototype.getAhight=function(){
return this.ahight;
};
Title.prototype.setAlow=function(alow){
    this.alow=alow;
};
Title.prototype.getAlow=function(){
    return this.alow;
};
Title.prototype.setClow=function(clow){
    this.clow=clow;
};
Title.prototype.getClow=function(){
    return this.clow;
};
Title.prototype.setLc=function(lc){
    this.lc=lc;
};
Title.prototype.getLc=function(){
    return this.lc;
};
Title.prototype.setLp=function(lp){
    this.lp=lp;
};
Title.prototype.getLp=function(){
    return lp;
};
Title.prototype.getAllTile=function(lname){
    //alert(this.avg);
    var title="";
    var maxText='最大值';            //最大值
    var minText='最小值';            //最小值
    var avgText='平均值';             //平均值
    var lowText='落后值';            //落后值
    var lcText='落后数量';                //落后数量
    var lpText='落后数量比';             //落后数量比
    if("Voltage"==lname){
        //title=maxText+"="+(parseFloat(this.max).toFixed(3))+"V;"+minText+"="+(parseFloat(this.min).toFixed(3))+"V;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"V;"+lowText+"="+this.alow+"V;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+(parseFloat(this.max).toFixed(3))+"V;"+minText+"="+(parseFloat(this.min).toFixed(3))+"V;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"V;累加和="+(parseFloat(this.sum).toFixed(3))+"V";
    }else if("Resistance"==lname){
        //title=maxText+"="+(parseFloat(this.max).toFixed(3))+"mΩ;"+minText+"="+(parseFloat(this.min).toFixed(3))+"mΩ;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"mΩ;"+lowText+"="+this.alow+"mΩ;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+(parseFloat(this.max).toFixed(3))+"mΩ;"+minText+"="+(parseFloat(this.min).toFixed(3))+"mΩ;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"mΩ";
    }else if("Temperature"==lname){
        //title=maxText+"="+(parseFloat(this.max).toFixed(1))+"℃;"+minText+"="+(parseFloat(this.min).toFixed(1))+"℃;"+avgText+"="+(parseFloat(this.avg).toFixed(1))+"℃;"+lowText+"="+this.alow+"℃;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+(parseFloat(this.max).toFixed(1))+"℃;"+minText+"="+(parseFloat(this.min).toFixed(1))+"℃;"+avgText+"="+(parseFloat(this.avg).toFixed(1))+"℃";
    }else if("Conductance"==lname){
        //title=maxText+"="+(parseFloat(this.max).toFixed(0))+";"+minText+"="+(parseFloat(this.min).toFixed(0))+";"+avgText+"="+(parseFloat(this.avg).toFixed(0))+";"+lowText+"="+this.alow+";"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+(parseFloat(this.max).toFixed(0))+";"+minText+"="+(parseFloat(this.min).toFixed(0))+";"+avgText+"="+(parseFloat(this.avg).toFixed(0));
    }else if("MonJHCurr"==lname){
        //title=maxText+"="+(parseFloat(this.max).toFixed(3))+"V;"+minText+"="+(parseFloat(this.min).toFixed(3))+"V;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"V;"+lowText+"="+this.alow+"V;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+(parseFloat(this.max).toFixed(3))+"mA;"+minText+"="+(parseFloat(this.min).toFixed(3))+"mA;"+avgText+"="+(parseFloat(this.avg).toFixed(3))+"mA";
    }else if("Serpercent"==lname || "Percent_total_capacity" == lname){
        //title=maxText+"="+this.max+"%;"+minText+"="+this.min+"%;"+avgText+"="+this.avg+"%;"+lowText+"="+this.alow+"%;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+this.max+"%;"+minText+"="+this.min+"%;"+avgText+"="+this.avg+"%";
    }else if("Actual_capacity"==lname || "Residual_capacity" == lname){
        //title=maxText+"="+(parseFloat(this.max).toFixed(0))+"AH;"+minText+"="+(parseFloat(this.min).toFixed(0))+"AH;"+avgText+"="+(parseFloat(this.avg).toFixed(0))+"AH;"+lowText+"="+this.alow+"AH;"+lcText+"="+this.lc+";"+lpText+"="+this.lp+"%";
        title=maxText+"="+(parseFloat(this.max).toFixed(0))+"AH;"+minText+"="+(parseFloat(this.min).toFixed(0))+"AH;"+avgText+"="+(parseFloat(this.avg).toFixed(0))+"AH";
    }
    return title;
};
export {
    CORS,           //  跨域请求内容
    Interval,       // 计时器
@@ -175,4 +326,7 @@
    getMinFromArr,   // 获取数组中的最小值
    ajax,            // 请求
    formatSeconds,   // 将秒转化成时:分:秒
    Title,
    getSumFromArr,   // 获取累加和
    getAvgFromArr,   // 获取平均值
}
src/views/index.vue
@@ -1,10 +1,34 @@
<template>
    <div class="view-root">
    <div class="view-root" style="padding: 0">
        <div class="view-root-inner">
            <div id="allmap"></div>
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            inmap: '',
        }
    },
    mounted: function() {
        var _self = this;
        // 初始化地图
        this.inmap = new inMap.Map({
            id: "allmap",
            center: ["114.30419679", "30.57780611"],
            zoom: {
                value: 11,
                show: false,
                max: 22
            }
        });
    },
}
</script>
<style scoped>
    #allmap {
        height: 100%;
    }
</style>
src/views/monitor/realTime.vue
@@ -15,26 +15,27 @@
                        </Spin>
                        <content-title :title="contentTitle"></content-title>
                        <square-box style="margin: 8px" title="实时图谱" icon="ios-podium">
                            <Tabs value="monVolBar" class="ivu-tabs-yellow" name="controlTabs">
                                <TabPane label="电压" name="monVolBar" tab="controlTabs">
                            <Tabs value="monVol" class="ivu-tabs-yellow" name="controlTabs" @on-click="handlerTabClick">
                                <TabPane label="电压" name="monVol" tab="controlTabs">
                                    <bar-chart height="400px" ref="monVolBar" :show-value=true :range="{'min': 0,'max': 1}"></bar-chart>
                                </TabPane>
                                <TabPane label="内阻" name="name2" tab="controlTabs">
                                <TabPane label="内阻" name="monRes" tab="controlTabs">
                                    <bar-chart height="400px" ref="monResBar" :show-value=true :range="{'min': 0,'max': 1}"></bar-chart>
                                </TabPane>
                                <TabPane label="温度" name="name3" tab="controlTabs">
                                <TabPane label="温度" name="monTmp" tab="controlTabs">
                                    <bar-chart height="400px" ref="monTmpBar" :colors="{normal: '#5cadff',max: '#ed4014',min: '#19be6b',}" :show-value=true :range="{'min': 0,'max': 1}"></bar-chart>
                                </TabPane>
                                <TabPane label="电导" name="name4" tab="controlTabs">
                                <TabPane label="电导" name="monSer" tab="controlTabs">
                                    <bar-chart height="400px" ref="monSerBar" :show-value=true :range="{'min': 0,'max': 1}"></bar-chart>
                                </TabPane>
                            </Tabs>
                        </square-box>
                        <table style="width: 100%; vertical-algin: top">
                        <table style="width: 99%; vertical-align: top">
                            <tr>
                                <td style="width: 500px;" valign="top">
                                    <square-box style="margin: 8px" minHeight="250px" title="机房基础信息">
                                        <table style="color: #468FB6">
                                <td valign="top">
                                    <div style="width: 300px"></div>
                                    <square-box style="margin: 8px;" minHeight="250px" title="机房基础信息">
                                        <table style="color: #468FB6;">
                                            <tr>
                                                <td>电池状态:</td>
                                                <td>{{rtState.ele_state}}</td>
@@ -71,7 +72,9 @@
                                    </square-box>
                                </td>
                                <td valign="top">
                                    <square-box style="margin: 8px" minHeight="250px" title="图谱数据信息" icon="md-grid"></square-box>
                                    <square-box style="margin: 8px" minHeight="250px" title="图谱数据信息" icon="md-grid">
                                        <Table border :columns="tbl.columns" :data="tbl.data" height="215"></Table>
                                    </square-box>
                                </td>
                            </tr>
                        </table>
@@ -86,7 +89,10 @@
import HomeTree from "../../components/HomeTree"
import ContentTitle from "../../components/ContentTitle"
import BarChart from "../../components/BarChart"
import {ajax, formatSeconds, sethoubeiTime, Timeout} from "../../libs/common"
import {ajax, formatSeconds, sethoubeiTime,
        Timeout, getMaxFromArr, getMinFromArr,
        Title, getSumFromArr, getAvgFromArr} from "../../libs/common"
import {getBattstate, BTSCircle} from '../../assets/js/battInfo'
import $ from 'jquery'
import echarts from "echarts"
import SquareBox from "../../components/SquareBox"
@@ -107,6 +113,14 @@
            rtDataTime: new Timeout(),        // 实时数据计时器
            rtStateTime: new Timeout(),       // 实时状态计时器
            spinShow: false,
            activeTab: 'monVol',
            mygraph: {
                battstate:0,
                graphtype:0,            //拓扑图类型    0->浮充       1->放电       2->稳流(限流)充电     3->直流(直连)充电        4->未知(未连接)
                group_vol:"0V",            //组端电压值
                online_vol:"0V",            //在线电压值
                ischange:1,                //是否重新绘制,        0:不需要重新绘制              1:需要重新绘制
            },
            rtState: {
                ele_state: '未知',
                ele_tension: '在线:??V;组端:??V',
@@ -119,7 +133,12 @@
            },
            options: {
                monVol:{    // 单体电压
                    title: new Title(),
                    option: {
                        title: {
                            subtext: '',
                            x: 'center',
                        },
                        xAxis: {
                            type: 'category',
                            data: []
@@ -138,7 +157,12 @@
                    }
                },
                monRes: {   // 单体内阻
                    title: new Title(),
                    option: {
                        title: {
                            subtext: '',
                            x: 'center',
                        },
                        xAxis: {
                            type: 'category',
                            data: []
@@ -157,7 +181,12 @@
                    }
                },
                monTmp: {   // 单体内阻
                    title: new Title(),
                    option: {
                        title: {
                            subtext: '',
                            x: 'center',
                        },
                        xAxis: {
                            type: 'category',
                            data: []
@@ -176,7 +205,12 @@
                    }
                },
                monSer: {   // 单体内阻
                    title: new Title(),
                    option: {
                        title: {
                            subtext: '',
                            x: 'center',
                        },
                        xAxis: {
                            type: 'category',
                            data: []
@@ -194,16 +228,191 @@
                    }
                }
            },
            tbls: {
                monVol: {
                    title: ''
                }
            tbl:{
                columns:[],
                data: []
            },
            tblDatas:{
                monVol: [],
                monRes: [],
                monSer: [],
                monTmp: [],
            }
        }
    },
    methods: {
        getBatt: function() {
            return this.batt;
        },
        handlerTabClick: function(name) {
            this.activeTab = name;
            var batt = this.getBatt();
            this.setTbl();
        },
        setTbl: function() {        // 设置显示表格的数据
            var name = this.activeTab;
            var tblDatas = this.tblDatas;
            var columns = {
                monVol: [       // 单体电压
                    {
                        title: '编号',
                        key: 'num1'
                    },
                    {
                        title: '电压(V)',
                        key: 'num2'
                    },
                    {
                        title: '编号',
                        key: 'num3'
                    },
                    {
                        title: '电压(V)',
                        key: 'num4'
                    },
                    {
                        title: '编号',
                        key: 'num5'
                    },
                    {
                        title: '电压(V)',
                        key: 'num6'
                    },
                    {
                        title: '编号',
                        key: 'num7'
                    },
                    {
                        title: '电压(V)',
                        key: 'num8'
                    },
                ],
                monRes: [       // 单体电压
                    {
                        title: '编号',
                        key: 'num1'
                    },
                    {
                        title: '内阻(mΩ)',
                        key: 'num2'
                    },
                    {
                        title: '编号',
                        key: 'num3'
                    },
                    {
                        title: '内阻(mΩ)',
                        key: 'num4'
                    },
                    {
                        title: '编号',
                        key: 'num5'
                    },
                    {
                        title: '内阻(mΩ)',
                        key: 'num6'
                    },
                    {
                        title: '编号',
                        key: 'num7'
                    },
                    {
                        title: '内阻(mΩ)',
                        key: 'num8'
                    },
                ],
                monTmp: [       // 单体温度
                    {
                        title: '编号',
                        key: 'num1'
                    },
                    {
                        title: '温度(℃)',
                        key: 'num2'
                    },
                    {
                        title: '编号',
                        key: 'num3'
                    },
                    {
                        title: '温度(℃)',
                        key: 'num4'
                    },
                    {
                        title: '编号',
                        key: 'num5'
                    },
                    {
                        title: '温度(℃)',
                        key: 'num6'
                    },
                    {
                        title: '编号',
                        key: 'num7'
                    },
                    {
                        title: '温度(℃)',
                        key: 'num8'
                    },
                ],
                monSer: [       // 单体温度
                    {
                        title: '编号',
                        key: 'num1'
                    },
                    {
                        title: '电导',
                        key: 'num2'
                    },
                    {
                        title: '编号',
                        key: 'num3'
                    },
                    {
                        title: '电导',
                        key: 'num4'
                    },
                    {
                        title: '编号',
                        key: 'num5'
                    },
                    {
                        title: '电导',
                        key: 'num6'
                    },
                    {
                        title: '编号',
                        key: 'num7'
                    },
                    {
                        title: '电导',
                        key: 'num8'
                    },
                ],
            };
            var column = [];
            var data = [];
            switch(name){
                case 'monVol':      // 单体电压
                  column = columns.monVol;
                  data = $.extend(true, [], tblDatas.monVol);
                break;
                case 'monRes':      // 单体内阻
                    column = columns.monRes;
                    data = $.extend(true, [], tblDatas.monRes);
                break;
                case 'monTmp':   // 单体温度
                    column = columns.monTmp;
                    data =  $.extend(true, [], tblDatas.monTmp);
                break;
                case 'monSer':  // 单体电导
                    column = columns.monSer;
                    data =  $.extend(true, [], tblDatas.monSer);
                break;
            }
            // console.log(column);
            this.tbl.columns = column;
            this.tbl.data = data;
        },
        handlerSelectChange: function(item) {   // 处理左侧机房列表点击事件
            var self = this;
@@ -261,7 +470,7 @@
        },
        searchRtData: function() {    // 查询电池组实时信息
            var self = this;
            var batt = this.batt;
            var batt = this.getBatt();
            if(!batt.BattGroupId) {
                return;
            }
@@ -304,7 +513,7 @@
            var mon_serpcent_list=new Array();
            var mon_jh_list = new Array();
            var batt = this.getBatt();
            //console.info(battinlist);
            // console.info(Rtdatalist);
            for(var i=0;i<Rtdatalist.length;i++){
                mon_vol_table_list.push("#"+Rtdatalist[i].mon_num);
                mon_vol_table_list.push(Rtdatalist[i].mon_vol.toFixed(3));
@@ -336,28 +545,142 @@
                mon_jh_list[i] = Rtdatalist[i].mon_JH_curr.toFixed(3);
            }
            // 设置表格的所有数据
            this.setTblDatas(mon_vol_table_list, mon_res_table_list, mon_tmp_table_list, mon_ser_table_list)
            // 设置显示表格的数据
            this.setTbl();
            // 设置单体电压图谱的配置项
            this.setOptions(mon_num_list, mon_vol_list, mon_res_list, mon_tmp_list, mon_ser_list);
        },
        // 单体电压,单体内阻, 单体温度, 电导
        setTblDatas: function(mon_vol, mon_res, mon_tmp, mon_ser) {
            // console.log(mon_vol);
            var tblDatas = this.tblDatas;
            tblDatas.monVol = this.formateTblData(mon_vol);
            tblDatas.monRes = this.formateTblData(mon_res);
            tblDatas.monTmp = this.formateTblData(mon_tmp, {
                max: 'table-tmp-high-cell',
                min: 'table-tmp-low-cell',
            });
            tblDatas.monSer = this.formateTblData(mon_ser);
        },
        formateTblData: function(data, classes) {
            var result = [];
            var values = [];
            var default_colors = {
                max: 'table-success-cell',
                min: 'table-error-cell',
            };
            classes = $.extend({}, default_colors, classes||{});
            for(var i=0; i<data.length; i+=8) {
                var tmp = {};
                tmp.cellClassName = {
                    num1: 'table-number-cell',
                    num3: 'table-number-cell',
                    num5: 'table-number-cell',
                    num7: 'table-number-cell',
                };
                for(var k=1;k<9; k++) {
                    var num = k+i;
                    // 超出界限
                    if(num-1>=data.length) {
                        break;
                    }
                    var key;
                    var key2 = num%2;
                    var key8 = num%8;
                    if(key8 == 0) {
                        key8 = 8;
                    }
                    key = 'num'+key8;
                    if(key2 == 0) {
                       values.push(data[num-1]);
                    }
                    tmp[key] = data[num-1];
                }
                result.push(tmp);
            }
            // 设置最大值和最小值
            var min = getMinFromArr(values);
            var max = getMaxFromArr(values);
            var keys = [2, 4, 6, 8];
            for(var i=0; i<result.length; i++) {
                var _result = result[i];
                for(var k=0; k<keys.length; k++) {
                    var key = 'num'+keys[k];
                    if(_result[key] >= max) {
                        _result.cellClassName[key] = classes.max;
                    }else if(_result[key] <= min) {
                        _result.cellClassName[key] = classes.min;
                    }
                }
            }
            // console.log(result);
            return result;
        },
        // 单体编号,单体电压,单体内阻, 单体温度, 电导
        setOptions: function(mon_num_list, mon_vol_list, mon_res_list, mon_tmp_list, mon_ser_list) {
            var options = this.options;
            // 单体电压设置
            options.monVol.option.xAxis.data = mon_num_list;
            options.monVol.option.series[0].data = mon_vol_list;
            var title = options.monVol.title;
            var min = getMinFromArr(mon_vol_list);
            var max = getMaxFromArr(mon_vol_list);
            var sum = getSumFromArr(mon_vol_list);
            var avg = getAvgFromArr(mon_vol_list);
            title.setMax(max);
            title.setMin(min);
            title.setAvg(avg);
            title.setSum(sum);
            var allTitle = title.getAllTile('Voltage');
            options.monVol.option.title.subtext = allTitle;
            // 单体内阻设置
            options.monRes.option.xAxis.data = mon_num_list;
            options.monRes.option.series[0].data = mon_res_list;
            var title = options.monRes.title;
            var min = getMinFromArr(mon_res_list);
            var max = getMaxFromArr(mon_res_list);
            var sum = getSumFromArr(mon_res_list);
            var avg = getAvgFromArr(mon_res_list);
            title.setMax(max);
            title.setMin(min);
            title.setAvg(avg);
            title.setSum(sum);
            var allTitle = title.getAllTile('Resistance');
            options.monRes.option.title.subtext = allTitle;
            // 单体温度
            options.monTmp.option.xAxis.data = mon_num_list;
            options.monTmp.option.series[0].data = mon_tmp_list;
            var title = options.monTmp.title;
            var min = getMinFromArr(mon_tmp_list);
            var max = getMaxFromArr(mon_tmp_list);
            var sum = getSumFromArr(mon_tmp_list);
            var avg = getAvgFromArr(mon_tmp_list);
            title.setMax(max);
            title.setMin(min);
            title.setAvg(avg);
            title.setSum(sum);
            var allTitle = title.getAllTile('Temperature');
            options.monTmp.option.title.subtext = allTitle;
            // 单体电导
            options.monSer.option.xAxis.data = mon_num_list;
            options.monSer.option.series[0].data = mon_ser_list;
            var title = options.monSer.title;
            var min = getMinFromArr(mon_ser_list);
            var max = getMaxFromArr(mon_ser_list);
            var sum = getSumFromArr(mon_ser_list);
            var avg = getAvgFromArr(mon_ser_list);
            title.setMax(max);
            title.setMin(min);
            title.setAvg(avg);
            title.setSum(sum);
            var allTitle = title.getAllTile('Conductance');
            options.monSer.option.title.subtext = allTitle;
            this.updateGraph();
        },
@@ -374,6 +697,20 @@
            // 更新单体电导
            this.$refs['monSerBar'].setOption(this.options.monSer.option);
        },
        // 图谱更改大小
        resizeGraph: function() {
            // 更新单体电压
            this.$refs['monVolBar'].resize();
            // 更新单体内阻
            this.$refs['monResBar'].resize();
            // 更新单体温度
            this.$refs['monTmpBar'].resize();
            // 更新单体电导
            this.$refs['monSerBar'].resize();
        },
        searchRtState: function() {
            var self = this;
@@ -399,6 +736,7 @@
                        var online_vol = rtstate.online_vol.toFixed(2);
                        var group_vol = rtstate.group_vol.toFixed(2);
                        var opts = {};
                        opts.ele_state = getBattstate(rtstate.batt_state);
                        opts.ele_tension = "在线:"+online_vol+"V;组端:"+group_vol+"V";  // 组端电压
                        opts.ele_current = rtstate.group_curr.toFixed(2)+"A";       // 电池电流
                        opts.test_date = rtstate.rec_datetime;          // 更新日期
@@ -445,7 +783,8 @@
        }
    },
    mounted: function() {
        // 默认选中单体电压
        this.handlerTabClick('monVol');
    },
    destroyed: function() {
        this.rtDataTime.stop();