From e981cf16e8eb437542985840342a49f64ce145fc Mon Sep 17 00:00:00 2001
From: whychdw <49690745@qq.com>
Date: 星期五, 20 十二月 2019 14:55:55 +0800
Subject: [PATCH] 修改内容

---
 platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js |  856 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 855 insertions(+), 1 deletions(-)

diff --git a/platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js b/platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js
index 9a390c3..5905250 100644
--- a/platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js
+++ b/platforms/android/app/src/main/assets/www/pages/monitor-data/monitor-data.js
@@ -1 +1,855 @@
-"use strict";
\ No newline at end of file
+'use strict';
+
+/**
+ * 妯℃澘妯″潡
+ * 榛樿妯″潡鍚�: monitor-data
+ * @return {[object]}  [ 杩斿洖涓�涓璞� ]
+ */
+loader.define({
+    data: {
+        vm: ''
+    },
+    loaded: function loaded(require, exports, module) {
+        // 瀹氫箟F2chart
+        var monVolBar = '';
+        var monResBar = '';
+        var monTmpBar = '';
+        // 寮曞叆vue
+        this.vm = new Vue({
+            el: getPageRoot(module),
+            data: {
+                shows: {
+                    monList: false,
+                    total: false,
+                    monVol: false,
+                    monRes: false,
+                    monTmp: false,
+                    monResLine: false
+                },
+                loading: bui.loading(),
+                open: true,
+                uiDialog: '',
+                num: -1,
+                BattGroupId: -1,
+                title: '??',
+                battInfo: {
+                    sysstate: 0,
+                    sysversion: 1.2,
+                    battstate: 0,
+                    isOutTime: 1,
+                    groupcurr: 0,
+                    groupvol: 0,
+                    monCount: 0,
+                    testTimelong: 0
+                },
+                battList: [{
+                    num: 1,
+                    BattGroupId: 1,
+                    text: '鐢垫睜缁�1'
+                }, {
+                    num: 2,
+                    BattGroupId: 2,
+                    text: '鐢垫睜缁�2'
+                }],
+                tabs: {
+                    active: 0
+                },
+                timer: new Timeout(),
+                tbls: {
+                    monInfo: {
+                        height: '300px',
+                        data: []
+                    },
+                    total: {
+                        data: [{
+                            type: '鐢靛帇',
+                            high: '',
+                            low: '',
+                            avg: ''
+                        }, {
+                            type: '鍐呴樆',
+                            high: '',
+                            low: '',
+                            avg: ''
+                        }, {
+                            type: '娓╁害',
+                            high: '',
+                            low: '',
+                            avg: ''
+                        }]
+                    }
+                },
+                options: {
+                    page: {
+                        curr: 1, // 褰撳墠椤�
+                        size: 50, // 姣忛〉鐨勬暟鎹噺
+                        pageTotal: 1, // 鎬婚〉鏁�
+                        total: 0 // 鏁版嵁鎬婚噺
+                    },
+                    monVol: { // 鍗曚綋鐢靛帇
+                        title: new Title(),
+                        height: "300px",
+                        option: []
+                    },
+                    monRes: { // 鍗曚綋鍐呴樆
+                        title: new Title(),
+                        height: "300px",
+                        option: {
+                            categories: [],
+                            data: []
+                        }
+                    },
+                    monResLine: { // 鍗曚綋鍐呴樆鎶樼嚎鍥�
+                        title: '',
+                        option: []
+                    },
+                    monTmp: { // 鍗曚綋娓╁害
+                        title: new Title(),
+                        height: "300px",
+                        option: []
+                    }
+                },
+                allData: []
+            },
+            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 = '鍐呴樆娴嬭瘯';
+                            break;
+                        case 2:
+                            rs = '缂栧潃妯″紡';
+                            break;
+                    }
+                    return rs;
+                },
+                formatSeconds: function (_formatSeconds) {
+                    function formatSeconds(_x) {
+                        return _formatSeconds.apply(this, arguments);
+                    }
+
+                    formatSeconds.toString = function () {
+                        return _formatSeconds.toString();
+                    };
+
+                    return formatSeconds;
+                }(function (num) {
+                    return formatSeconds(num);
+                })
+            },
+            methods: {
+                setAllData: function setAllData(data) {
+                    this.allData = data;
+                },
+                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;
+                    // 璁剧疆鐢垫睜缁刬d
+                    this.BattGroupId = item.BattGroupId;
+
+                    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.11111,
+                                groupvol: 30.444444,
+                                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);
+                        }
+                    }
+                    // 璁剧疆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({
+                            x: '#' + (i + 1),
+                            y: data.mon_vols[i]
+                        });
+                        monRes.push({
+                            x: '#' + (i + 1),
+                            y: data.mon_ress[i]
+                        });
+                        monTmp.push({
+                            x: '#' + (i + 1),
+                            y: data.mon_tmps[i]
+                        });
+                    }
+                    // 鍗曚綋鐢靛帇
+                    this.options.monVol.option = monVol;
+
+                    // 鍗曚綋鍐呴樆
+                    this.options.monRes.option = monRes;
+
+                    // 鍗曚綋娓╁害
+                    this.options.monTmp.option = monTmp;
+
+                    // 鏇存柊鍥捐〃
+                    this.updateGrahp();
+                },
+                updateGrahp: function updateGrahp() {
+                    // 鏇存柊鍗曚綋鐢靛帇
+                    if (this.tabs.active == 2) {
+                        // bui.alert(7788);
+                        monVolBar.changeData(this.options.monVol.option);
+                    }
+
+                    // 鏇存柊鍗曚綋鍐呴樆
+                    if (this.tabs.active == 3) {
+                        monResBar.changeData(this.options.monRes.option);
+                    }
+
+                    // 鏇存柊鍗曚綋娓╁害
+                    if (this.tabs.active == 4) {
+                        monTmpBar.changeData(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;
+                    if (this.options.page.curr <= 1) {
+                        this.$message('褰撳墠宸茬粡鏄涓�椤�');
+                        return;
+                    }
+                    this.options.page.curr--;
+                    this.loading.show();
+                    setTimeout(function () {
+                        // 璁剧疆閰嶇疆椤�
+                        self.setOption();
+                    }, 500);
+                },
+                handleNextBtn: function handleNextBtn() {
+                    var self = this;
+                    if (this.options.page.curr * this.options.page.size >= this.options.page.total) {
+                        this.$message('褰撳墠宸茬粡鏄渶鍚庝竴椤�');
+                        return;
+                    }
+                    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);
+                    }
+                },
+                monHandlerClick: function monHandlerClick(event) {
+                    var self = this;
+                    var page = this.options.page;
+                    var monNum = event.point.index + 1 + (page.curr - 1) * page.size;
+                    this.options.monResLine.title = '鍗曚綋#' + monNum + '鍐呴樆鎶樼嚎鍥�';
+                    // 鏋勯�犳煡璇㈠璞�
+                    var searchParams = {
+                        BattGroupId: this.BattGroupId,
+                        mon_num: monNum
+                    };
+                    // 寮�鍚瓑寰呮
+                    this.loading.show();
+                    if (typeof BattresdataService != "undefined") {
+                        BattresdataService.serchByCondition(JSON.stringify(searchParams));
+                    } else {
+                        setTimeout(function () {
+                            self.loading.hide();
+                            self.setMonResLine([{
+                                mon_res: 10,
+                                test_starttime: '2019-12-03 10:09:00'
+                            }, {
+                                mon_res: 11,
+                                test_starttime: '2019-12-03 11:09:00'
+                            }, {
+                                mon_res: 9,
+                                test_starttime: '2019-12-03 12:09:00'
+                            }]);
+                            self.uiDialog.open();
+                        }, 1000);
+                    }
+                },
+                setMonResLine: function setMonResLine(data) {
+                    var monRes = [[]];
+                    var times = [];
+                    // 閬嶅巻data
+                    for (var i = 0; i < data.length; i++) {
+                        var _data = data[i];
+                        monRes[0].push(_data.mon_res);
+                        times.push(_data.test_starttime);
+                    }
+                    this.options.monResLine.categories = times;
+                    this.options.monResLine.data = monRes;
+                    // 璁剧疆閰嶇疆椤�
+                    this.$refs.monResLine.setOption(this.options.monResLine);
+                }
+            },
+            created: function created() {
+                var self = this;
+                // 鏄剧ず宸︿晶寮瑰嚭妗�
+                setTimeout(function () {
+                    self.shows.drawer = true;
+                }, 0);
+                // 鏄剧ず鍗曚綋鍒楄〃
+                setTimeout(function () {
+                    self.shows.monList = true;
+                }, 0);
+                // 鏄剧ず缁熻淇℃伅
+                setTimeout(function () {
+                    self.shows.total = true;
+                }, 0);
+                // 鏄剧ず鍗曚綋鐢靛帇
+                setTimeout(function () {
+                    self.shows.monVol = true;
+                }, 0);
+                // 鏄剧ず鍗曚綋鍐呴樆
+                setTimeout(function () {
+                    self.shows.monRes = true;
+                }, 0);
+                // 鏄剧ず鍗曚綋娓╁害
+                setTimeout(function () {
+                    self.shows.monTmp = true;
+                }, 0);
+                // 鏄剧ず鍗曚綋鍐呴樆鎶樼嚎
+                setTimeout(function () {
+                    self.shows.monResLine = true;
+                }, 0);
+            },
+            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",
+                    animate: false,
+                    swipe: false
+                });
+
+                // 閫夐」鍗$粦瀹氫簨浠�
+                uiTab.on('to', function (index) {
+                    self.tabs.active = index;
+                    self.tabsChange();
+                });
+
+                // 鍒涘缓 Chart 瀵硅薄
+                monVolBar = new FGraph(this.$refs.monVolBar);
+                monResBar = new FGraph(this.$refs.monResBar);
+                monTmpBar = new FGraph(this.$refs.monTmpBar);
+
+                // 鑷畾涔夊眳涓脊鍑烘
+                this.uiDialog = bui.dialog({
+                    id: "#dialogCenter",
+                    width: 700
+                });
+
+                // 鏌ヨ鎵�鏈夊凡缁忓畨瑁呯殑鐢垫睜缁�
+                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('閲嶅惎姹囬泦鍣ㄥけ璐ワ紒');
+                    }
+                };
+
+                // 鑾峰彇鍗曚綋鍐呴樆淇℃伅
+                window['BattresdataServiceserchByConditioncalljs'] = function (res) {
+                    console.log(res);
+                    // 鍏抽棴绛夊緟
+                    self.loading.hide();
+                    // 鏍规嵁杩斿洖缁撴灉鏄剧ず鍐呭
+                    if (res.code == 1) {
+                        self.setMonResLine(res.data);
+                    } else {
+                        self.setMonResLine([]);
+                    }
+                    // 鏄剧ず闈㈡澘
+                    self.uiDialog.open();
+                };
+            },
+
+            destroyed: function destroyed() {
+                // 娉ㄩ攢鏂规硶
+                window.BattinfServicesearchAllcalljs = null;
+                window.DeviceServicereadBattMonInfocalljs = null;
+                window.DeviceServicestartBattResTestcalljs = null;
+                window.DeviceServicestopBattResTestcalljs = null;
+                // 鍋滄璁℃椂鍣�
+                this.timer.stop();
+            }
+        });
+    },
+    destroyed: function destroyed() {
+        this.vm.$destroy();
+    }
+});
\ No newline at end of file

--
Gitblit v1.9.1