From 5c2a279a7fc9887eb8e56781c36c341f3d8d2ca4 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期四, 25 十月 2018 15:23:40 +0800
Subject: [PATCH] 修改地图每4秒更新50
---
gx_tieta/WebRoot/control.jsp | 300 ++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 171 insertions(+), 129 deletions(-)
diff --git a/gx_tieta/WebRoot/control.jsp b/gx_tieta/WebRoot/control.jsp
index e792f0f..6e87fb6 100644
--- a/gx_tieta/WebRoot/control.jsp
+++ b/gx_tieta/WebRoot/control.jsp
@@ -127,11 +127,6 @@
<table>
<tr>
<td id="ele_content">
- <!-- 鏈烘埧鏁扮數姹犵粍鏁� -->
- <div id="mach_num">
- <s:text name="Room_num"></s:text>:<span id="room_num"></span>; <s:text name="Batt_group_num"></s:text>:<span id="batt_group_num"></span>
- <div style="float: right; margin-right: 5px"><i class="fa"></i></div>
- </div>
<!--鐢垫睜缁勮彍鍗曟爮-->
<div id="lside">
@@ -259,14 +254,14 @@
<div id="right_menu">
<ul>
<li><a href="javascript:"><s:text name="Check_the_battery_card"></s:text></a></li> <!-- 鏌ョ湅鐢垫睜缁勬満鍘嗗崱 -->
- <li><a href="upload.jsp" target="_blank"><s:text name="Upload_FBO/IDC_data"></s:text></a></li> <!-- 涓婁紶'FBO/IDC'鏁版嵁 -->
- <li><a href="uploadresis.jsp" target="_blank"><s:text name="Upload_resistance_conductivity_data"></s:text></a></li> <!-- 涓婁紶鐢甸樆鐢靛鏁版嵁 -->
+ <!-- <li><a href="upload.jsp" target="_blank"><s:text name="Upload_FBO/IDC_data"></s:text></a></li> --> <!-- 涓婁紶'FBO/IDC'鏁版嵁 -->
+ <!-- <li><a href="uploadresis.jsp" target="_blank"><s:text name="Upload_resistance_conductivity_data"></s:text></a></li> --> <!-- 涓婁紶鐢甸樆鐢靛鏁版嵁 -->
<li><a href="eleBrdwMaint.jsp" target="_blank"><s:text name="Batt_failure_maintenance_record_query" /></a></li> <!-- 鐢垫睜鏁呴殰缁存姢璁板綍鏌ヨ -->
<li><a href="javascript:targetBattReport();"><s:text name="Battery_statistical_analysis_queries"></s:text></a></li> <!-- 鐢垫睜缁熻鍒嗘瀽鏌ヨ-->
<!--<li><a href="eleMonomer.jsp"><s:text name="Batt_statistical_analysis_query"></s:text></a></li> 鐢垫睜鍗曚綋缁熻鍒嗘瀽鏌ヨ -->
<li style="display:none;"><a href="javascript:"><s:text name="Search_engine_or_the_batt_group"></s:text></a></li> <!-- 鎼滅储鏈烘埧鎴栫數姹犵粍-->
- <li><a href="javascript:" id="all_show"><s:text name="Expand_all"></s:text></a></li> <!-- 鍏ㄩ儴灞曞紑 -->
+ <!-- <li><a href="javascript:" id="all_show"><s:text name="Expand_all"></s:text></a></li> --> <!-- 鍏ㄩ儴灞曞紑 -->
<li><a href="javascript:" id="all_hide"><s:text name="Collapse_all"></s:text></a></li> <!-- 鍏ㄩ儴鏀剁缉 -->
</ul>
</div>
@@ -291,10 +286,10 @@
<td><s:text name="Computer_room_IP"/></td> <!-- 鏈烘埧IP -->
<td id="StationIP"></td>
</tr>
- <!-- <tr>
- <td><s:text name="Batt_group"/>ID</td> 鐢垫睜缁処D
+ <tr>
+ <td><s:text name="Batt_group"/>ID</td> <!-- 鐢垫睜缁処D -->
<td id="batt_group_id"></td>
- </tr> -->
+ </tr>
<tr>
<td><s:text name="Battery_name"/></td> <!-- 鐢垫睜缁勫悕绉� -->
<td id="BattGroupName"></td>
@@ -868,7 +863,7 @@
//var eMenuWidth = $('#echarts_menu').width();
//$('#echarts_menu').width(eMenuWidth);
- var isnotshowvalue=false; //鏄惁鏄剧ず鏌辩姸鍊�
+ var isnotshowvalue=true; //鏄惁鏄剧ず鏌辩姸鍊�
var mon_res_list; //鐢垫睜鍐呴樆鏁扮粍
var mon_vol_list; //鐢垫睜鐢靛帇鏁扮粍
var mon_ser_list; //鐢垫睜鐢靛鏁扮粍
@@ -981,8 +976,6 @@
var winHt = $(window).height();
var bodyHt = $('body').height();
var batt_listen = $('#ele_content .batt-listen').height();
- //console.info('*****');
- //console.info(batt_listen);
var shiftHt = winHt - bodyHt;
var graph = $('.graph').height();
var lSide = $('#lside').height();
@@ -1020,29 +1013,32 @@
var unit = "";
if(lname == 'Voltage'){
unit ="V";
- max = batt.MonVolStd*1.25;
+ /* max = batt.MonVolStd*1.25;
var tempmax = Math.max.apply( Math, array);
if(tempmax > max){
max = tempmax*1.25;
- }
+ } */
+ max = Math.max.apply( Math, array)*1.1;
max = max.toFixed(3);
}else if(lname == 'Resistance'){
unit = "m惟";
- max = (batt.MonResStd*1.25);
+ /* max = (batt.MonResStd*1.25);
max = 10;
var tempmax = Math.max.apply( Math, array)*1.25;
if(tempmax<max){
max = tempmax;
- }
+ } */
+ max = Math.max.apply( Math, array)*1.1;
max = (max).toFixed(3);
}else if(lname == 'Temperature'){
unit = "鈩�";
- max = (Math.max.apply( Math, array)*1.25).toFixed(3);
+ max = (Math.max.apply( Math, array)*1.5).toFixed(3);
}else if(lname == 'Conductance'){
- max = (batt.MonSerStd*1.25).toFixed(3);
+ //max = (batt.MonSerStd*1.25).toFixed(3);
+ max = (Math.max.apply( Math, array)*1.1).toFixed(3);
}else if(lname == 'MonJHCurr') {
unit = "mA";
- max = (Math.max.apply( Math, array)*1.25).toFixed(3);
+ max = (Math.max.apply( Math, array)*1.1).toFixed(3);
}
//console.info("max:"+max+" min:"+min);
if(lname=='Resistance' || lname=='Temperature'){
@@ -1329,15 +1325,17 @@
}); */
- //灞忚斀娴忚鍣ㄥ彸閿彍鍗曞姛鑳�
+ //灞忚斀娴忚鍣ㄥ彸閿彍鍗曞姛鑳�
$(document).ready(function(){
- document.oncontextmenu=function(){
- return false;
- };
+ // 灞忚斀#lside鐨勫彸閿彍鍗�
+ document.oncontextmenu=function(){
+ return false;
+ };
});
// 鑿滃崟鏍忛紶鏍囧彸閿彍鍗曟樉绀�
$(document).ready(function(){
- $('.thr').mousedown(function(e){
+ $('#ele_content').on('mousedown', '.eleGroup', function(e){
+ alert(123);
//鍒╃敤jquery鐨勬柟寮忚幏鍙栧綋鍓嶇偣鍑荤殑鏄惁鏄彸閿�
if(e.which==3)
{
@@ -1676,17 +1674,20 @@
var array = getArray(lname);
var batt = getBatt();
var min = (Math.min.apply( Math, array)*0.9).toFixed(3);
- var max = 0 ;
+ var max = (Math.max.apply( Math, array)*1.1).toFixed(3);
//console.info(batt);
if(lname == 'Voltage'){
- max = (batt.MonVolStd*1.25).toFixed(3);
+ //max = (batt.MonVolStd*1.25).toFixed(3);
+ max = (Math.max.apply( Math, array)*1.1).toFixed(3);
}else if(lname == 'Resistance'){
//max = (batt.MonResStd*1.25).toFixed(3);
- max =10;
+ //max =10;
+ max = (Math.max.apply( Math, array)*1.1).toFixed(3);
}else if(lname == 'Temperature'){
- max = (Math.max.apply( Math, array)*1.25).toFixed(3);
+ max = (Math.max.apply( Math, array)*1.5).toFixed(3);
}else if(lname == 'Conductance'){
- max = (batt.MonSerStd*1.25).toFixed(3);
+ //max = (batt.MonSerStd*1.25).toFixed(3);
+ max = (Math.max.apply( Math, array)*1.1).toFixed(3);
}
//console.info("max:"+max+" min:"+min);
if(lname=='Resistance' || lname=='Temperature'){
@@ -2010,16 +2011,23 @@
//鏍规嵁褰撳墠閫変腑鐨勭數姹犵粍id鑾峰彇褰撳墠鐢垫睜缁勭殑淇℃伅
function getBatt(){
- if(battinlist!=undefined && BattGroupId!=undefined){
+ /* if(battinlist!=undefined && BattGroupId!=undefined){
for(var i=0;i<battinlist.length;i++){
for(var k=0;k<battinlist[i].length;k++){
if(BattGroupId==battinlist[i][k].BattGroupId){
+ console.info(battinlist);
return battinlist[i][k];
}
}
}
+ } */
+ var activeFile = $('.whyc-sider-menu .sider-menu-file.active');
+ if(activeFile.length == 1) {
+ return activeFile.data('attr');
+ }else {
+ return undefined;
}
- return undefined;
+
}
//灏嗘寚瀹氬垪涓殑涓巚alue鐩哥瓑鐨勫�肩殑鍗曞厓鏍煎彉涓虹孩鑹�
@@ -2669,9 +2677,12 @@
// 瀹炴椂-鍘嗗彶鍒囨崲瀹氫綅鍒板叿浣撶數姹犵粍
$(function() {
- $('body').on('click', '#nav a[href="charge-test.jsp"]', function() {
+ $('body').on('click', '#nav a[href="charge-test.jsp"]', function(event) {
var batt = getBatt();
- $(this).attr('href', 'charge-test.jsp?battgroupId='+BattGroupId+"&stationId="+batt.StationId);
+ var province = batt.StationName1;
+ var city = batt.StationName2;
+ var home = batt.StationName;
+ $(this).attr('href', 'charge-test.jsp?province='+province+'&city='+city+'&home='+home);
});
});
@@ -2699,16 +2710,23 @@
//console.info(model);
if(model.code == 1){
for(var i = 0;i<model.data.length;i++){
- if(model.data[i].batt_test_type == 3){
+ var _data = model.data[i];
+ if(_data.batt_test_type == 3){
arr.push({
- note:model.data[i].note,
- val:model.data[i].BattGroupId,
+ note:_data.note,
+ val:_data.BattGroupId,
+ province: _data.stationName1,
+ city: _data.stationName2,
+ home: _data.stationName,
isCharge:0
});
- }else if(model.data[i].batt_test_type == 2){
+ }else if(_data.batt_test_type == 2){
arr.push({
- note: model.data[i].note,
- val:model.data[i].BattGroupId,
+ note: _data.note,
+ val: _data.BattGroupId,
+ province: _data.stationName1,
+ city: _data.stationName2,
+ home: _data.stationName,
isCharge:1
});
}
@@ -2724,35 +2742,10 @@
});
}
- //鐢熸垚鍏呮斁鐢电洃娴嬫ā鍧楀唴瀹�
- function createBattListen(ele, list) {
- ele.text("");
- var discharge_num = 0;
- var charge_num = 0;
- var ul = $('<ul></ul>');
- for(var i = 0; i < list.length; i++) {
- var li = "";
- if(list[i].isCharge) {
- li = $('<li><a href="javascript:;" class="batt-charge" value="'+list[i].val+'" note="'+list[i].note+'">'+list[i].val+'鐢垫睜缁勫厖鐢垫祴璇�!</a></li>');
- charge_num++;
- }else {
- li = $('<li><a href="javascript:;" class="batt-discharge" value="'+list[i].val+'" note="'+list[i].note+'">'+list[i].val+'鐢垫睜缁勬斁鐢垫祴璇�!</a></li>');
- discharge_num++;
- }
- ul.append(li);
- }
- $('#ele_content .batt-listen .count-num').find('span').eq(0).text(discharge_num);
- $('#ele_content .batt-listen .count-num').find('span').eq(1).text(charge_num);
- ele.append(ul);
- }
+
// 鐐瑰嚮鐢垫睜鍏呮斁鐢电洃娴嬪垪琛ㄨЕ鍙戜簨浠�
$(function() {
- var batt_list = $('#ele_content .batt-listen .batt-list');
- batt_list.on('click', 'a', function(){
- batt_list.find('a').removeClass('active');
- $(this).addClass('active');
- locationBattPos($(this).attr('note'), $(this).attr('value'));
- });
+
});
function BattlocationById(battid){
if(battid!=undefined){
@@ -2876,16 +2869,7 @@
});
});
- //鍏ㄩ儴鏀剁缉
- $('#all_hide').click(function(){
- $('.fir').next().slideUp();
- //$('.sec').next().slideUp();
- $("#lside").scrollTop(0);
- $(".arrow").removeClass("up");
- $(".arrow").addClass("down");
- $(".mark").text("+");
- $(".mark").removeClass("black");
- });
+
});
// 鏄剧ず鐢垫睜鎬绘暟
@@ -3018,51 +3002,8 @@
}
// 鏍规嵁鏈烘埧id鍜岀數姹犵粍id瀹氫綅
- function locationBattPos(stationid, battId) {
- var _firTag = $('#lside .fir[name="'+stationid+'"]');
-
- if(_firTag.next('ul').length == 0) {
- addLoadingToMenu(stationid); // 娣诲姞鏁版嵁鍔犺浇绛夊緟
- $.ajax({
- type: "post",
- url: "BattInfAction!serchBattByStation",
- async:true,
- dataType:'text',
- data:"json = "+JSON.stringify({
- StationId:stationid
- }),
- success: function(data){
- data = eval('('+data+')');
- var model = eval('('+data.result+')');
- removeLoadingMenu(stationid); // 绉婚櫎鏁版嵁鍔犺浇绛夊緟
- if(model.code == 1){
- //console.info(model.data);
- battinlist.push(model.data);
- createLsideSec(model.data, battId);
- }
- },
- error:function(){
-
- }
- });
- }else {
- var _ul = _firTag.next();
- _ul.slideDown();
- _ul.find('.thr').each(function() {
- if($(this).attr('id') == battId) {
- $('#lside a').css('background-color', "");
- $(this).css('background-color', '#9bbaf3');
- BattGroupId = battId;
- location.hash = '#'+battId;
- location.hash = "";
- }
- });
- getBattStr();
- searchBattAlarmParam(); //鏌ヨ鐢垫睜鍛婅鍙傛暟
- clearInterval(time);
- showtable();
- time=window.setInterval("showtable()",4000);
- }
+ function locationBattPos(info) {
+ console.log(info);
}
// 鍚戦〉闈㈢殑宸︿晶娣诲姞鍔犺浇绛夊緟
@@ -3093,7 +3034,7 @@
function getBattStr() {
var battInfo = getBatt();
//console.info(battInfo);
- var battStr = battInfo.StationName+'-'+battInfo.BattGroupName;
+ var battStr = battInfo.StationName+'-'+battInfo.BattGroupName+'-鏍囩О瀹归噺'+battInfo.MonCapStd+'AH';
$('#address_infor').text(battStr);
}
@@ -3376,7 +3317,8 @@
searchBtsBattInfoByStation(temp); // 鏌ヨ鏈烘埧淇℃伅
searchBTSTestParam({
num: CMD_BTS_GetDischargeParm,
- dev_id: batt.FBSDeviceId
+ dev_id: batt.FBSDeviceId,
+ TestCmd: 0
});
BTS_popup.showPopup();
@@ -3408,7 +3350,8 @@
if(regEquipType(batt.FBSDeviceId, globalPattern.BTS)) {
var temp = {
num: CMD_BTS_Stop,
- dev_id: batt.FBSDeviceId
+ dev_id: batt.FBSDeviceId,
+ TestCmd: 0
};
// 鏄剧ず鏄惁鍋滄娴嬭瘯
myConfirm.show({
@@ -3452,7 +3395,8 @@
$('#btn_flush').click(function (){
var temp = {
dev_id:$('#dev_id').val(),
- num:CMD_BTS_GetDischargeParm
+ num:CMD_BTS_GetDischargeParm,
+ TestCmd: 0
};
searchBTSTestParam(temp);
});
@@ -3477,7 +3421,8 @@
// 鏋勯�犲惎鍔ㄦ潯浠�
var temp = {
num: CMD_BTS_Start,
- dev_id: $('#dev_id').val()
+ dev_id: $('#dev_id').val(),
+ TestCmd: $('#discharge_type').val()
};
sendCmdToBTSDev(temp);
});
@@ -3943,7 +3888,10 @@
var second = GLOBAL.pages.siderbar.second; // 浜岀骇瀵艰埅
var third = GLOBAL.pages.siderbar.third; // 涓夌骇瀵艰埅
var fourth = GLOBAL.pages.siderbar.fourth; // 鍥涚骇瀵艰埅
+ var localSideBar = GLOBAL.pages.siderbar.localSideBar; // 瀹氫綅鏈烘埧
var treeView = new TreeView($('#lside'));
+ $('#lside').width($('#ele_content').width());
+ treeView.setContainer();
// 璁剧疆瀹瑰櫒鍙嫋鍔�
$('#ele_content').resizable({
handles: 'e',
@@ -3970,15 +3918,109 @@
third(treeView, $(this).parent(), city);
});
+ battinlist = [];
// 鏈烘埧->鐢垫睜缁�
treeView.ele.on('click', '.home', function() {
var home = $(this).data('attr');
var tmp = {
+ StationName1: home.StationName1,
+ StationName2: home.StationName2,
+ StationName: home.StationName,
StationId: home.StationId
};
- console.info(tmp);
fourth(treeView, $(this).parent(), tmp);
});
+
+ // 鐢垫睜缁�
+ treeView.ele.on('click', '.eleGroup', function() {
+ var eleGroup = $(this).data('attr');
+ // 鏍规嵁BattGroupId鏌ヨ鏁版嵁
+ if(BattGroupId != eleGroup.BattGroupId) {
+ BattGroupId = eleGroup.BattGroupId;
+ // 瀵笲TS9611鍋氱壒娈婄殑澶勭悊
+ var batt = getBatt();
+ //console.info(batt);
+ $('#eleCircleBtn').removeClass('hide');
+ if(regEquipType(batt.FBSDeviceId, globalPattern.BTSSreen)) {
+ var isAct = $('#eleCircleBtn').hasClass('action');
+ if(isAct) {
+ lname = 'Voltage';
+ $('#'+lname).addClass('action');
+ }
+
+ $('#eleCircleBtn').removeClass('action').addClass('hide');
+ $('.ele-circle').hide();
+ $('.graph').show();
+ myChart.resize();
+ }
+ mygraph.ischange = 1; //閲嶆柊缁樺埗鎷撴墤鍥�
+
+ // 璐熻浇鐢垫祦
+ var loadCurr = batt.Load_curr+'A';
+ changeEleCircleOpt(eleCircle, 'loaderCurr', {name:'鏈�澶ц礋杞界數娴侊細'+loadCurr});
+
+ // 鏈�澶ф牳瀹圭數娴�
+ var disCurrMax = batt.DisCurrMax+'A';
+ changeEleCircleOpt(eleCircle, 'disCurrMax', {name:'鏈�澶ф牳瀹圭數娴侊細'+disCurrMax});
+
+ getBattStr();
+ searchBattAlarmParam(); //鏌ヨ鐢垫睜鍛婅鍙傛暟
+ clearInterval(time);
+ showtable();
+ time=window.setInterval("showtable()",4000);
+ }
+ });
+
+ // 鍙抽敭鑿滃崟鏄剧ず
+ treeView.ele.on('mousedown', '.eleGroup', function(e) {
+ //鍒╃敤jquery鐨勬柟寮忚幏鍙栧綋鍓嶇偣鍑荤殑鏄惁鏄彸閿�
+ if(e.which==3)
+ {
+ BattGroupId=$(this).attr("id");
+ var disX=(e||event).clientX+10; //寰楀埌榧犳爣鐐瑰嚮X鐨勪綅缃�
+ var disY=(e||event).clientY+10; //寰楀埌榧犳爣鐐瑰嚮Y鐨勪綅缃�
+ var scrollY=$(window).scrollTop(); //鑾峰彇娴忚鍣ㄦ粴鍔ㄧ殑楂樺害
+ console.log(scrollY);
+ var oRightMenu=document.getElementById("right_menu");
+
+ $(this).click();
+
+ //鏄剧ず鑿滃崟鍐呭
+ $("#right_menu").show();
+ $("#right_menu .more_menu").hide();
+ $("#right_menu .angle").hide();
+ console.log(disX+"***"+disY);
+ //浣胯彍鍗曡窡闅忛紶鏍囦綅缃�
+ oRightMenu.style.left= disX+'px';
+ oRightMenu.style.top= disY+scrollY+'px';
+
+ setPosition($("#right_menu"),disX, disY);
+
+ }
+ });
+
+ //鍏ㄩ儴鏀剁缉
+ $('#all_hide').click(function(){
+ treeView.ele.find('li').removeClass('sider-menu-open');
+ });
+
+ // 鐢垫睜鍏呮斁鐢垫暟鎹洃鎺�
+ var batt_list = $('#ele_content .batt-listen .batt-list');
+ batt_list.on('click', 'a', function(){
+ batt_list.find('a').removeClass('active');
+ $(this).addClass('active');
+ var battInfo = $(this).parent().data('attr');
+
+ var tmp = {
+ province: battInfo.province,
+ city: battInfo.city,
+ home: battInfo.home,
+ homeid: battInfo.note,
+ battid: battInfo.val
+ }
+
+ localSideBar(treeView, treeView.container, tmp);
+ });
});
</script>
<script type="text/javascript" src="js/Title.js"></script>
--
Gitblit v1.9.1