whychdw
2019-11-26 1b3ca6be40bcfea4f90b1e1824fa7df0febe31d7
提交内容
14个文件已修改
3100 ■■■■■ 已修改文件
platforms/android/app/src/main/assets/www/css/common.css 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/index.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/batt-info-set/batt-info-set.html 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/batt-info-set/batt-info-set.js 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/main/main.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js 1358 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/css/common.css 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/index.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/batt-info-set/batt-info-set.html 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/batt-info-set/batt-info-set.js 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/main/main.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/monitor-data/monitor-data.js 1358 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/css/common.css
@@ -104,4 +104,9 @@
}
.el-drawer__header .heading {
    text-align: center;
}
/* input */
.el-input__inner {
    border: 1px solid #ccc;
}
platforms/android/app/src/main/assets/www/index.html
@@ -17,16 +17,16 @@
    </div>
    <link rel="stylesheet" href="css/iconfont/iconfont.css">
    <link rel="stylesheet" href="css/element-ui/theme-chalk/index.css">
    <link rel="stylesheet" href="css/common.css?1d97b0c3ce">
    <link rel="stylesheet" href="css/common.css?ac7b5a4318">
    <script src="js/zepto.js"></script>
    <script src="js/bui.js"></script>
    <script src="js/common_functions.js?7a37f1e251"></script>
    <script src="js/vue.min.js"></script>
    <script src="css/element-ui/index.js?12fd3b4c55"></script>
    <script src="css/element-ui/index.js?3c8cb8a2a5"></script>
    <script src="js/componets.js?4dacdaa4ab"></script>
    <script src="css/highchart/highcharts.js"></script>
    
    <script src="index.js?12fd3b4c55"></script>
    <script src="index.js?3c8cb8a2a5"></script>
</body>
</html>
platforms/android/app/src/main/assets/www/index.js
@@ -10,6 +10,11 @@
        hash: true
    });
    window.onresize = function () {
        // 重新设置路由宽高
        router.resize();
    };
    // 绑定事件
    bind();
platforms/android/app/src/main/assets/www/pages/batt-info-set/batt-info-set.html
@@ -9,31 +9,128 @@
    </header>
    <main>
        <el-table border stripe size="mini" header-row-class-name="header-primary" height="100%" :data="tbl.data">
            <el-table-column prop="num" align="center" label="电池组编号">
            <el-table-column prop="num" align="center" width="180" label="电池组编号">
            </el-table-column>
            <el-table-column prop="BattGroupName" align="center" label="电池组名称">
            <el-table-column prop="BattGroupName" align="center" width="180" label="电池组名称">
            </el-table-column>
            <el-table-column prop="MonCount" align="center" label="单体个数">
            <el-table-column prop="MonCount" align="center" width="180" label="单体个数">
            </el-table-column>
            <el-table-column prop="MonCapStd" align="center" label="单体标称容量(AH)">
            <el-table-column prop="MonCapStd" align="center" width="180" label="标称容量(AH)">
            </el-table-column>
            <el-table-column prop="MonVolStd" align="center" label="单体标称电压(V)">
            <el-table-column prop="MonVolStd" align="center" width="180" label="标称电压(V)">
            </el-table-column>
            <el-table-column prop="station_install" align="center" label="安装状态">
            <el-table-column prop="MonResStd" align="center" width="180" label="标称内阻(mΩ)">
            </el-table-column>
            <el-table-column prop="MonTmpStd" align="center" width="180" label="标称温度(℃)">
            </el-table-column>
            <el-table-column prop="station_install" align="center" width="120" label="安装状态">
                <template slot-scope="scope">
                    <el-button size="mini" :type="scope.row.station_install==1?'success':''">
                        {{scope.row.station_install==1?'已安装':'未安装'}}
                    </el-button>
                </template>
            </el-table-column>
            <el-table-column align="center" width="150" label="操作">
            <el-table-column align="center" width="150" fixed="right" label="操作">
                <template slot-scope="scope">
                    <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div id="dialogCenter" class="bui-dialog" style="display:none">
            <div class="bui-dialog-head">电池参数设置</div>
            <div class="bui-dialog-main">
                <div class="bui-fluid-space">
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">电池组名称:</span>
                            <el-input v-model="battInfo.data.BattGroupName1" placeholder="请输入电池组名称" size="small" @focus="showDetail(battInfo.data.BattGroupName1, 'BattGroupName1', '电池组名称:')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体个数:</span>
                            <el-input v-model="battInfo.data.MonCount" type="number" placeholder="请输入单体个数" size="small" @focus="showDetail(battInfo.data.MonCount, 'MonCount', '单体个数:', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">浮充电流(A):</span>
                            <el-input v-model="battInfo.data.BattFloatCurrent" type="number" placeholder="请输入浮充电流" size="small" @focus="showDetail(battInfo.data.BattFloatCurrent, 'BattFloatCurrent', '浮充电流(A):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称容量(AH):</span>
                            <el-input v-model="battInfo.data.MonCapStd" type="number" placeholder="请输入单体标称容量" size="small" @focus="showDetail(battInfo.data.MonCapStd, 'MonCapStd', '单体标称容量(AH):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称电压(V):</span>
                            <el-input v-model="battInfo.data.MonVolStd" type="number" placeholder="请输入标称电压" size="small" @focus="showDetail(battInfo.data.MonVolStd, 'MonVolStd', '单体标称电压(V):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称内阻(mΩ):</span>
                            <el-input v-model="battInfo.data.MonVolStd" type="number" placeholder="请输入标称内阻" size="small" @focus="showDetail(battInfo.data.MonResStd, 'MonResStd', '单体标称内阻(mΩ):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称温度(℃):</span>
                            <el-input v-model="battInfo.data.MonTmpStd" type="number" placeholder="请输入标称温度" size="small" @focus="showDetail(battInfo.data.MonTmpStd, 'MonTmpStd', '单体标称温度(℃):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称温度(℃):</span>
                            <el-select :disabled="battInfo.data.num == 1" v-model="battInfo.data.station_install" size="small" placeholder="请选择">
                                <el-option key="0" label="未安装" :value="0">
                                </el-option>
                                <el-option key="1" label="已安装" :value="1">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bui-dialog-foot">
                <div class="bui-box">
                    <div class="span1">
                        <div class="bui-btn" @click="closeDialog">取消</div>
                    </div>
                    <div class="span1">
                        <div class="bui-btn blue" @click="update">确定</div>
                    </div>
                </div>
            </div>
            <div class="bui-dialog-close"><i class="icon-close"></i></div>
        </div>
        <div id="dialogTop" class="bui-dialog" style="display:none">
            <div class="bui-dialog-main" style="padding:8px 4px">
                <div class="span-inner">
                    <span class="span-label">{{detailInfo.label}}</span>
                    <el-input ref="detailInfo" style="margin-top:8px" v-model="detailInfo.value" :type="detailInfo.type" size="small"></el-input>
                </div>
            </div>
            <div class="bui-dialog-foot">
                <div class="bui-box">
                    <div class="span1">
                        <div class="bui-btn" @click="uiDialogTop.close()">取消</div>
                    </div>
                    <div class="span1">
                        <div class="bui-btn blue" @click="setDetailInfo">确定</div>
                    </div>
                </div>
            </div>
            <div class="bui-dialog-close"><i class="icon-close"></i></div>
        </div>
    </main>
    <footer>
        
    </footer>
