From f71a10a225a333986afeca437b2b84a49f40818e Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期二, 03 十二月 2019 13:34:03 +0800 Subject: [PATCH] Merge branch 'FBS9600' of http://whyclxw@118.89.139.230:10101/r/FBS9600App.git into FBS9600 --- platforms/android/app/src/main/assets/www/pages/main/main.js | 122 ++++++++++++++++++++++++++++++++-------- 1 files changed, 97 insertions(+), 25 deletions(-) diff --git a/platforms/android/app/src/main/assets/www/pages/main/main.js b/platforms/android/app/src/main/assets/www/pages/main/main.js index e1e0eab..3795647 100644 --- a/platforms/android/app/src/main/assets/www/pages/main/main.js +++ b/platforms/android/app/src/main/assets/www/pages/main/main.js @@ -23,9 +23,15 @@ }, tbls: { warning: { + timer: new Timeout(), name: '鍛婅淇℃伅', height: 300, noData: '鏆傛棤鍛婅鏁版嵁', + page: { + PageSize: 10, + PageCurr: 1, + PageAll: 0 + }, data: [] }, charge: { @@ -72,13 +78,17 @@ this.setBattDiscInfo({ code: 1, data: [{ - num: 1, - BattGroupName: '鐢垫睜缁�1', - BattGroupName1: '鐢垫睜缁�', - testStartTime: '2019-11-23 14:48:00', - testTimelong: 20, - groupvol: 10, - groupcurr: 5 + battinf: { + num: 1, + BattGroupName: '鐢垫睜缁�1', + BattGroupName1: '鐢垫睜缁�' + }, + state: { + testStartTime: '2019-11-23 14:48:00', + testTimelong: 20, + groupvol: 10, + groupcurr: 5 + } }] }); // 寮�鍚鏃跺櫒 @@ -86,9 +96,9 @@ } }, setBattDiscInfo: function setBattDiscInfo(res) { - console.log(res); + //console.log(res); // 瀵规暟鎹繘琛屽鐞� - this.tbls.discharge.data = res.data; + this.tbls.discharge.data = this.formaterTestData(res); // 缁熻涓暟 this.tabs.discharge = res.data.length; }, @@ -106,21 +116,30 @@ this.setBattCharInfo({ code: 1, data: [{ - num: 2, - BattGroupName: '鐢垫睜缁�2', - BattGroupName1: '鐢垫睜缁�', - testStartTime: '2019-11-23 14:48:00', - testTimelong: 30, - groupvol: 11, - groupcurr: 4 + battinf: { + num: 2, + BattGroupName: '鐢垫睜缁�2', + BattGroupName1: '鐢垫睜缁�' + }, + state: { + testStartTime: '2019-11-23 14:48:00', + testTimelong: 30, + groupvol: 11, + groupcurr: 4 + } }, { - num: 5, - BattGroupName: '鐢垫睜缁�5', - BattGroupName1: '鐢垫睜缁�', - testStartTime: '2019-11-23 14:50:40', - testTimelong: 30, - groupvol: 11, - groupcurr: 4 + battinf: { + num: 5, + BattGroupName: '鐢垫睜缁�5', + BattGroupName1: '鐢垫睜缁�' + }, + state: { + testStartTime: '2019-11-23 14:50:40', + testTimelong: 30, + groupvol: 11, + groupcurr: 4 + } + }] }); // 寮�鍚鏃跺櫒 @@ -128,11 +147,58 @@ } }, setBattCharInfo: function setBattCharInfo(res) { - console.log(res); + //console.log(res); // 瀵规暟鎹繘琛屽鐞� - this.tbls.charge.data = res.data; + this.tbls.charge.data = this.formaterTestData(res); // 缁熻涓暟 this.tabs.charge = res.data.length; + }, + formaterTestData: function formaterTestData(res) { + var rs = []; + if (res.code == 1) { + var data = res.data; + for (var i = 0; i < data.length; i++) { + var _data = data[i]; + var tmp = { + num: _data.battinf.num, + BattGroupName: _data.battinf.BattGroupName, + BattGroupName1: _data.battinf.BattGroupName1, + testStartTime: new Date(_data.state.testStartTime).format('yyyy-MM-dd hh:mm:ss'), + testTimelong: formatSeconds(_data.state.testTimelong), + groupvol: _data.state.groupvol, + groupcurr: _data.state.groupcurr + }; + rs.push(tmp); + } + } + return rs; + }, + startSearchAlarmInfo: function startSearchAlarmInfo() { + var self = this; + this.tbls.warning.timer.start(function () { + self.searchAlarmInfo(); + }, 4000); + }, + searchAlarmInfo: function searchAlarmInfo() { + // 鏌ヨ瀹炴椂鍛婅淇℃伅 + var self = this; + var page = this.warning.page; + // 鏋勯�犳煡璇㈡潯浠� + var searchParams = { + alm_cleared_type: 0, + page: page + }; + // 鍒ゆ柇鏄惁涓烘墜鏈虹 + if (typeof Battalram_dataService == "undefined") { + Battalram_dataService.serchByCondition(JSON.stringify(searchParams)); + } else { + // 寮�鍚鏃跺櫒 + this.tbls.charge.timer.open(); + } + }, + setAlarmInfo: function setAlarmInfo(res) { + // 璁剧疆瀹炴椂鍛婅淇℃伅 + console.log(res); }, routerTo: function routerTo(path) { var routes = this.routes; @@ -178,6 +244,12 @@ // 寮�鍚鏃跺櫒 self.tbls.charge.timer.open(); }; + + // 鏌ヨ鍛婅淇℃伅 + window['Battalram_dataServiceserchByConditioncalljs'] = function (res) { + // 寮�鍚鏃跺櫒 + self.tbls.charge.timer.open(); + }; }, destroyed: function destroyed() {} }); -- Gitblit v1.9.1