whychdw
2019-12-03 4b308edb97d55d834bba88754e4a755b677e2b64
关闭计时器
2个文件已修改
86 ■■■■ 已修改文件
platforms/android/app/src/main/assets/www/pages/main/main.js 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/main/main.js 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/main/main.js
@@ -96,7 +96,7 @@
                    }
                },
                setBattDiscInfo: function setBattDiscInfo(res) {
                    //console.log(res);
                    console.log(res);
                    // 对数据进行处理
                    this.tbls.discharge.data = this.formaterTestData(res);
                    // 统计个数
@@ -147,7 +147,7 @@
                    }
                },
                setBattCharInfo: function setBattCharInfo(res) {
                    //console.log(res);
                    console.log(res);
                    // 对数据进行处理
                    this.tbls.charge.data = this.formaterTestData(res);
                    // 统计个数
@@ -215,6 +215,7 @@
                },
                setAlarmInfo: function setAlarmInfo(res) {
                    // 设置实时告警信息
                    console.info(res);
                    if (res.code == 1) {
                        var page = this.tbls.warning.page;
                        // 设置数据
@@ -249,6 +250,26 @@
                    // 查询电池告警信息
                    this.startSearchAlarmInfo();
                },
                startTimers: function startTimers() {
                    // 启动页面的所有计时器
                    // 查询放电信息
                    this.startReadBattDiscInfo();
                    // 查询充电测试信息
                    this.startReadBattCharInfo();
                    // 查询告警
                    this.startSearchAlarmInfo();
                },
                stopTimers: function stopTimers() {
                    // 停止页面的所有计时器
                    // 告警中
                    this.tbls.warning.timer.stop();
                    // 充电中
                    this.tbls.charge.timer.stop();
                    // 放电中
                    this.tbls.discharge.timer.stop();
                },
                routerTo: function routerTo(path) {
                    var routes = this.routes;
                    var url = "";
@@ -279,15 +300,6 @@
                var self = this;
                this.setTblsHt();
                // 查询放电信息
                this.startReadBattDiscInfo();
                // 查询充电测试信息
                this.startReadBattCharInfo();
                // 查询告警
                this.startSearchAlarmInfo();
                // 后台触发事件查询所有的电池组放电信息
                window['DeviceServicereadBattDiscInfocalljs'] = function (res) {
                    // 设置电池信息
@@ -314,6 +326,15 @@
            destroyed: function destroyed() {}
        });
    },
    show: function show() {
        // 开启计时器
        this.vm.startTimers();
        //bui.alert('show');
    },
    hide: function hide() {
        // 关闭计时器
        this.vm.stopTimers();
    },
    destroyed: function destroyed() {
        this.vm.$destroy();
    }
www/pages/main/main.js
@@ -96,7 +96,7 @@
                    }
                },
                setBattDiscInfo: function setBattDiscInfo(res) {
                    //console.log(res);
                    console.log(res);
                    // 对数据进行处理
                    this.tbls.discharge.data = this.formaterTestData(res);
                    // 统计个数
@@ -147,7 +147,7 @@
                    }
                },
                setBattCharInfo: function setBattCharInfo(res) {
                    //console.log(res);
                    console.log(res);
                    // 对数据进行处理
                    this.tbls.charge.data = this.formaterTestData(res);
                    // 统计个数
@@ -215,6 +215,7 @@
                },
                setAlarmInfo: function setAlarmInfo(res) {
                    // 设置实时告警信息
                    console.info(res);
                    if (res.code == 1) {
                        var page = this.tbls.warning.page;
                        // 设置数据
@@ -249,6 +250,26 @@
                    // 查询电池告警信息
                    this.startSearchAlarmInfo();
                },
                startTimers: function startTimers() {
                    // 启动页面的所有计时器
                    // 查询放电信息
                    this.startReadBattDiscInfo();
                    // 查询充电测试信息
                    this.startReadBattCharInfo();
                    // 查询告警
                    this.startSearchAlarmInfo();
                },
                stopTimers: function stopTimers() {
                    // 停止页面的所有计时器
                    // 告警中
                    this.tbls.warning.timer.stop();
                    // 充电中
                    this.tbls.charge.timer.stop();
                    // 放电中
                    this.tbls.discharge.timer.stop();
                },
                routerTo: function routerTo(path) {
                    var routes = this.routes;
                    var url = "";
@@ -279,15 +300,6 @@
                var self = this;
                this.setTblsHt();
                // 查询放电信息
                this.startReadBattDiscInfo();
                // 查询充电测试信息
                this.startReadBattCharInfo();
                // 查询告警
                this.startSearchAlarmInfo();
                // 后台触发事件查询所有的电池组放电信息
                window['DeviceServicereadBattDiscInfocalljs'] = function (res) {
                    // 设置电池信息
@@ -314,6 +326,15 @@
            destroyed: function destroyed() {}
        });
    },
    show: function show() {
        // 开启计时器
        this.vm.startTimers();
        //bui.alert('show');
    },
    hide: function hide() {
        // 关闭计时器
        this.vm.stopTimers();
    },
    destroyed: function destroyed() {
        this.vm.$destroy();
    }