hdw
2018-10-25 3d175b70811d8da4258aa0ec6cc6d79ff912b36f
gx_tieta/WebRoot/control.jsp
@@ -254,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>
@@ -286,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>                        电池组ID
            <tr>
               <td><s:text name="Batt_group"/>ID</td>                        <!-- 电池组ID -->
               <td id="batt_group_id"></td>
            </tr> -->
            </tr>
            <tr>
               <td><s:text name="Battery_name"/></td>               <!-- 电池组名称 -->
               <td id="BattGroupName"></td>
@@ -863,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;         //电池电导数组
@@ -1013,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'){
@@ -1322,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)
                {
@@ -1420,7 +1425,7 @@
      //根据设备id查询设备当前的开关状态
      function searchDevStatusByDev_id(){
         var obj = getBatt();
         //console.info(obj);
         console.info(obj);
         var lasttype = mygraph.graphtype;   //记录上一次的状态
         $.ajax({    
              type: "post",             
@@ -1433,7 +1438,8 @@
              success: function(data){ 
               data = eval("("+data+")");
               var model = eval("("+data.result+")");
               //console.log(model);
               console.log(model);
               var outTime = 2*60;            //设备超时时间(2分钟)
               var isOutTime = true;         //通讯中断      判断设备是否通讯中断    true:中断    false:正常
               var batt = getBatt();         //获取当前选中的电池组
@@ -1445,6 +1451,8 @@
               }else {
                  _str = GLOBAL.circleStatus.BTSCircle(batt, model, mygraph, updateEleCircle);
               }
               console.log(mygraph);
               debugger;
               if(model.code == 1) {
                  var nowTime = new Date().getTime();      //当前时间
                  var record = new Date(model.data[0].record_datetime).getTime();
@@ -1669,17 +1677,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'){
@@ -2669,9 +2680,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 +2713,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 +2745,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 +2872,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 +3005,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 +3037,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 +3320,8 @@
               searchBtsBattInfoByStation(temp);   // 查询机房信息
               searchBTSTestParam({
                  num: CMD_BTS_GetDischargeParm,
                  dev_id: batt.FBSDeviceId
                  dev_id: batt.FBSDeviceId,
                  TestCmd: 0
               });
               BTS_popup.showPopup();
               
@@ -3408,7 +3353,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 +3398,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 +3424,8 @@
            // 构造启动条件
            var temp = {
               num: CMD_BTS_Start,
               dev_id: $('#dev_id').val()
               dev_id: $('#dev_id').val(),
               TestCmd: $('#discharge_type').val()
            };
            sendCmdToBTSDev(temp);
         });
@@ -3943,6 +3891,7 @@
         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();
@@ -3977,6 +3926,9 @@
         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
            };
            fourth(treeView, $(this).parent(), tmp);
@@ -3990,7 +3942,7 @@
               BattGroupId = eleGroup.BattGroupId;
               // 对BTS9611做特殊的处理
               var batt = getBatt();
               console.info(batt);
               //console.info(batt);
               $('#eleCircleBtn').removeClass('hide');
               if(regEquipType(batt.FBSDeviceId, globalPattern.BTSSreen)) {
                  var isAct = $('#eleCircleBtn').hasClass('action');
@@ -4006,13 +3958,73 @@
               }
               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);
               mygraph.graphtype = 4;
               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>