</div>
</div>
<style scoped>.bui-dialog-head{background-color:#39a4ff;color:#fff}.bui-dialog .bui-dialog-close i{color:#fff}.bui-dialog-main{padding:4px}.span-inner{text-align:left}.span-inner .span-label{margin-bottom:4px}.bui-dialog-top{left:50%;margin-left:-250px}</style>
platforms/android/app/src/main/assets/www/pages/batt-info-set/batt-info-set.js
@@ -14,7 +14,9 @@
        this.vm = new Vue({
            el: getPageRoot(module),
            data: {
                dialogFormVisible: false,
                dialogVisible: false,
                uiDialog: '',
                uiDialogTop: '',
                tbl: {
                    noData: '暂无电池信息',
                    height: 300,
@@ -70,6 +72,12 @@
                    rules: {},
                    loading: false,
                    data: {}
                },
                detailInfo: {
                    value: 0,
                    name: '',
                    label: '',
                    type: ''
                }
            },
            methods: {
@@ -84,20 +92,20 @@
                showDialog: function showDialog(row) {
                    // 初始化电池信息
                    this.initBattInfo(row);
                    this.dialogFormVisible = true;
                    this.uiDialog.open();
                },
                closeDialog: function closeDialog() {
                    this.dialogFormVisible = false;
                    this.uiDialog.close();
                },
                initBattInfo: function initBattInfo(row) {
                    var data = Object.assign({}, row);
                    this.battInfo.data = data;
                },
                update: function update() {
                    var _this = this;
                    var self = this;
                    this.battInfo.loading = true;
                    var data = this.battInfo.data;
                    console.log(data);
                    // 特殊数据处理
                    data.BattGroupName = data.BattGroupName1 + data.num;
                    data.BattInUseDate = new Date().format('yyyy-MM-dd');
@@ -105,16 +113,31 @@
                        BattinfService.update(JSON.stringify(data));
                    } else {
                        setTimeout(function () {
                            _this.battInfo.loading = false;
                            self.battInfo.loading = false;
                            // 提示信息
                            _this.$message({
                            self.$message({
                                message: '修改成功',
                                type: 'success'
                            });
                            // 关闭对话框
                            _this.dialogFormVisible = false;
                            self.closeDialog();
                        }, 3000);
                    }
                },
                showDetail: function showDetail(val, name, label, type) {
                    var self = this;
                    this.detailInfo.value = val, this.detailInfo.name = name;
                    this.detailInfo.label = label;
                    this.detailInfo.type = type;
                    this.uiDialog.close();
                    this.uiDialogTop.open();
                    this.$nextTick(function () {
                        self.$refs.detailInfo.focus();
                    });
                },
                setDetailInfo: function setDetailInfo() {
                    this.battInfo.data[this.detailInfo.name] = this.detailInfo.value;
                    this.uiDialogTop.close();
                }
            },
            mounted: function mounted() {
@@ -122,6 +145,25 @@
                // 查询电池信息
                this.searchAll();
                // 自定义居中弹出框
                this.uiDialog = bui.dialog({
                    id: "#dialogCenter",
                    width: 500,
                    height: 400,
                    autoClose: false
                });
                // 自定义居中弹出框
                this.uiDialogTop = bui.dialog({
                    id: "#dialogTop",
                    position: 'top',
                    width: 500,
                    height: 120,
                    autoClose: false,
                    onBeforeClose: function onBeforeClose() {
                        self.uiDialog.open();
                    }
                });
                // 后台触发事件查询所有的电池组信息
                window['BattinfServicesearchAllcalljs'] = function (res) {
                    var data = res.data;
platforms/android/app/src/main/assets/www/pages/main/main.js
@@ -145,7 +145,10 @@
                        // 跳转
                        router.load({
                            url: url,
                            param: {}
                            param: {
                                random: Math.random().toFixed(2)
                            },
                            reload: true
                        });
                    }, 100);
                }
platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js
@@ -10,714 +10,720 @@
        vm: ''
    },
    loaded: function loaded(require, exports, module) {
        // 引入vue
        this.vm = new Vue({
            el: getPageRoot(module),
            data: {
                loading: bui.loading(),
                open: true,
                num: -1,
                title: '??',
                battInfo: {
                    sysstate: 0,
                    sysversion: 1.2,
                    battstate: 0,
                    isOutTime: 1,
                    groupcurr: 0,
                    groupvol: 0,
                    monCount: 0,
                    testTimelong: 0
                },
                battList: [{
                    num: 1,
                    text: '电池组1'
                }, {
                    num: 2,
                    text: '电池组2'
                }],
                tabs: {
                    active: 0
                },
                timer: new Timeout(),
                tbls: {
                    monInfo: {
                        height: '300px',
                        data: []
        var loading = bui.loading();
        loading.show();
        var self = this;
        setTimeout(function () {
            loading.hide();
            // 引入vue
            self.vm = new Vue({
                el: getPageRoot(module),
                data: {
                    loading: bui.loading(),
                    open: true,
                    num: -1,
                    title: '??',
                    battInfo: {
                        sysstate: 0,
                        sysversion: 1.2,
                        battstate: 0,
                        isOutTime: 1,
                        groupcurr: 0,
                        groupvol: 0,
                        monCount: 0,
                        testTimelong: 0
                    },
                    total: {
                        data: [{
                            type: '电压',
                            high: '',
                            low: '',
                            avg: ''
                        }, {
                            type: '内阻',
                            high: '',
                            low: '',
                            avg: ''
                        }, {
                            type: '温度',
                            high: '',
                            low: '',
                            avg: ''
                        }]
                    }
                },
                options: {
                    page: {
                        curr: 1, // 当前页
                        size: 50, // 每页的数据量
                        pageTotal: 1, // 总页数
                        total: 0 // 数据总量
                    battList: [{
                        num: 1,
                        text: '电池组1'
                    }, {
                        num: 2,
                        text: '电池组2'
                    }],
                    tabs: {
                        active: 0
                    },
                    monVol: { // 单体电压
                        title: new Title(),
                        height: "300px",
                        option: {
                            categories: [],
                    timer: new Timeout(),
                    tbls: {
                        monInfo: {
                            height: '300px',
                            data: []
                        },
                        total: {
                            data: [{
                                type: '电压',
                                high: '',
                                low: '',
                                avg: ''
                            }, {
                                type: '内阻',
                                high: '',
                                low: '',
                                avg: ''
                            }, {
                                type: '温度',
                                high: '',
                                low: '',
                                avg: ''
                            }]
                        }
                    },
                    monRes: { // 单体内阻
                        title: new Title(),
                        height: "300px",
                        option: {
                            categories: [],
                            data: []
                    options: {
                        page: {
                            curr: 1, // 当前页
                            size: 50, // 每页的数据量
                            pageTotal: 1, // 总页数
                            total: 0 // 数据总量
                        },
                        monVol: { // 单体电压
                            title: new Title(),
                            height: "300px",
                            option: {
                                categories: [],
                                data: []
                            }
                        },
                        monRes: { // 单体内阻
                            title: new Title(),
                            height: "300px",
                            option: {
                                categories: [],
                                data: []
                            }
                        },
                        monResLine: { // 单体内阻折线图
                            option: {
                                categories: [],
                                data: []
                            }
                        },
                        monTmp: { // 单体温度
                            title: new Title(),
                            height: "300px",
                            option: {
                                categories: [],
                                data: []
                            }
                        }
                    },
                    monResLine: { // 单体内阻折线图
                        option: {
                            categories: [],
                            data: []
                        }
                    },
                    monTmp: { // 单体温度
                        title: new Title(),
                        height: "300px",
                        option: {
                            categories: [],
                            data: []
                        }
                    }
                    allData: []
                },
                allData: []
            },
            filters: {
                stateFilter: function stateFilter(state, isOutTime) {
                    var rs = '';
                    if (isOutTime == 1) {
                        rs = "未连接";
                    } else {
                        switch (state) {
                            case -1:
                                rs = '未知';
                                break;
                            case 0:
                                rs = '浮充';
                                break;
                filters: {
                    stateFilter: function stateFilter(state, isOutTime) {
                        var rs = '';
                        if (isOutTime == 1) {
                            rs = "未连接";
                        } else {
                            switch (state) {
                                case -1:
                                    rs = '未知';
                                    break;
                                case 0:
                                    rs = '浮充';
                                    break;
                                case 1:
                                    rs = '放电';
                                    break;
                                case 2:
                                    rs = '充电';
                                    break;
                            }
                        }
                        return rs;
                    },
                    sysstateFilter: function sysstateFilter(sysstate) {
                        var rs = '常规模式';
                        switch (sysstate) {
                            case 1:
                                rs = '放电';
                                rs = '内阻测试';
                                break;
                            case 2:
                                rs = '充电';
                                rs = '编址模式';
                                break;
                        }
                    }
                    return rs;
                },
                sysstateFilter: function sysstateFilter(sysstate) {
                    var rs = '常规模式';
                    switch (sysstate) {
                        case 1:
                            rs = '内阻测试';
                            break;
                        case 2:
                            rs = '编址模式';
                            break;
                    }
                    return rs;
                },
                formatSeconds: function (_formatSeconds) {
                    function formatSeconds(_x) {
                        return _formatSeconds.apply(this, arguments);
                    }
                        return rs;
                    },
                    formatSeconds: function (_formatSeconds) {
                        function formatSeconds(_x) {
                            return _formatSeconds.apply(this, arguments);
                        }
                    formatSeconds.toString = function () {
                        return _formatSeconds.toString();
                    };
                        formatSeconds.toString = function () {
                            return _formatSeconds.toString();
                        };
                    return formatSeconds;
                }(function (num) {
                    return formatSeconds(num);
                })
            },
            methods: {
                setAllData: function setAllData(data) {
                    this.allData = data;
                        return formatSeconds;
                    }(function (num) {
                        return formatSeconds(num);
                    })
                },
                tabsChange: function tabsChange() {
                    var self = this;
                    this.$nextTick(function () {
                        self.updateGrahp();
                    });
                },
                openDrawer: function openDrawer() {
                    this.open = true;
                },
                closeDrawer: function closeDrawer() {
                    this.open = false;
                },
                listClick: function listClick(item) {
                    // 设置标题
                    this.title = item.text;
                    // 关闭Drawer
                    this.open = false;
                    // 初始化分页信息
                    this.initPage();
                    // 根据点电池组编号查询电池组信息
                    this.num = item.num;
                    this.startReadBattMonInfo();
                },
                searchAll: function searchAll() {
                    // 查询电池组的所有信息
                    if (typeof BattinfService != 'undefined') {
                        BattinfService.searchAll();
                    }
                },
                startReadBattMonInfo: function startReadBattMonInfo() {
                    // 开始获取电池组信息
                    var self = this;
                    this.timer.start(function () {
                        self.readBattMonInfo();
                    }, 4000);
                },
                readBattMonInfo: function readBattMonInfo() {
                    // 读取电池组信息
                    var num = this.num;
                    if (num == -1) {
                        return;
                    }
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.readBattMonInfo(num);
                    } else {
                        this.setPageContent({
                            code: 1,
                            data: {
                                sysstate: 0,
                                sysversion: 1.2,
                                battstate: 0,
                                isOutTime: 0,
                                groupcurr: 2,
                                groupvol: 30,
                                monCount: 4,
                                testTimelong: 0,
                                mon_ress: [0.2, 0.3, 1, 2],
                                mon_tmps: [10, 11, 12, 13],
                                mon_vols: [14, 16, 18, 20]
                            }
                methods: {
                    setAllData: function setAllData(data) {
                        this.allData = data;
                    },
                    tabsChange: function tabsChange() {
                        var self = this;
                        this.$nextTick(function () {
                            self.updateGrahp();
                        });
                        this.timer.open();
                    }
                },
                setList: function setList(data) {
                    var list = [];
                    // 遍历data
                    for (var i = 0; i < data.length; i++) {
                        var _data = data[i];
                        _data.text = _data.BattGroupName;
                        if (_data.station_install) {
                            list.push(_data);
                    },
                    openDrawer: function openDrawer() {
                        this.open = true;
                    },
                    closeDrawer: function closeDrawer() {
                        this.open = false;
                    },
                    listClick: function listClick(item) {
                        // 设置标题
                        this.title = item.text;
                        // 关闭Drawer
                        this.open = false;
                        // 初始化分页信息
                        this.initPage();
                        // 根据点电池组编号查询电池组信息
                        this.num = item.num;
                        this.startReadBattMonInfo();
                    },
                    searchAll: function searchAll() {
                        // 查询电池组的所有信息
                        if (typeof BattinfService != 'undefined') {
                            BattinfService.searchAll();
                        }
                    }
                    // 设置battList的值
                    this.battList = list;
                },
                setPageContent: function setPageContent(res) {
                    // 设置所有的数据
                    this.setAllData(res.data);
                    // 设置电池组的总体信息
                    this.setBattInfo(res.data);
                    // 设置图标配置项
                    this.setOption();
                },
                setMonInfoTbl: function setMonInfoTbl(data) {
                    var monCount = data.monCount;
                    var list = [];
                    var k = -1;
                    // 遍历单体
                    for (var i = 0; i < monCount; i++) {
                        var num = i % 3;
                        if (num == 0) {
                            k++;
                            list[k] = {};
                        }
                        num++;
                        var num_k = 'num' + num;
                        var vol_k = 'vol' + num;
                        var tmp_k = 'tmp' + num;
                        var res_k = 'res' + num;
                        list[k][num_k] = '#' + (i + 1);
                        list[k][vol_k] = data.mon_vols[i];
                        list[k][res_k] = data.mon_ress[i];
                        list[k][tmp_k] = data.mon_tmps[i];
                    }
                    this.tbls.monInfo.data = list;
                },
                setTotal: function setTotal(data) {
                    // 单体电压
                    var vol = this.getMaxMinAvg(data.monCount, data.mon_vols);
                    this.setTotalItem(0, vol, 'V', 2);
                    // 单体内阻
                    var res = this.getMaxMinAvg(data.monCount, data.mon_ress);
                    this.setTotalItem(1, res, 'mΩ', 2);
                    // 单体温度
                    var tmp = this.getMaxMinAvg(data.monCount, data.mon_tmps);
                    this.setTotalItem(2, tmp, '℃', 1);
                },
                setTotalItem: function setTotalItem(item, data, unit, fixed) {
                    this.tbls.total.data[item].high = data.max.text + ':' + data.max.val + unit;
                    this.tbls.total.data[item].low = data.min.text + ':' + data.min.val + unit;
                    this.tbls.total.data[item].avg = Number(data.avg.toFixed(fixed)) + unit;
                },
                setOption: function setOption() {
                    this.loading.hide();
                    var data = this.allData;
                    // 设置单体表格数据
                    this.setMonInfoTbl(data);
                    // 设置统计信息表格
                    this.setTotal(data);
                    // 单体个数
                    var monCount = data.monCount;
                    // 设置分页的总数据量
                    this.setPageTotal(monCount);
                    // 获取起始和结束电池单体
                    var startEnd = this.getStartEndIndex();
                    //console.log(data);
                    // 遍历data的值
                    var monNum = []; // 单体编号
                    var monVol = []; // 单体电压
                    var monRes = []; // 单体内阻
                    var monTmp = []; // 单体温度
                    for (var i = startEnd.start; i < startEnd.end; i++) {
                        monNum.push('#' + (i + 1));
                        monVol.push(data.mon_vols[i]);
                        monRes.push(data.mon_ress[i]);
                        monTmp.push(data.mon_tmps[i]);
                    }
                    // 单体电压
                    this.options.monVol.option.categories = monNum;
                    this.options.monVol.option.data = monVol;
                    // 单体内阻
                    this.options.monRes.option.categories = monNum;
                    this.options.monRes.option.data = monRes;
                    // 单体温度
                    this.options.monTmp.option.categories = monNum;
                    this.options.monTmp.option.data = monTmp;
                    // 更新图表
                    this.updateGrahp();
                },
                updateGrahp: function updateGrahp() {
                    // 更新单体电压
                    if (this.tabs.active == 2) {
                        // bui.alert(7788);
                        this.$refs['monVolBar'].setOption(this.options.monVol.option);
                    }
                    // 更新单体内阻
                    if (this.tabs.active == 3) {
                        this.$refs['monResBar'].setOption(this.options.monRes.option);
                    }
                    // 更新单体温度
                    if (this.tabs.active == 4) {
                        this.$refs['monTmpBar'].setOption(this.options.monTmp.option);
                    }
                },
                setBattInfo: function setBattInfo(data) {
                    var battInfo = {
                        sysstate: data.sysstate,
                        sysversion: data.sysversion,
                        battstate: data.battstate,
                        isOutTime: data.isOutTime,
                        groupcurr: data.groupcurr,
                        groupvol: data.groupvol,
                        monCount: data.monCount,
                        testTimelong: data.testTimelong
                    };
                    // 设置电池的信息
                    this.battInfo = battInfo;
                },
                getMaxMinAvg: function getMaxMinAvg(monCount, data, unit) {
                    // 获取较高,较低单体信息和平均值
                    // 构造对象
                    var rs = {
                        min: {
                            text: '#1',
                            val: data[0]
                        },
                        max: {
                            text: '#1',
                            val: data[0]
                        },
                        avg: 0
                    };
                    var sum = data[0];
                    // 遍历monCount
                    for (var i = 1; i < monCount; i++) {
                        // 较大值
                        if (data[i] > rs.max.val) {
                            rs.max.text = "#" + (i + 1);
                            rs.max.val = data[i];
                        } else if (data[i] == rs.max.val) {
                            rs.max.text += ",#" + (i + 1);
                        }
                        // 较小值
                        if (data[i] < rs.min.val) {
                            rs.min.text = "#" + (i + 1);
                            rs.min.val = data[i];
                        } else if (data[i] == rs.min.val) {
                            rs.min.text += ",#" + (i + 1);
                        }
                        sum += data[i];
                    }
                    rs.avg = sum / monCount;
                    return rs;
                },
                confirmStartRes: function confirmStartRes() {
                    var self = this;
                    var num = this.num;
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 确认框
                    this.$confirm('启动内阻测试?', '确认信息', {
                        distinguishCancelAndClose: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        callback: function callback(action, instance) {
                            if (action == 'confirm') {
                                self.startBattResTest(num);
                            }
                        }
                    });
                },
                startBattResTest: function startBattResTest(num) {
                    var self = this;
                    //console.log(num);
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 加载等待
                    this.loading.show();
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.startBattResTest(num);
                    } else {
                        this.battInfo.sysstate = 1;
                        // 提示
                        this.$message({
                            message: '请使用手机端启动!',
                            type: 'warning'
                        });
                        setTimeout(function () {
                            self.loading.hide();
                    },
                    startReadBattMonInfo: function startReadBattMonInfo() {
                        // 开始获取电池组信息
                        var self = this;
                        this.timer.start(function () {
                            self.readBattMonInfo();
                        }, 4000);
                    }
                },
                confirmStopRes: function confirmStopRes() {
                    var self = this;
                    var num = this.num;
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 确认框
                    this.$confirm('停止内阻测试?', '确认信息', {
                        distinguishCancelAndClose: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        callback: function callback(action, instance) {
                            if (action == 'confirm') {
                                self.stopBattResTest(num);
                    },
                    readBattMonInfo: function readBattMonInfo() {
                        // 读取电池组信息
                        var num = this.num;
                        if (num == -1) {
                            return;
                        }
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.readBattMonInfo(num);
                        } else {
                            this.setPageContent({
                                code: 1,
                                data: {
                                    sysstate: 0,
                                    sysversion: 1.2,
                                    battstate: 0,
                                    isOutTime: 0,
                                    groupcurr: 2,
                                    groupvol: 30,
                                    monCount: 4,
                                    testTimelong: 0,
                                    mon_ress: [0.2, 0.3, 1, 2],
                                    mon_tmps: [10, 11, 12, 13],
                                    mon_vols: [14, 16, 18, 20]
                                }
                            });
                            this.timer.open();
                        }
                    },
                    setList: function setList(data) {
                        var list = [];
                        // 遍历data
                        for (var i = 0; i < data.length; i++) {
                            var _data = data[i];
                            _data.text = _data.BattGroupName;
                            if (_data.station_install) {
                                list.push(_data);
                            }
                        }
                    });
                },
                stopBattResTest: function stopBattResTest(num) {
                    var self = this;
                    //console.log(num);
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 加载等待
                    this.loading.show();
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.stopBattResTest(num);
                    } else {
                        this.battInfo.sysstate = 0;
                        // 提示
                        this.$message({
                            message: '请使用手机端停止!',
                            type: 'warning'
                        });
                        // 设置battList的值
                        this.battList = list;
                    },
                    setPageContent: function setPageContent(res) {
                        // 设置所有的数据
                        this.setAllData(res.data);
                        setTimeout(function () {
                            self.loading.hide();
                        }, 4000);
                    }
                },
                confirmRestart: function confirmRestart() {
                    var self = this;
                    var num = this.num;
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 确认框
                    this.$confirm('重启汇集器?', '确认信息', {
                        distinguishCancelAndClose: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        callback: function callback(action, instance) {
                            if (action == 'confirm') {
                                self.reStartSystem(num);
                        // 设置电池组的总体信息
                        this.setBattInfo(res.data);
                        // 设置图标配置项
                        this.setOption();
                    },
                    setMonInfoTbl: function setMonInfoTbl(data) {
                        var monCount = data.monCount;
                        var list = [];
                        var k = -1;
                        // 遍历单体
                        for (var i = 0; i < monCount; i++) {
                            var num = i % 3;
                            if (num == 0) {
                                k++;
                                list[k] = {};
                            }
                            num++;
                            var num_k = 'num' + num;
                            var vol_k = 'vol' + num;
                            var tmp_k = 'tmp' + num;
                            var res_k = 'res' + num;
                            list[k][num_k] = '#' + (i + 1);
                            list[k][vol_k] = data.mon_vols[i];
                            list[k][res_k] = data.mon_ress[i];
                            list[k][tmp_k] = data.mon_tmps[i];
                        }
                    });
                },
                reStartSystem: function reStartSystem(num) {
                    var self = this;
                    //console.log(num);
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 加载等待
                    this.loading.show();
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.reStartSystem(num);
                    } else {
                        this.battInfo.sysstate = 0;
                        // 提示
                        this.$message({
                            message: '请使用手机端重启!',
                            type: 'warning'
                        });
                        this.tbls.monInfo.data = list;
                    },
                    setTotal: function setTotal(data) {
                        // 单体电压
                        var vol = this.getMaxMinAvg(data.monCount, data.mon_vols);
                        this.setTotalItem(0, vol, 'V', 2);
                        // 单体内阻
                        var res = this.getMaxMinAvg(data.monCount, data.mon_ress);
                        this.setTotalItem(1, res, 'mΩ', 2);
                        // 单体温度
                        var tmp = this.getMaxMinAvg(data.monCount, data.mon_tmps);
                        this.setTotalItem(2, tmp, '℃', 1);
                    },
                    setTotalItem: function setTotalItem(item, data, unit, fixed) {
                        this.tbls.total.data[item].high = data.max.text + ':' + data.max.val + unit;
                        this.tbls.total.data[item].low = data.min.text + ':' + data.min.val + unit;
                        this.tbls.total.data[item].avg = Number(data.avg.toFixed(fixed)) + unit;
                    },
                    setOption: function setOption() {
                        this.loading.hide();
                        var data = this.allData;
                        // 设置单体表格数据
                        this.setMonInfoTbl(data);
                        // 设置统计信息表格
                        this.setTotal(data);
                        // 单体个数
                        var monCount = data.monCount;
                        // 设置分页的总数据量
                        this.setPageTotal(monCount);
                        // 获取起始和结束电池单体
                        var startEnd = this.getStartEndIndex();
                        //console.log(data);
                        // 遍历data的值
                        var monNum = []; // 单体编号
                        var monVol = []; // 单体电压
                        var monRes = []; // 单体内阻
                        var monTmp = []; // 单体温度
                        for (var i = startEnd.start; i < startEnd.end; i++) {
                            monNum.push('#' + (i + 1));
                            monVol.push(data.mon_vols[i]);
                            monRes.push(data.mon_ress[i]);
                            monTmp.push(data.mon_tmps[i]);
                        }
                        // 单体电压
                        this.options.monVol.option.categories = monNum;
                        this.options.monVol.option.data = monVol;
                        // 单体内阻
                        this.options.monRes.option.categories = monNum;
                        this.options.monRes.option.data = monRes;
                        // 单体温度
                        this.options.monTmp.option.categories = monNum;
                        this.options.monTmp.option.data = monTmp;
                        // 更新图表
                        this.updateGrahp();
                    },
                    updateGrahp: function updateGrahp() {
                        // 更新单体电压
                        if (this.tabs.active == 2) {
                            // bui.alert(7788);
                            this.$refs['monVolBar'].setOption(this.options.monVol.option);
                        }
                        // 更新单体内阻
                        if (this.tabs.active == 3) {
                            this.$refs['monResBar'].setOption(this.options.monRes.option);
                        }
                        // 更新单体温度
                        if (this.tabs.active == 4) {
                            this.$refs['monTmpBar'].setOption(this.options.monTmp.option);
                        }
                    },
                    setBattInfo: function setBattInfo(data) {
                        var battInfo = {
                            sysstate: data.sysstate,
                            sysversion: data.sysversion,
                            battstate: data.battstate,
                            isOutTime: data.isOutTime,
                            groupcurr: data.groupcurr,
                            groupvol: data.groupvol,
                            monCount: data.monCount,
                            testTimelong: data.testTimelong
                        };
                        // 设置电池的信息
                        this.battInfo = battInfo;
                    },
                    getMaxMinAvg: function getMaxMinAvg(monCount, data, unit) {
                        // 获取较高,较低单体信息和平均值
                        // 构造对象
                        var rs = {
                            min: {
                                text: '#1',
                                val: data[0]
                            },
                            max: {
                                text: '#1',
                                val: data[0]
                            },
                            avg: 0
                        };
                        var sum = data[0];
                        // 遍历monCount
                        for (var i = 1; i < monCount; i++) {
                            // 较大值
                            if (data[i] > rs.max.val) {
                                rs.max.text = "#" + (i + 1);
                                rs.max.val = data[i];
                            } else if (data[i] == rs.max.val) {
                                rs.max.text += ",#" + (i + 1);
                            }
                            // 较小值
                            if (data[i] < rs.min.val) {
                                rs.min.text = "#" + (i + 1);
                                rs.min.val = data[i];
                            } else if (data[i] == rs.min.val) {
                                rs.min.text += ",#" + (i + 1);
                            }
                            sum += data[i];
                        }
                        rs.avg = sum / monCount;
                        return rs;
                    },
                    confirmStartRes: function confirmStartRes() {
                        var self = this;
                        var num = this.num;
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 确认框
                        this.$confirm('启动内阻测试?', '确认信息', {
                            distinguishCancelAndClose: true,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            callback: function callback(action, instance) {
                                if (action == 'confirm') {
                                    self.startBattResTest(num);
                                }
                            }
                        });
                    },
                    startBattResTest: function startBattResTest(num) {
                        var self = this;
                        //console.log(num);
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 加载等待
                        this.loading.show();
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.startBattResTest(num);
                        } else {
                            this.battInfo.sysstate = 1;
                            // 提示
                            this.$message({
                                message: '请使用手机端启动!',
                                type: 'warning'
                            });
                            setTimeout(function () {
                                self.loading.hide();
                            }, 4000);
                        }
                    },
                    confirmStopRes: function confirmStopRes() {
                        var self = this;
                        var num = this.num;
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 确认框
                        this.$confirm('停止内阻测试?', '确认信息', {
                            distinguishCancelAndClose: true,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            callback: function callback(action, instance) {
                                if (action == 'confirm') {
                                    self.stopBattResTest(num);
                                }
                            }
                        });
                    },
                    stopBattResTest: function stopBattResTest(num) {
                        var self = this;
                        //console.log(num);
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 加载等待
                        this.loading.show();
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.stopBattResTest(num);
                        } else {
                            this.battInfo.sysstate = 0;
                            // 提示
                            this.$message({
                                message: '请使用手机端停止!',
                                type: 'warning'
                            });
                            setTimeout(function () {
                                self.loading.hide();
                            }, 4000);
                        }
                    },
                    confirmRestart: function confirmRestart() {
                        var self = this;
                        var num = this.num;
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 确认框
                        this.$confirm('重启汇集器?', '确认信息', {
                            distinguishCancelAndClose: true,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            callback: function callback(action, instance) {
                                if (action == 'confirm') {
                                    self.reStartSystem(num);
                                }
                            }
                        });
                    },
                    reStartSystem: function reStartSystem(num) {
                        var self = this;
                        //console.log(num);
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 加载等待
                        this.loading.show();
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.reStartSystem(num);
                        } else {
                            this.battInfo.sysstate = 0;
                            // 提示
                            this.$message({
                                message: '请使用手机端重启!',
                                type: 'warning'
                            });
                            setTimeout(function () {
                                self.loading.hide();
                            }, 4000);
                        }
                    },
                    setHt: function setHt() {
                        var pgHt = this.$refs.tabItemHt.offsetHeight - 1;
                        this.options.monVol.height = pgHt + 'px';
                        this.options.monRes.height = pgHt + 'px';
                        this.options.monTmp.height = pgHt + 'px';
                        this.tbls.monInfo.height = pgHt + 'px';
                    },
                    handlePreBtn: function handlePreBtn() {
                        var self = this;
                        this.options.page.curr--;
                        this.loading.show();
                        setTimeout(function () {
                            self.loading.hide();
                        }, 4000);
                            // 设置配置项
                            self.setOption();
                        }, 500);
                    },
                    handleNextBtn: function handleNextBtn() {
                        var self = this;
                        this.options.page.curr++;
                        this.loading.show();
                        setTimeout(function () {
                            // 设置配置项
                            self.setOption();
                        }, 500);
                    },
                    initPage: function initPage() {
                        // 初始化图表分页信息
                        // 初始化页数为1
                        this.options.page.curr = 1;
                        // 设置total
                        this.options.page.total = 0;
                    },
                    getStartEndIndex: function getStartEndIndex() {
                        // 根据分页信息获取起始和结束点
                        var page = this.options.page;
                        var start = (page.curr - 1) * page.size;
                        var end = (page.curr - 1) * page.size + page.size;
                        if (end > page.total) {
                            end = page.total;
                        }
                        return {
                            start: start,
                            end: end
                        };
                    },
                    setPageTotal: function setPageTotal(total) {
                        // 设置分页的总数据量
                        this.options.page.total = total;
                        if (total == 0) {
                            this.options.page.pageTotal = 1;
                        } else {
                            this.options.page.pageTotal = Math.ceil(total / this.options.page.size);
                        }
                    }
                },
                setHt: function setHt() {
                    var pgHt = this.$refs.tabItemHt.offsetHeight - 1;
                    this.options.monVol.height = pgHt + 'px';
                    this.options.monRes.height = pgHt + 'px';
                    this.options.monTmp.height = pgHt + 'px';
                    this.tbls.monInfo.height = pgHt + 'px';
                },
                handlePreBtn: function handlePreBtn() {
                    var self = this;
                    this.options.page.curr--;
                    this.loading.show();
                    setTimeout(function () {
                        // 设置配置项
                        self.setOption();
                    }, 500);
                },
                handleNextBtn: function handleNextBtn() {
                    var self = this;
                    this.options.page.curr++;
                    this.loading.show();
                    setTimeout(function () {
                        // 设置配置项
                        self.setOption();
                    }, 500);
                },
                initPage: function initPage() {
                    // 初始化图表分页信息
                    // 初始化页数为1
                    this.options.page.curr = 1;
                    // 设置total
                    this.options.page.total = 0;
                },
                getStartEndIndex: function getStartEndIndex() {
                    // 根据分页信息获取起始和结束点
                    var page = this.options.page;
                    var start = (page.curr - 1) * page.size;
                    var end = (page.curr - 1) * page.size + page.size;
                    if (end > page.total) {
                        end = page.total;
                computed: {
                    getTitle: function getTitle() {
                        return this.title + '-监测数据';
                    },
                    getRestart: function getRestart() {
                        var rs = true;
                        // 电池组状态为浮充,系统状态为常规状态
                        if (this.battInfo.battstate == 0 && this.battInfo.sysstate == 0) {
                            rs = false;
                        }
                        return rs;
                    },
                    getBattNum: function getBattNum() {
                        var rs = "";
                        if (this.num != -1) {
                            rs = '#' + this.num;
                        }
                        return rs;
                    },
                    setPagingPreBtn: function setPagingPreBtn() {
                        var rs = true;
                        if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr <= 1) {
                            return false;
                        }
                        return rs;
                    },
                    setPagingNextBtn: function setPagingNextBtn() {
                        var rs = true;
                        if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr * this.options.page.size >= this.options.page.total) {
                            return false;
                        }
                        return rs;
                    }
                    return {
                        start: start,
                        end: end
                },
                mounted: function mounted() {
                    var self = this;
                    // 页面选项卡
                    var uiTab = bui.tab({
                        id: "#uiTab"
                    });
                    // 选项卡绑定事件
                    uiTab.on('to', function (index) {
                        self.tabs.active = index;
                        self.tabsChange();
                    });
                    // 查询所有已经安装的电池组
                    this.searchAll();
                    // 设置高度
                    this.setHt();
                    // 后台触发事件查询所有的电池组信息
                    window['BattinfServicesearchAllcalljs'] = function (res) {
                        var data = res.data;
                        self.setList(data);
                    };
                    // 后台触发返回读取电池组信息
                    window['DeviceServicereadBattMonInfocalljs'] = function (res) {
                        //console.log(res);
                        // 设置页面信息
                        self.setPageContent(res);
                        // 开启延时执行
                        self.timer.open();
                    };
                    // 启动内阻测试
                    window['DeviceServicestartBattResTestcalljs'] = function (res) {
                        //console.log(res);
                        // 关闭等待
                        self.loading.hide();
                        // 根据返回结果显示内容
                        if (res.code == 1) {
                            self.$message({
                                message: '启动成功!',
                                type: 'success'
                            });
                        } else {
                            self.$message.error('启动失败!');
                        }
                    };
                    // 停止内阻测试
                    window['DeviceServicestopBattResTestcalljs'] = function (res) {
                        //console.log(res);
                        // 关闭等待
                        self.loading.hide();
                        // 根据返回结果显示内容
                        if (res.code == 1) {
                            self.$message({
                                message: '停止成功!',
                                type: 'success'
                            });
                        } else {
                            self.$message.error('停止失败!');
                        }
                    };
                    // 停止内阻测试
                    window['DeviceServicereStartSystemcalljs'] = function (res) {
                        //console.log(res);
                        // 关闭等待
                        self.loading.hide();
                        // 根据返回结果显示内容
                        if (res.code == 1) {
                            self.$message({
                                message: '重启汇集器成功!',
                                type: 'success'
                            });
                        } else {
                            self.$message.error('重启汇集器失败!');
                        }
                    };
                },
                setPageTotal: function setPageTotal(total) {
                    // 设置分页的总数据量
                    this.options.page.total = total;
                    if (total == 0) {
                        this.options.page.pageTotal = 1;
                    } else {
                        this.options.page.pageTotal = Math.ceil(total / this.options.page.size);
                    }
                destroyed: function destroyed() {
                    // 注销方法
                    window.BattinfServicesearchAllcalljs = null;
                    window.DeviceServicereadBattMonInfocalljs = null;
                    window.DeviceServicestartBattResTestcalljs = null;
                    window.DeviceServicestopBattResTestcalljs = null;
                    // 停止计时器
                    this.timer.stop();
                }
            },
            computed: {
                getTitle: function getTitle() {
                    return this.title + '-监测数据';
                },
                getRestart: function getRestart() {
                    var rs = true;
                    // 电池组状态为浮充,系统状态为常规状态
                    if (this.battInfo.battstate == 0 && this.battInfo.sysstate == 0) {
                        rs = false;
                    }
                    return rs;
                },
                getBattNum: function getBattNum() {
                    var rs = "";
                    if (this.num != -1) {
                        rs = '#' + this.num;
                    }
                    return rs;
                },
                setPagingPreBtn: function setPagingPreBtn() {
                    var rs = true;
                    if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr <= 1) {
                        return false;
                    }
                    return rs;
                },
                setPagingNextBtn: function setPagingNextBtn() {
                    var rs = true;
                    if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr * this.options.page.size >= this.options.page.total) {
                        return false;
                    }
                    return rs;
                }
            },
            mounted: function mounted() {
                var self = this;
                // 页面选项卡
                var uiTab = bui.tab({
                    id: "#uiTab"
                });
                // 选项卡绑定事件
                uiTab.on('to', function (index) {
                    self.tabs.active = index;
                    self.tabsChange();
                });
                // 查询所有已经安装的电池组
                this.searchAll();
                // 设置高度
                this.setHt();
                // 后台触发事件查询所有的电池组信息
                window['BattinfServicesearchAllcalljs'] = function (res) {
                    var data = res.data;
                    self.setList(data);
                };
                // 后台触发返回读取电池组信息
                window['DeviceServicereadBattMonInfocalljs'] = function (res) {
                    //console.log(res);
                    // 设置页面信息
                    self.setPageContent(res);
                    // 开启延时执行
                    self.timer.open();
                };
                // 启动内阻测试
                window['DeviceServicestartBattResTestcalljs'] = function (res) {
                    //console.log(res);
                    // 关闭等待
                    self.loading.hide();
                    // 根据返回结果显示内容
                    if (res.code == 1) {
                        self.$message({
                            message: '启动成功!',
                            type: 'success'
                        });
                    } else {
                        self.$message.error('启动失败!');
                    }
                };
                // 停止内阻测试
                window['DeviceServicestopBattResTestcalljs'] = function (res) {
                    //console.log(res);
                    // 关闭等待
                    self.loading.hide();
                    // 根据返回结果显示内容
                    if (res.code == 1) {
                        self.$message({
                            message: '停止成功!',
                            type: 'success'
                        });
                    } else {
                        self.$message.error('停止失败!');
                    }
                };
                // 停止内阻测试
                window['DeviceServicereStartSystemcalljs'] = function (res) {
                    //console.log(res);
                    // 关闭等待
                    self.loading.hide();
                    // 根据返回结果显示内容
                    if (res.code == 1) {
                        self.$message({
                            message: '重启汇集器成功!',
                            type: 'success'
                        });
                    } else {
                        self.$message.error('重启汇集器失败!');
                    }
                };
            },
            destroyed: function destroyed() {
                // 注销方法
                window.BattinfServicesearchAllcalljs = null;
                window.DeviceServicereadBattMonInfocalljs = null;
                window.DeviceServicestartBattResTestcalljs = null;
                window.DeviceServicestopBattResTestcalljs = null;
                // 停止计时器
                this.timer.stop();
            }
        });
            });
        }, 100);
    },
    destroyed: function destroyed() {
        this.vm.$destroy();
www/css/common.css
@@ -104,4 +104,9 @@
}
.el-drawer__header .heading {
    text-align: center;
}
/* input */
.el-input__inner {
    border: 1px solid #ccc;
}
www/index.html
@@ -17,16 +17,16 @@
    </div>
    <link rel="stylesheet" href="css/iconfont/iconfont.css">
    <link rel="stylesheet" href="css/element-ui/theme-chalk/index.css">
    <link rel="stylesheet" href="css/common.css?1d97b0c3ce">
    <link rel="stylesheet" href="css/common.css?ac7b5a4318">
    <script src="js/zepto.js"></script>
    <script src="js/bui.js"></script>
    <script src="js/common_functions.js?7a37f1e251"></script>
    <script src="js/vue.min.js"></script>
    <script src="css/element-ui/index.js?12fd3b4c55"></script>
    <script src="css/element-ui/index.js?3c8cb8a2a5"></script>
    <script src="js/componets.js?4dacdaa4ab"></script>
    <script src="css/highchart/highcharts.js"></script>
    
    <script src="index.js?12fd3b4c55"></script>
    <script src="index.js?3c8cb8a2a5"></script>
</body>
</html>
www/index.js
@@ -10,6 +10,11 @@
        hash: true
    });
    window.onresize = function () {
        // 重新设置路由宽高
        router.resize();
    };
    // 绑定事件
    bind();
www/pages/batt-info-set/batt-info-set.html
@@ -9,31 +9,128 @@
    </header>
    <main>
        <el-table border stripe size="mini" header-row-class-name="header-primary" height="100%" :data="tbl.data">
            <el-table-column prop="num" align="center" label="电池组编号">
            <el-table-column prop="num" align="center" width="180" label="电池组编号">
            </el-table-column>
            <el-table-column prop="BattGroupName" align="center" label="电池组名称">
            <el-table-column prop="BattGroupName" align="center" width="180" label="电池组名称">
            </el-table-column>
            <el-table-column prop="MonCount" align="center" label="单体个数">
            <el-table-column prop="MonCount" align="center" width="180" label="单体个数">
            </el-table-column>
            <el-table-column prop="MonCapStd" align="center" label="单体标称容量(AH)">
            <el-table-column prop="MonCapStd" align="center" width="180" label="标称容量(AH)">
            </el-table-column>
            <el-table-column prop="MonVolStd" align="center" label="单体标称电压(V)">
            <el-table-column prop="MonVolStd" align="center" width="180" label="标称电压(V)">
            </el-table-column>
            <el-table-column prop="station_install" align="center" label="安装状态">
            <el-table-column prop="MonResStd" align="center" width="180" label="标称内阻(mΩ)">
            </el-table-column>
            <el-table-column prop="MonTmpStd" align="center" width="180" label="标称温度(℃)">
            </el-table-column>
            <el-table-column prop="station_install" align="center" width="120" label="安装状态">
                <template slot-scope="scope">
                    <el-button size="mini" :type="scope.row.station_install==1?'success':''">
                        {{scope.row.station_install==1?'已安装':'未安装'}}
                    </el-button>
                </template>
            </el-table-column>
            <el-table-column align="center" width="150" label="操作">
            <el-table-column align="center" width="150" fixed="right" label="操作">
                <template slot-scope="scope">
                    <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div id="dialogCenter" class="bui-dialog" style="display:none">
            <div class="bui-dialog-head">电池参数设置</div>
            <div class="bui-dialog-main">
                <div class="bui-fluid-space">
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">电池组名称:</span>
                            <el-input v-model="battInfo.data.BattGroupName1" placeholder="请输入电池组名称" size="small" @focus="showDetail(battInfo.data.BattGroupName1, 'BattGroupName1', '电池组名称:')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体个数:</span>
                            <el-input v-model="battInfo.data.MonCount" type="number" placeholder="请输入单体个数" size="small" @focus="showDetail(battInfo.data.MonCount, 'MonCount', '单体个数:', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">浮充电流(A):</span>
                            <el-input v-model="battInfo.data.BattFloatCurrent" type="number" placeholder="请输入浮充电流" size="small" @focus="showDetail(battInfo.data.BattFloatCurrent, 'BattFloatCurrent', '浮充电流(A):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称容量(AH):</span>
                            <el-input v-model="battInfo.data.MonCapStd" type="number" placeholder="请输入单体标称容量" size="small" @focus="showDetail(battInfo.data.MonCapStd, 'MonCapStd', '单体标称容量(AH):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称电压(V):</span>
                            <el-input v-model="battInfo.data.MonVolStd" type="number" placeholder="请输入标称电压" size="small" @focus="showDetail(battInfo.data.MonVolStd, 'MonVolStd', '单体标称电压(V):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称内阻(mΩ):</span>
                            <el-input v-model="battInfo.data.MonVolStd" type="number" placeholder="请输入标称内阻" size="small" @focus="showDetail(battInfo.data.MonResStd, 'MonResStd', '单体标称内阻(mΩ):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称温度(℃):</span>
                            <el-input v-model="battInfo.data.MonTmpStd" type="number" placeholder="请输入标称温度" size="small" @focus="showDetail(battInfo.data.MonTmpStd, 'MonTmpStd', '单体标称温度(℃):', 'number')"></el-input>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="span-inner">
                            <span class="span-label">单体标称温度(℃):</span>
                            <el-select :disabled="battInfo.data.num == 1" v-model="battInfo.data.station_install" size="small" placeholder="请选择">
                                <el-option key="0" label="未安装" :value="0">
                                </el-option>
                                <el-option key="1" label="已安装" :value="1">
                                </el-option>
                            </el-select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bui-dialog-foot">
                <div class="bui-box">
                    <div class="span1">
                        <div class="bui-btn" @click="closeDialog">取消</div>
                    </div>
                    <div class="span1">
                        <div class="bui-btn blue" @click="update">确定</div>
                    </div>
                </div>
            </div>
            <div class="bui-dialog-close"><i class="icon-close"></i></div>
        </div>
        <div id="dialogTop" class="bui-dialog" style="display:none">
            <div class="bui-dialog-main" style="padding:8px 4px">
                <div class="span-inner">
                    <span class="span-label">{{detailInfo.label}}</span>
                    <el-input ref="detailInfo" style="margin-top:8px" v-model="detailInfo.value" :type="detailInfo.type" size="small"></el-input>
                </div>
            </div>
            <div class="bui-dialog-foot">
                <div class="bui-box">
                    <div class="span1">
                        <div class="bui-btn" @click="uiDialogTop.close()">取消</div>
                    </div>
                    <div class="span1">
                        <div class="bui-btn blue" @click="setDetailInfo">确定</div>
                    </div>
                </div>
            </div>
            <div class="bui-dialog-close"><i class="icon-close"></i></div>
        </div>
    </main>
    <footer>
        
    </footer>
</div>
</div>
<style scoped>.bui-dialog-head{background-color:#39a4ff;color:#fff}.bui-dialog .bui-dialog-close i{color:#fff}.bui-dialog-main{padding:4px}.span-inner{text-align:left}.span-inner .span-label{margin-bottom:4px}.bui-dialog-top{left:50%;margin-left:-250px}</style>
www/pages/batt-info-set/batt-info-set.js
@@ -14,7 +14,9 @@
        this.vm = new Vue({
            el: getPageRoot(module),
            data: {
                dialogFormVisible: false,
                dialogVisible: false,
                uiDialog: '',
                uiDialogTop: '',
                tbl: {
                    noData: '暂无电池信息',
                    height: 300,
@@ -70,6 +72,12 @@
                    rules: {},
                    loading: false,
                    data: {}
                },
                detailInfo: {
                    value: 0,
                    name: '',
                    label: '',
                    type: ''
                }
            },
            methods: {
@@ -84,20 +92,20 @@
                showDialog: function showDialog(row) {
                    // 初始化电池信息
                    this.initBattInfo(row);
                    this.dialogFormVisible = true;
                    this.uiDialog.open();
                },
                closeDialog: function closeDialog() {
                    this.dialogFormVisible = false;
                    this.uiDialog.close();
                },
                initBattInfo: function initBattInfo(row) {
                    var data = Object.assign({}, row);
                    this.battInfo.data = data;
                },
                update: function update() {
                    var _this = this;
                    var self = this;
                    this.battInfo.loading = true;
                    var data = this.battInfo.data;
                    console.log(data);
                    // 特殊数据处理
                    data.BattGroupName = data.BattGroupName1 + data.num;
                    data.BattInUseDate = new Date().format('yyyy-MM-dd');
@@ -105,16 +113,31 @@
                        BattinfService.update(JSON.stringify(data));
                    } else {
                        setTimeout(function () {
                            _this.battInfo.loading = false;
                            self.battInfo.loading = false;
                            // 提示信息
                            _this.$message({
                            self.$message({
                                message: '修改成功',
                                type: 'success'
                            });
                            // 关闭对话框
                            _this.dialogFormVisible = false;
                            self.closeDialog();
                        }, 3000);
                    }
                },
                showDetail: function showDetail(val, name, label, type) {
                    var self = this;
                    this.detailInfo.value = val, this.detailInfo.name = name;
                    this.detailInfo.label = label;
                    this.detailInfo.type = type;
                    this.uiDialog.close();
                    this.uiDialogTop.open();
                    this.$nextTick(function () {
                        self.$refs.detailInfo.focus();
                    });
                },
                setDetailInfo: function setDetailInfo() {
                    this.battInfo.data[this.detailInfo.name] = this.detailInfo.value;
                    this.uiDialogTop.close();
                }
            },
            mounted: function mounted() {
@@ -122,6 +145,25 @@
                // 查询电池信息
                this.searchAll();
                // 自定义居中弹出框
                this.uiDialog = bui.dialog({
                    id: "#dialogCenter",
                    width: 500,
                    height: 400,
                    autoClose: false
                });
                // 自定义居中弹出框
                this.uiDialogTop = bui.dialog({
                    id: "#dialogTop",
                    position: 'top',
                    width: 500,
                    height: 120,
                    autoClose: false,
                    onBeforeClose: function onBeforeClose() {
                        self.uiDialog.open();
                    }
                });
                // 后台触发事件查询所有的电池组信息
                window['BattinfServicesearchAllcalljs'] = function (res) {
                    var data = res.data;
www/pages/main/main.js
@@ -145,7 +145,10 @@
                        // 跳转
                        router.load({
                            url: url,
                            param: {}
                            param: {
                                random: Math.random().toFixed(2)
                            },
                            reload: true
                        });
                    }, 100);
                }
www/pages/monitor-data/monitor-data.js
@@ -10,714 +10,720 @@
        vm: ''
    },
    loaded: function loaded(require, exports, module) {
        // 引入vue
        this.vm = new Vue({
            el: getPageRoot(module),
            data: {
                loading: bui.loading(),
                open: true,
                num: -1,
                title: '??',
                battInfo: {
                    sysstate: 0,
                    sysversion: 1.2,
                    battstate: 0,
                    isOutTime: 1,
                    groupcurr: 0,
                    groupvol: 0,
                    monCount: 0,
                    testTimelong: 0
                },
                battList: [{
                    num: 1,
                    text: '电池组1'
                }, {
                    num: 2,
                    text: '电池组2'
                }],
                tabs: {
                    active: 0
                },
                timer: new Timeout(),
                tbls: {
                    monInfo: {
                        height: '300px',
                        data: []
        var loading = bui.loading();
        loading.show();
        var self = this;
        setTimeout(function () {
            loading.hide();
            // 引入vue
            self.vm = new Vue({
                el: getPageRoot(module),
                data: {
                    loading: bui.loading(),
                    open: true,
                    num: -1,
                    title: '??',
                    battInfo: {
                        sysstate: 0,
                        sysversion: 1.2,
                        battstate: 0,
                        isOutTime: 1,
                        groupcurr: 0,
                        groupvol: 0,
                        monCount: 0,
                        testTimelong: 0
                    },
                    total: {
                        data: [{
                            type: '电压',
                            high: '',
                            low: '',
                            avg: ''
                        }, {
                            type: '内阻',
                            high: '',
                            low: '',
                            avg: ''
                        }, {
                            type: '温度',
                            high: '',
                            low: '',
                            avg: ''
                        }]
                    }
                },
                options: {
                    page: {
                        curr: 1, // 当前页
                        size: 50, // 每页的数据量
                        pageTotal: 1, // 总页数
                        total: 0 // 数据总量
                    battList: [{
                        num: 1,
                        text: '电池组1'
                    }, {
                        num: 2,
                        text: '电池组2'
                    }],
                    tabs: {
                        active: 0
                    },
                    monVol: { // 单体电压
                        title: new Title(),
                        height: "300px",
                        option: {
                            categories: [],
                    timer: new Timeout(),
                    tbls: {
                        monInfo: {
                            height: '300px',
                            data: []
                        },
                        total: {
                            data: [{
                                type: '电压',
                                high: '',
                                low: '',
                                avg: ''
                            }, {
                                type: '内阻',
                                high: '',
                                low: '',
                                avg: ''
                            }, {
                                type: '温度',
                                high: '',
                                low: '',
                                avg: ''
                            }]
                        }
                    },
                    monRes: { // 单体内阻
                        title: new Title(),
                        height: "300px",
                        option: {
                            categories: [],
                            data: []
                    options: {
                        page: {
                            curr: 1, // 当前页
                            size: 50, // 每页的数据量
                            pageTotal: 1, // 总页数
                            total: 0 // 数据总量
                        },
                        monVol: { // 单体电压
                            title: new Title(),
                            height: "300px",
                            option: {
                                categories: [],
                                data: []
                            }
                        },
                        monRes: { // 单体内阻
                            title: new Title(),
                            height: "300px",
                            option: {
                                categories: [],
                                data: []
                            }
                        },
                        monResLine: { // 单体内阻折线图
                            option: {
                                categories: [],
                                data: []
                            }
                        },
                        monTmp: { // 单体温度
                            title: new Title(),
                            height: "300px",
                            option: {
                                categories: [],
                                data: []
                            }
                        }
                    },
                    monResLine: { // 单体内阻折线图
                        option: {
                            categories: [],
                            data: []
                        }
                    },
                    monTmp: { // 单体温度
                        title: new Title(),
                        height: "300px",
                        option: {
                            categories: [],
                            data: []
                        }
                    }
                    allData: []
                },
                allData: []
            },
            filters: {
                stateFilter: function stateFilter(state, isOutTime) {
                    var rs = '';
                    if (isOutTime == 1) {
                        rs = "未连接";
                    } else {
                        switch (state) {
                            case -1:
                                rs = '未知';
                                break;
                            case 0:
                                rs = '浮充';
                                break;
                filters: {
                    stateFilter: function stateFilter(state, isOutTime) {
                        var rs = '';
                        if (isOutTime == 1) {
                            rs = "未连接";
                        } else {
                            switch (state) {
                                case -1:
                                    rs = '未知';
                                    break;
                                case 0:
                                    rs = '浮充';
                                    break;
                                case 1:
                                    rs = '放电';
                                    break;
                                case 2:
                                    rs = '充电';
                                    break;
                            }
                        }
                        return rs;
                    },
                    sysstateFilter: function sysstateFilter(sysstate) {
                        var rs = '常规模式';
                        switch (sysstate) {
                            case 1:
                                rs = '放电';
                                rs = '内阻测试';
                                break;
                            case 2:
                                rs = '充电';
                                rs = '编址模式';
                                break;
                        }
                    }
                    return rs;
                },
                sysstateFilter: function sysstateFilter(sysstate) {
                    var rs = '常规模式';
                    switch (sysstate) {
                        case 1:
                            rs = '内阻测试';
                            break;
                        case 2:
                            rs = '编址模式';
                            break;
                    }
                    return rs;
                },
                formatSeconds: function (_formatSeconds) {
                    function formatSeconds(_x) {
                        return _formatSeconds.apply(this, arguments);
                    }
                        return rs;
                    },
                    formatSeconds: function (_formatSeconds) {
                        function formatSeconds(_x) {
                            return _formatSeconds.apply(this, arguments);
                        }
                    formatSeconds.toString = function () {
                        return _formatSeconds.toString();
                    };
                        formatSeconds.toString = function () {
                            return _formatSeconds.toString();
                        };
                    return formatSeconds;
                }(function (num) {
                    return formatSeconds(num);
                })
            },
            methods: {
                setAllData: function setAllData(data) {
                    this.allData = data;
                        return formatSeconds;
                    }(function (num) {
                        return formatSeconds(num);
                    })
                },
                tabsChange: function tabsChange() {
                    var self = this;
                    this.$nextTick(function () {
                        self.updateGrahp();
                    });
                },
                openDrawer: function openDrawer() {
                    this.open = true;
                },
                closeDrawer: function closeDrawer() {
                    this.open = false;
                },
                listClick: function listClick(item) {
                    // 设置标题
                    this.title = item.text;
                    // 关闭Drawer
                    this.open = false;
                    // 初始化分页信息
                    this.initPage();
                    // 根据点电池组编号查询电池组信息
                    this.num = item.num;
                    this.startReadBattMonInfo();
                },
                searchAll: function searchAll() {
                    // 查询电池组的所有信息
                    if (typeof BattinfService != 'undefined') {
                        BattinfService.searchAll();
                    }
                },
                startReadBattMonInfo: function startReadBattMonInfo() {
                    // 开始获取电池组信息
                    var self = this;
                    this.timer.start(function () {
                        self.readBattMonInfo();
                    }, 4000);
                },
                readBattMonInfo: function readBattMonInfo() {
                    // 读取电池组信息
                    var num = this.num;
                    if (num == -1) {
                        return;
                    }
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.readBattMonInfo(num);
                    } else {
                        this.setPageContent({
                            code: 1,
                            data: {
                                sysstate: 0,
                                sysversion: 1.2,
                                battstate: 0,
                                isOutTime: 0,
                                groupcurr: 2,
                                groupvol: 30,
                                monCount: 4,
                                testTimelong: 0,
                                mon_ress: [0.2, 0.3, 1, 2],
                                mon_tmps: [10, 11, 12, 13],
                                mon_vols: [14, 16, 18, 20]
                            }
                methods: {
                    setAllData: function setAllData(data) {
                        this.allData = data;
                    },
                    tabsChange: function tabsChange() {
                        var self = this;
                        this.$nextTick(function () {
                            self.updateGrahp();
                        });
                        this.timer.open();
                    }
                },
                setList: function setList(data) {
                    var list = [];
                    // 遍历data
                    for (var i = 0; i < data.length; i++) {
                        var _data = data[i];
                        _data.text = _data.BattGroupName;
                        if (_data.station_install) {
                            list.push(_data);
                    },
                    openDrawer: function openDrawer() {
                        this.open = true;
                    },
                    closeDrawer: function closeDrawer() {
                        this.open = false;
                    },
                    listClick: function listClick(item) {
                        // 设置标题
                        this.title = item.text;
                        // 关闭Drawer
                        this.open = false;
                        // 初始化分页信息
                        this.initPage();
                        // 根据点电池组编号查询电池组信息
                        this.num = item.num;
                        this.startReadBattMonInfo();
                    },
                    searchAll: function searchAll() {
                        // 查询电池组的所有信息
                        if (typeof BattinfService != 'undefined') {
                            BattinfService.searchAll();
                        }
                    }
                    // 设置battList的值
                    this.battList = list;
                },
                setPageContent: function setPageContent(res) {
                    // 设置所有的数据
                    this.setAllData(res.data);
                    // 设置电池组的总体信息
                    this.setBattInfo(res.data);
                    // 设置图标配置项
                    this.setOption();
                },
                setMonInfoTbl: function setMonInfoTbl(data) {
                    var monCount = data.monCount;
                    var list = [];
                    var k = -1;
                    // 遍历单体
                    for (var i = 0; i < monCount; i++) {
                        var num = i % 3;
                        if (num == 0) {
                            k++;
                            list[k] = {};
                        }
                        num++;
                        var num_k = 'num' + num;
                        var vol_k = 'vol' + num;
                        var tmp_k = 'tmp' + num;
                        var res_k = 'res' + num;
                        list[k][num_k] = '#' + (i + 1);
                        list[k][vol_k] = data.mon_vols[i];
                        list[k][res_k] = data.mon_ress[i];
                        list[k][tmp_k] = data.mon_tmps[i];
                    }
                    this.tbls.monInfo.data = list;
                },
                setTotal: function setTotal(data) {
                    // 单体电压
                    var vol = this.getMaxMinAvg(data.monCount, data.mon_vols);
                    this.setTotalItem(0, vol, 'V', 2);
                    // 单体内阻
                    var res = this.getMaxMinAvg(data.monCount, data.mon_ress);
                    this.setTotalItem(1, res, 'mΩ', 2);
                    // 单体温度
                    var tmp = this.getMaxMinAvg(data.monCount, data.mon_tmps);
                    this.setTotalItem(2, tmp, '℃', 1);
                },
                setTotalItem: function setTotalItem(item, data, unit, fixed) {
                    this.tbls.total.data[item].high = data.max.text + ':' + data.max.val + unit;
                    this.tbls.total.data[item].low = data.min.text + ':' + data.min.val + unit;
                    this.tbls.total.data[item].avg = Number(data.avg.toFixed(fixed)) + unit;
                },
                setOption: function setOption() {
                    this.loading.hide();
                    var data = this.allData;
                    // 设置单体表格数据
                    this.setMonInfoTbl(data);
                    // 设置统计信息表格
                    this.setTotal(data);
                    // 单体个数
                    var monCount = data.monCount;
                    // 设置分页的总数据量
                    this.setPageTotal(monCount);
                    // 获取起始和结束电池单体
                    var startEnd = this.getStartEndIndex();
                    //console.log(data);
                    // 遍历data的值
                    var monNum = []; // 单体编号
                    var monVol = []; // 单体电压
                    var monRes = []; // 单体内阻
                    var monTmp = []; // 单体温度
                    for (var i = startEnd.start; i < startEnd.end; i++) {
                        monNum.push('#' + (i + 1));
                        monVol.push(data.mon_vols[i]);
                        monRes.push(data.mon_ress[i]);
                        monTmp.push(data.mon_tmps[i]);
                    }
                    // 单体电压
                    this.options.monVol.option.categories = monNum;
                    this.options.monVol.option.data = monVol;
                    // 单体内阻
                    this.options.monRes.option.categories = monNum;
                    this.options.monRes.option.data = monRes;
                    // 单体温度
                    this.options.monTmp.option.categories = monNum;
                    this.options.monTmp.option.data = monTmp;
                    // 更新图表
                    this.updateGrahp();
                },
                updateGrahp: function updateGrahp() {
                    // 更新单体电压
                    if (this.tabs.active == 2) {
                        // bui.alert(7788);
                        this.$refs['monVolBar'].setOption(this.options.monVol.option);
                    }
                    // 更新单体内阻
                    if (this.tabs.active == 3) {
                        this.$refs['monResBar'].setOption(this.options.monRes.option);
                    }
                    // 更新单体温度
                    if (this.tabs.active == 4) {
                        this.$refs['monTmpBar'].setOption(this.options.monTmp.option);
                    }
                },
                setBattInfo: function setBattInfo(data) {
                    var battInfo = {
                        sysstate: data.sysstate,
                        sysversion: data.sysversion,
                        battstate: data.battstate,
                        isOutTime: data.isOutTime,
                        groupcurr: data.groupcurr,
                        groupvol: data.groupvol,
                        monCount: data.monCount,
                        testTimelong: data.testTimelong
                    };
                    // 设置电池的信息
                    this.battInfo = battInfo;
                },
                getMaxMinAvg: function getMaxMinAvg(monCount, data, unit) {
                    // 获取较高,较低单体信息和平均值
                    // 构造对象
                    var rs = {
                        min: {
                            text: '#1',
                            val: data[0]
                        },
                        max: {
                            text: '#1',
                            val: data[0]
                        },
                        avg: 0
                    };
                    var sum = data[0];
                    // 遍历monCount
                    for (var i = 1; i < monCount; i++) {
                        // 较大值
                        if (data[i] > rs.max.val) {
                            rs.max.text = "#" + (i + 1);
                            rs.max.val = data[i];
                        } else if (data[i] == rs.max.val) {
                            rs.max.text += ",#" + (i + 1);
                        }
                        // 较小值
                        if (data[i] < rs.min.val) {
                            rs.min.text = "#" + (i + 1);
                            rs.min.val = data[i];
                        } else if (data[i] == rs.min.val) {
                            rs.min.text += ",#" + (i + 1);
                        }
                        sum += data[i];
                    }
                    rs.avg = sum / monCount;
                    return rs;
                },
                confirmStartRes: function confirmStartRes() {
                    var self = this;
                    var num = this.num;
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 确认框
                    this.$confirm('启动内阻测试?', '确认信息', {
                        distinguishCancelAndClose: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        callback: function callback(action, instance) {
                            if (action == 'confirm') {
                                self.startBattResTest(num);
                            }
                        }
                    });
                },
                startBattResTest: function startBattResTest(num) {
                    var self = this;
                    //console.log(num);
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 加载等待
                    this.loading.show();
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.startBattResTest(num);
                    } else {
                        this.battInfo.sysstate = 1;
                        // 提示
                        this.$message({
                            message: '请使用手机端启动!',
                            type: 'warning'
                        });
                        setTimeout(function () {
                            self.loading.hide();
                    },
                    startReadBattMonInfo: function startReadBattMonInfo() {
                        // 开始获取电池组信息
                        var self = this;
                        this.timer.start(function () {
                            self.readBattMonInfo();
                        }, 4000);
                    }
                },
                confirmStopRes: function confirmStopRes() {
                    var self = this;
                    var num = this.num;
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 确认框
                    this.$confirm('停止内阻测试?', '确认信息', {
                        distinguishCancelAndClose: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        callback: function callback(action, instance) {
                            if (action == 'confirm') {
                                self.stopBattResTest(num);
                    },
                    readBattMonInfo: function readBattMonInfo() {
                        // 读取电池组信息
                        var num = this.num;
                        if (num == -1) {
                            return;
                        }
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.readBattMonInfo(num);
                        } else {
                            this.setPageContent({
                                code: 1,
                                data: {
                                    sysstate: 0,
                                    sysversion: 1.2,
                                    battstate: 0,
                                    isOutTime: 0,
                                    groupcurr: 2,
                                    groupvol: 30,
                                    monCount: 4,
                                    testTimelong: 0,
                                    mon_ress: [0.2, 0.3, 1, 2],
                                    mon_tmps: [10, 11, 12, 13],
                                    mon_vols: [14, 16, 18, 20]
                                }
                            });
                            this.timer.open();
                        }
                    },
                    setList: function setList(data) {
                        var list = [];
                        // 遍历data
                        for (var i = 0; i < data.length; i++) {
                            var _data = data[i];
                            _data.text = _data.BattGroupName;
                            if (_data.station_install) {
                                list.push(_data);
                            }
                        }
                    });
                },
                stopBattResTest: function stopBattResTest(num) {
                    var self = this;
                    //console.log(num);
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 加载等待
                    this.loading.show();
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.stopBattResTest(num);
                    } else {
                        this.battInfo.sysstate = 0;
                        // 提示
                        this.$message({
                            message: '请使用手机端停止!',
                            type: 'warning'
                        });
                        // 设置battList的值
                        this.battList = list;
                    },
                    setPageContent: function setPageContent(res) {
                        // 设置所有的数据
                        this.setAllData(res.data);
                        setTimeout(function () {
                            self.loading.hide();
                        }, 4000);
                    }
                },
                confirmRestart: function confirmRestart() {
                    var self = this;
                    var num = this.num;
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 确认框
                    this.$confirm('重启汇集器?', '确认信息', {
                        distinguishCancelAndClose: true,
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        callback: function callback(action, instance) {
                            if (action == 'confirm') {
                                self.reStartSystem(num);
                        // 设置电池组的总体信息
                        this.setBattInfo(res.data);
                        // 设置图标配置项
                        this.setOption();
                    },
                    setMonInfoTbl: function setMonInfoTbl(data) {
                        var monCount = data.monCount;
                        var list = [];
                        var k = -1;
                        // 遍历单体
                        for (var i = 0; i < monCount; i++) {
                            var num = i % 3;
                            if (num == 0) {
                                k++;
                                list[k] = {};
                            }
                            num++;
                            var num_k = 'num' + num;
                            var vol_k = 'vol' + num;
                            var tmp_k = 'tmp' + num;
                            var res_k = 'res' + num;
                            list[k][num_k] = '#' + (i + 1);
                            list[k][vol_k] = data.mon_vols[i];
                            list[k][res_k] = data.mon_ress[i];
                            list[k][tmp_k] = data.mon_tmps[i];
                        }
                    });
                },
                reStartSystem: function reStartSystem(num) {
                    var self = this;
                    //console.log(num);
                    if (num == -1) {
                        this.$message({
                            message: '请先选择电池组',
                            type: 'warning'
                        });
                        return;
                    }
                    // 加载等待
                    this.loading.show();
                    if (typeof DeviceService != 'undefined') {
                        DeviceService.reStartSystem(num);
                    } else {
                        this.battInfo.sysstate = 0;
                        // 提示
                        this.$message({
                            message: '请使用手机端重启!',
                            type: 'warning'
                        });
                        this.tbls.monInfo.data = list;
                    },
                    setTotal: function setTotal(data) {
                        // 单体电压
                        var vol = this.getMaxMinAvg(data.monCount, data.mon_vols);
                        this.setTotalItem(0, vol, 'V', 2);
                        // 单体内阻
                        var res = this.getMaxMinAvg(data.monCount, data.mon_ress);
                        this.setTotalItem(1, res, 'mΩ', 2);
                        // 单体温度
                        var tmp = this.getMaxMinAvg(data.monCount, data.mon_tmps);
                        this.setTotalItem(2, tmp, '℃', 1);
                    },
                    setTotalItem: function setTotalItem(item, data, unit, fixed) {
                        this.tbls.total.data[item].high = data.max.text + ':' + data.max.val + unit;
                        this.tbls.total.data[item].low = data.min.text + ':' + data.min.val + unit;
                        this.tbls.total.data[item].avg = Number(data.avg.toFixed(fixed)) + unit;
                    },
                    setOption: function setOption() {
                        this.loading.hide();
                        var data = this.allData;
                        // 设置单体表格数据
                        this.setMonInfoTbl(data);
                        // 设置统计信息表格
                        this.setTotal(data);
                        // 单体个数
                        var monCount = data.monCount;
                        // 设置分页的总数据量
                        this.setPageTotal(monCount);
                        // 获取起始和结束电池单体
                        var startEnd = this.getStartEndIndex();
                        //console.log(data);
                        // 遍历data的值
                        var monNum = []; // 单体编号
                        var monVol = []; // 单体电压
                        var monRes = []; // 单体内阻
                        var monTmp = []; // 单体温度
                        for (var i = startEnd.start; i < startEnd.end; i++) {
                            monNum.push('#' + (i + 1));
                            monVol.push(data.mon_vols[i]);
                            monRes.push(data.mon_ress[i]);
                            monTmp.push(data.mon_tmps[i]);
                        }
                        // 单体电压
                        this.options.monVol.option.categories = monNum;
                        this.options.monVol.option.data = monVol;
                        // 单体内阻
                        this.options.monRes.option.categories = monNum;
                        this.options.monRes.option.data = monRes;
                        // 单体温度
                        this.options.monTmp.option.categories = monNum;
                        this.options.monTmp.option.data = monTmp;
                        // 更新图表
                        this.updateGrahp();
                    },
                    updateGrahp: function updateGrahp() {
                        // 更新单体电压
                        if (this.tabs.active == 2) {
                            // bui.alert(7788);
                            this.$refs['monVolBar'].setOption(this.options.monVol.option);
                        }
                        // 更新单体内阻
                        if (this.tabs.active == 3) {
                            this.$refs['monResBar'].setOption(this.options.monRes.option);
                        }
                        // 更新单体温度
                        if (this.tabs.active == 4) {
                            this.$refs['monTmpBar'].setOption(this.options.monTmp.option);
                        }
                    },
                    setBattInfo: function setBattInfo(data) {
                        var battInfo = {
                            sysstate: data.sysstate,
                            sysversion: data.sysversion,
                            battstate: data.battstate,
                            isOutTime: data.isOutTime,
                            groupcurr: data.groupcurr,
                            groupvol: data.groupvol,
                            monCount: data.monCount,
                            testTimelong: data.testTimelong
                        };
                        // 设置电池的信息
                        this.battInfo = battInfo;
                    },
                    getMaxMinAvg: function getMaxMinAvg(monCount, data, unit) {
                        // 获取较高,较低单体信息和平均值
                        // 构造对象
                        var rs = {
                            min: {
                                text: '#1',
                                val: data[0]
                            },
                            max: {
                                text: '#1',
                                val: data[0]
                            },
                            avg: 0
                        };
                        var sum = data[0];
                        // 遍历monCount
                        for (var i = 1; i < monCount; i++) {
                            // 较大值
                            if (data[i] > rs.max.val) {
                                rs.max.text = "#" + (i + 1);
                                rs.max.val = data[i];
                            } else if (data[i] == rs.max.val) {
                                rs.max.text += ",#" + (i + 1);
                            }
                            // 较小值
                            if (data[i] < rs.min.val) {
                                rs.min.text = "#" + (i + 1);
                                rs.min.val = data[i];
                            } else if (data[i] == rs.min.val) {
                                rs.min.text += ",#" + (i + 1);
                            }
                            sum += data[i];
                        }
                        rs.avg = sum / monCount;
                        return rs;
                    },
                    confirmStartRes: function confirmStartRes() {
                        var self = this;
                        var num = this.num;
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 确认框
                        this.$confirm('启动内阻测试?', '确认信息', {
                            distinguishCancelAndClose: true,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            callback: function callback(action, instance) {
                                if (action == 'confirm') {
                                    self.startBattResTest(num);
                                }
                            }
                        });
                    },
                    startBattResTest: function startBattResTest(num) {
                        var self = this;
                        //console.log(num);
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 加载等待
                        this.loading.show();
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.startBattResTest(num);
                        } else {
                            this.battInfo.sysstate = 1;
                            // 提示
                            this.$message({
                                message: '请使用手机端启动!',
                                type: 'warning'
                            });
                            setTimeout(function () {
                                self.loading.hide();
                            }, 4000);
                        }
                    },
                    confirmStopRes: function confirmStopRes() {
                        var self = this;
                        var num = this.num;
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 确认框
                        this.$confirm('停止内阻测试?', '确认信息', {
                            distinguishCancelAndClose: true,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            callback: function callback(action, instance) {
                                if (action == 'confirm') {
                                    self.stopBattResTest(num);
                                }
                            }
                        });
                    },
                    stopBattResTest: function stopBattResTest(num) {
                        var self = this;
                        //console.log(num);
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 加载等待
                        this.loading.show();
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.stopBattResTest(num);
                        } else {
                            this.battInfo.sysstate = 0;
                            // 提示
                            this.$message({
                                message: '请使用手机端停止!',
                                type: 'warning'
                            });
                            setTimeout(function () {
                                self.loading.hide();
                            }, 4000);
                        }
                    },
                    confirmRestart: function confirmRestart() {
                        var self = this;
                        var num = this.num;
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 确认框
                        this.$confirm('重启汇集器?', '确认信息', {
                            distinguishCancelAndClose: true,
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            callback: function callback(action, instance) {
                                if (action == 'confirm') {
                                    self.reStartSystem(num);
                                }
                            }
                        });
                    },
                    reStartSystem: function reStartSystem(num) {
                        var self = this;
                        //console.log(num);
                        if (num == -1) {
                            this.$message({
                                message: '请先选择电池组',
                                type: 'warning'
                            });
                            return;
                        }
                        // 加载等待
                        this.loading.show();
                        if (typeof DeviceService != 'undefined') {
                            DeviceService.reStartSystem(num);
                        } else {
                            this.battInfo.sysstate = 0;
                            // 提示
                            this.$message({
                                message: '请使用手机端重启!',
                                type: 'warning'
                            });
                            setTimeout(function () {
                                self.loading.hide();
                            }, 4000);
                        }
                    },
                    setHt: function setHt() {
                        var pgHt = this.$refs.tabItemHt.offsetHeight - 1;
                        this.options.monVol.height = pgHt + 'px';
                        this.options.monRes.height = pgHt + 'px';
                        this.options.monTmp.height = pgHt + 'px';
                        this.tbls.monInfo.height = pgHt + 'px';
                    },
                    handlePreBtn: function handlePreBtn() {
                        var self = this;
                        this.options.page.curr--;
                        this.loading.show();
                        setTimeout(function () {
                            self.loading.hide();
                        }, 4000);
                            // 设置配置项
                            self.setOption();
                        }, 500);
                    },
                    handleNextBtn: function handleNextBtn() {
                        var self = this;
                        this.options.page.curr++;
                        this.loading.show();
                        setTimeout(function () {
                            // 设置配置项
                            self.setOption();
                        }, 500);
                    },
                    initPage: function initPage() {
                        // 初始化图表分页信息
                        // 初始化页数为1
                        this.options.page.curr = 1;
                        // 设置total
                        this.options.page.total = 0;
                    },
                    getStartEndIndex: function getStartEndIndex() {
                        // 根据分页信息获取起始和结束点
                        var page = this.options.page;
                        var start = (page.curr - 1) * page.size;
                        var end = (page.curr - 1) * page.size + page.size;
                        if (end > page.total) {
                            end = page.total;
                        }
                        return {
                            start: start,
                            end: end
                        };
                    },
                    setPageTotal: function setPageTotal(total) {
                        // 设置分页的总数据量
                        this.options.page.total = total;
                        if (total == 0) {
                            this.options.page.pageTotal = 1;
                        } else {
                            this.options.page.pageTotal = Math.ceil(total / this.options.page.size);
                        }
                    }
                },
                setHt: function setHt() {
                    var pgHt = this.$refs.tabItemHt.offsetHeight - 1;
                    this.options.monVol.height = pgHt + 'px';
                    this.options.monRes.height = pgHt + 'px';
                    this.options.monTmp.height = pgHt + 'px';
                    this.tbls.monInfo.height = pgHt + 'px';
                },
                handlePreBtn: function handlePreBtn() {
                    var self = this;
                    this.options.page.curr--;
                    this.loading.show();
                    setTimeout(function () {
                        // 设置配置项
                        self.setOption();
                    }, 500);
                },
                handleNextBtn: function handleNextBtn() {
                    var self = this;
                    this.options.page.curr++;
                    this.loading.show();
                    setTimeout(function () {
                        // 设置配置项
                        self.setOption();
                    }, 500);
                },
                initPage: function initPage() {
                    // 初始化图表分页信息
                    // 初始化页数为1
                    this.options.page.curr = 1;
                    // 设置total
                    this.options.page.total = 0;
                },
                getStartEndIndex: function getStartEndIndex() {
                    // 根据分页信息获取起始和结束点
                    var page = this.options.page;
                    var start = (page.curr - 1) * page.size;
                    var end = (page.curr - 1) * page.size + page.size;
                    if (end > page.total) {
                        end = page.total;
                computed: {
                    getTitle: function getTitle() {
                        return this.title + '-监测数据';
                    },
                    getRestart: function getRestart() {
                        var rs = true;
                        // 电池组状态为浮充,系统状态为常规状态
                        if (this.battInfo.battstate == 0 && this.battInfo.sysstate == 0) {
                            rs = false;
                        }
                        return rs;
                    },
                    getBattNum: function getBattNum() {
                        var rs = "";
                        if (this.num != -1) {
                            rs = '#' + this.num;
                        }
                        return rs;
                    },
                    setPagingPreBtn: function setPagingPreBtn() {
                        var rs = true;
                        if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr <= 1) {
                            return false;
                        }
                        return rs;
                    },
                    setPagingNextBtn: function setPagingNextBtn() {
                        var rs = true;
                        if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr * this.options.page.size >= this.options.page.total) {
                            return false;
                        }
                        return rs;
                    }
                    return {
                        start: start,
                        end: end
                },
                mounted: function mounted() {
                    var self = this;
                    // 页面选项卡
                    var uiTab = bui.tab({
                        id: "#uiTab"
                    });
                    // 选项卡绑定事件
                    uiTab.on('to', function (index) {
                        self.tabs.active = index;
                        self.tabsChange();
                    });
                    // 查询所有已经安装的电池组
                    this.searchAll();
                    // 设置高度
                    this.setHt();
                    // 后台触发事件查询所有的电池组信息
                    window['BattinfServicesearchAllcalljs'] = function (res) {
                        var data = res.data;
                        self.setList(data);
                    };
                    // 后台触发返回读取电池组信息
                    window['DeviceServicereadBattMonInfocalljs'] = function (res) {
                        //console.log(res);
                        // 设置页面信息
                        self.setPageContent(res);
                        // 开启延时执行
                        self.timer.open();
                    };
                    // 启动内阻测试
                    window['DeviceServicestartBattResTestcalljs'] = function (res) {
                        //console.log(res);
                        // 关闭等待
                        self.loading.hide();
                        // 根据返回结果显示内容
                        if (res.code == 1) {
                            self.$message({
                                message: '启动成功!',
                                type: 'success'
                            });
                        } else {
                            self.$message.error('启动失败!');
                        }
                    };
                    // 停止内阻测试
                    window['DeviceServicestopBattResTestcalljs'] = function (res) {
                        //console.log(res);
                        // 关闭等待
                        self.loading.hide();
                        // 根据返回结果显示内容
                        if (res.code == 1) {
                            self.$message({
                                message: '停止成功!',
                                type: 'success'
                            });
                        } else {
                            self.$message.error('停止失败!');
                        }
                    };
                    // 停止内阻测试
                    window['DeviceServicereStartSystemcalljs'] = function (res) {
                        //console.log(res);
                        // 关闭等待
                        self.loading.hide();
                        // 根据返回结果显示内容
                        if (res.code == 1) {
                            self.$message({
                                message: '重启汇集器成功!',
                                type: 'success'
                            });
                        } else {
                            self.$message.error('重启汇集器失败!');
                        }
                    };
                },
                setPageTotal: function setPageTotal(total) {
                    // 设置分页的总数据量
                    this.options.page.total = total;
                    if (total == 0) {
                        this.options.page.pageTotal = 1;
                    } else {
                        this.options.page.pageTotal = Math.ceil(total / this.options.page.size);
                    }
                destroyed: function destroyed() {
                    // 注销方法
                    window.BattinfServicesearchAllcalljs = null;
                    window.DeviceServicereadBattMonInfocalljs = null;
                    window.DeviceServicestartBattResTestcalljs = null;
                    window.DeviceServicestopBattResTestcalljs = null;
                    // 停止计时器
                    this.timer.stop();
                }
            },
            computed: {
                getTitle: function getTitle() {
                    return this.title + '-监测数据';
                },
                getRestart: function getRestart() {
                    var rs = true;
                    // 电池组状态为浮充,系统状态为常规状态
                    if (this.battInfo.battstate == 0 && this.battInfo.sysstate == 0) {
                        rs = false;
                    }
                    return rs;
                },
                getBattNum: function getBattNum() {
                    var rs = "";
                    if (this.num != -1) {
                        rs = '#' + this.num;
                    }
                    return rs;
                },
                setPagingPreBtn: function setPagingPreBtn() {
                    var rs = true;
                    if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr <= 1) {
                        return false;
                    }
                    return rs;
                },
                setPagingNextBtn: function setPagingNextBtn() {
                    var rs = true;
                    if (this.tabs.active == 0 || this.tabs.active == 1 || this.options.page.curr * this.options.page.size >= this.options.page.total) {
                        return false;
                    }
                    return rs;
                }
            },
            mounted: function mounted() {
                var self = this;
                // 页面选项卡
                var uiTab = bui.tab({
                    id: "#uiTab"
                });
                // 选项卡绑定事件
                uiTab.on('to', function (index) {
                    self.tabs.active = index;
                    self.tabsChange();
                });
                // 查询所有已经安装的电池组
                this.searchAll();
                // 设置高度
                this.setHt();
                // 后台触发事件查询所有的电池组信息
                window['BattinfServicesearchAllcalljs'] = function (res) {
                    var data = res.data;
                    self.setList(data);
                };
                // 后台触发返回读取电池组信息
                window['DeviceServicereadBattMonInfocalljs'] = function (res) {
                    //console.log(res);
                    // 设置页面信息
                    self.setPageContent(res);
                    // 开启延时执行
                    self.timer.open();
                };
                // 启动内阻测试
                window['DeviceServicestartBattResTestcalljs'] = function (res) {
                    //console.log(res);
                    // 关闭等待
                    self.loading.hide();
                    // 根据返回结果显示内容
                    if (res.code == 1) {
                        self.$message({
                            message: '启动成功!',
                            type: 'success'
                        });
                    } else {
                        self.$message.error('启动失败!');
                    }
                };
                // 停止内阻测试
                window['DeviceServicestopBattResTestcalljs'] = function (res) {
                    //console.log(res);
                    // 关闭等待
                    self.loading.hide();
                    // 根据返回结果显示内容
                    if (res.code == 1) {
                        self.$message({
                            message: '停止成功!',
                            type: 'success'
                        });
                    } else {
                        self.$message.error('停止失败!');
                    }
                };
                // 停止内阻测试
                window['DeviceServicereStartSystemcalljs'] = function (res) {
                    //console.log(res);
                    // 关闭等待
                    self.loading.hide();
                    // 根据返回结果显示内容
                    if (res.code == 1) {
                        self.$message({
                            message: '重启汇集器成功!',
                            type: 'success'
                        });
                    } else {
                        self.$message.error('重启汇集器失败!');
                    }
                };
            },
            destroyed: function destroyed() {
                // 注销方法
                window.BattinfServicesearchAllcalljs = null;
                window.DeviceServicereadBattMonInfocalljs = null;
                window.DeviceServicestartBattResTestcalljs = null;
                window.DeviceServicestopBattResTestcalljs = null;
                // 停止计时器
                this.timer.stop();
            }
        });
            });
        }, 100);
    },
    destroyed: function destroyed() {
        this.vm.$destroy();