From 0bd6f98d8c1c6cdaf767a0d60a49bd87ad3abc49 Mon Sep 17 00:00:00 2001
From: chenjingjing <chenjingjing@192.168.10.3>
Date: 星期四, 27 十二月 2018 16:50:24 +0800
Subject: [PATCH] 连接实时数据bug
---
gx_tieta/WebRoot/mobil/batt-life-manage.html | 154 ++++++++++++++++++++++++++------------------------
1 files changed, 80 insertions(+), 74 deletions(-)
diff --git a/gx_tieta/WebRoot/mobil/batt-life-manage.html b/gx_tieta/WebRoot/mobil/batt-life-manage.html
index e4bc74f..27af0ba 100644
--- a/gx_tieta/WebRoot/mobil/batt-life-manage.html
+++ b/gx_tieta/WebRoot/mobil/batt-life-manage.html
@@ -110,14 +110,14 @@
<option value="">鍏ㄩ儴</option>
</select>
<p>鎺夌珯</p>
- <select id="" data-mini="true">
- <option value="">鍏ㄩ儴</option>
+ <select id="is_stand" data-mini="true">
+ <option value=100>鍏ㄩ儴</option>
<option value=1>鏄�</option>
<option value=0>鍚�</option>
</select>
<p>瀹為檯缁埅鏃堕棿</p>
- <select id="" data-mini="true">
- <option value="">鍏ㄩ儴</option>
+ <select id="actual_timelong" data-mini="true">
+ <option value=0>鍏ㄩ儴</option>
<option value=60>瀹為檯缁埅鏃堕棿灏忎簬1灏忔椂</option>
<option value=120>瀹為檯缁埅鏃堕棿灏忎簬2灏忔椂</option>
<option value=180>瀹為檯缁埅鏃堕棿灏忎簬3灏忔椂</option>
@@ -160,12 +160,15 @@
$('document').ready(function(){panel.show();});
var arr=new Array(); //褰撳墠琛ㄦ牸td鏁版嵁
+ var tblCon = $('.tbl-container');
var Page = {
pageSize:10, //姣忛〉鐨勮鏁�
pageCurr:1, //褰撳墠椤电爜鏁�
pageAll:0,
};
-
+
+ $('document').ready(function(){panel.show();});
+
var arrTh = [ '璁惧ID', '鏈烘埧鍚嶇О', '瀹為檯瀹归噺','鏍囩О瀹归噺','瀹為檯鐢垫祦','瀹為檯缁埅鏃堕棿(min)','鐞嗚缁埅鏃堕棿(min)','鏄惁鎺夌珯'];
dataArr = [];
var startTime = "1980-01-01";
@@ -176,80 +179,70 @@
setPage();
$("#submit").click(function(){
Page.pageCurr=1;
- searchBadBatt();
+ searchBattLife();
});
});
-
- //鏌ヨ鐢垫睜淇℃伅
- function searchBadBatt(){
- loadshow();
- var stationid = $("#station_name").find('option:selected').attr('stationid')?$("#station_name").find('option:selected').attr('stationid'):'';
- var temp = createSearchForm();
- console.info(stationid);
- /*var temp = {
- StationName1:$("#station_name1").val(),
- StationName2:$("#city").val(),
- StationName5: $("#county").val(),
- StationName: $("#station_name").val(),
- StationId: stationid
- };*/
- //console.info(temp);
- var json = JSON.stringify(temp);
- //console.info(json);
- arrTd = new Array();
- $.post("Batt_Maint_DealarmAction_serchByConditionNew","result="+json,function(data){
- data=eval("("+data.result+")");
- //console.info(data);
- if(data.code==1 && data.data.length>0){
- data=data.data;
- //console.info(data);
- arr=new Array();
- index=0;
- for(var i=0;i<data.length;i++){
- Page.pageAll=data[i].Size;
- arr[index++]=data[i].BattGroupId; //鐢垫睜缁刬d
- arr[index++]=data[i].StationName; //鏈烘埧鍚嶇О
- arr[index++]=data[i].StationIp; //鏈烘埧IP
- arr[index++]=data[i].BattGroupName; //鐢垫睜缁勫悕绉�
- arr[index++]=data[i].BattGroupNum; //鐢垫睜缁勫簭鍙�
-
- }
- //console.info(Page);
- createTbl(tbl, arrTh, arr);
-
- }else{
- $('#searchNull').popup('open');
- Page.pageAll = 0;
- }
- setPage();
- //console.info(Page);
- loadclose();
- }).error(function(){
- loadclose();
- $('#searchErr').popup('open');
- });
-
- }
+
-
+ // 鏌ヨ鍐呭
+ function searchBattLife(){
+ var temp = createSearchParam();
+ var json = JSON.stringify(temp);
+ arrTd = new Array();
+ var load;
+ /*if() {
+ load = layer.load(1);
+ }*/
+ $.ajax({
+ type:"post",
+ url:"Batt_enduranceAction!serchByCondition",
+ async:true,
+ datatype:'json',
+ data:"json="+json,
+ success:function(data){
+ console.info(data);
+ var data = JSON.parse(data.result);
+ //layer.close(load);
+ if(data.code==1&&data.data.length>0){
+ data=data.data;
+ var index = 0;
+ var ArryTb= new Array();
+ for(i=0;i<data.length;i++){
+ arrTd[index++]=data[i].deviceId;
+ arrTd[index++]=data[i].stationName;
+ arrTd[index++]=data[i].real_cap;
+ arrTd[index++]=data[i].moncapstd;
+ arrTd[index++]=data[i].real_curr;
+ arrTd[index++]=data[i].endurance_actual_timelong;
+ arrTd[index++]=data[i].endurance_theory_timelong;
+ if(data[i].is_out_stand==0){ //鏈帀绔�(缁胯壊)
+ arrTd[index++]='鍚�';
+ }
+ else if(data[i].is_out_stand==1){
+ arrTd[index++]='鏄�';
+ }
+ //arrTd[index++]=data[i].is_out_stand;
+ }
+ Page.pageAll = data[data.length-1].page.pageAll;
+ }else{
+ Page.pageAll = 0;
+ }
+ setPage();
+ //console.info(Page.pageAll);
+ createTbl(tblCon, arrTh, arrTd);
+ }
+ });
+ }
function createSearchForm(){
var temp={
- page:{
- pageCurr:Page.pageCurr,
- pageSize:Page.pageSize,
- },
- binf:{
+ page:Page,
StationName1:$('#mainteArea').val(),
StationName2:$('#city').val(),
StationName5:$('#country').val(),
- StationName:$('#homeName').val()
-
-
- },
-
-
-
+ StationName:$('#homeName').val(),
+ is_out_stand:$('#is_stand').val(), //鏄惁鎺夌珯
+ endurance_actual_timelong:$('#actual_timelong').val(),
};
return temp;
}
@@ -433,15 +426,28 @@
findStationNamebyStationname1();
});
-
+ //鏋勯�犳煡璇㈡潯浠�
+ function createSearchParam(){
+ var temp = {
+ page:Page,
+ stationName1:$('#mainteArea').val(),
+ stationName2:$('#city').val(),
+ stationName5: $('#country').val(),
+ stationName:$('#homeName').val(),
+ is_out_stand:$('#is_stand').val(), //鏄惁鎺夌珯
+ endurance_actual_timelong:$('#actual_timelong').val(), //瀹為檯
+ };
+ console.info(temp);
+ return temp;
+
+ }
-
$(function() {
//鐐瑰嚮涓婁竴椤�
$('.pre-page').on('click', 'a', function() {
if(Page.pageCurr>1){
Page.pageCurr = Page.pageCurr - 1;
- searchBadBatt();
+ searchBattLife();
}
});
@@ -450,7 +456,7 @@
var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
if(Page.pageCurr<pageNum){
Page.pageCurr = Page.pageCurr + 1;
- searchBadBatt();
+ searchBattLife();
}
});
});
--
Gitblit v1.9.1