D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore
2019-01-18 2fe250ece8de95b3f70172fe5b45793ab6a3084a
gx_tieta/WebRoot/equip-stats-change.jsp
@@ -10,17 +10,18 @@
     <!-- 默认使用最高内核 -->
   <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
    <base href="<%=basePath%>">
    <title><s:text name="Device_status_records_query"/></title>            <!-- 设备状态记录查询 -->
    <title><s:text name="Device_history_event_query"/></title>            <!-- 设备状态记录查询 -->
   <link rel="stylesheet" href="css/basic.css">
   <link rel="stylesheet" type="text/css" href="css/nocontent.css">
   <link rel="stylesheet" type="text/css" href="css/loading.css">
   <link rel="stylesheet" type="text/css" href="css/basic-layout.css"/>
   <link rel="stylesheet" href="css/common.css">
   <link rel="stylesheet" type="text/css" href="css/popup-tbl.css">
   <link rel="stylesheet" href="src/css/layui.css">
   <style>
      #lside {
         position: absolute;
         top: 0;
         top: 30px;
         left: 0;
         bottom: 0;
         right: 0;
@@ -36,13 +37,20 @@
   <jsp:include page="nav.jsp" flush="true"/>
   <div class="page-content">
      <div class="content-item side-bar-container">
         <div class="siderbar-tools">
            <div class="siderbar-tools-right">
               <i class="fa fa-file-text-o" title="机历卡" id="siderbarToolsCard"></i>
               <i class="fa fa-search" title="查询机房" id="siderbarToolsSearch"></i>
               <i class="fa fa-outdent" title="全部收缩" id="siderbarToolsHide"></i>
            </div>
         </div>
         <div class="lside" id="lside"></div>
      </div>
      <div class="content-item data-show">
         <div class="data-container">
            <!-- 筛选条件 -->
            <div class="filter-container">
               <div class="filter-title"><a href="javascript:changeFilterStats();"><s:text name="Device_status_records_query"/>--&gt;<s:text name="Show/hide_the_query_conditions"/></a></div>   <!-- 显示或隐藏查询条件 -->
               <div class="filter-title"><a href="javascript:changeFilterStats();"><s:text name="Device_history_event_query"/>--&gt;<s:text name="Show/hide_the_query_conditions"/></a></div>   <!-- 显示或隐藏查询条件 -->
               <div class="filter-content">
                  <table>
                     <tbody>
@@ -109,12 +117,43 @@
         </div>
      </div>
   </div>
   <div class="popup"></div>
   <!-- 导航定位  -->
   <div class="popup w500 mr250" id="localNav">
      <div class="popup-title"><span>机房查询</span><a href="javascript:;" class="close">X</a></div>
      <div class="popup-content">
         <div class="popup-tbl">
            <table>
               <tbody>
                  <tr>
                     <th>机房名称/机房id</th>
                  </tr>
                  <tr>
                     <td>
                        <input name="popupHomeName" id="popupHomeName" type="text">
                     </td>
                  </tr>
               </tbody>
            </table>
         </div>
      </div>
      <div class="popup-footer">
         <input type="button" name="" id="localNav_en" class="status-change-btn" value="确定" > <!-- 确定 -->
         <input type="button" name="" class="close" value="取消" >            <!-- 取消 -->
      </div>
   </div>
   <!-- iframe数据临时存储位置 -->
   <div id="homeInfoIframeData"></div>
   <script type="text/javascript" src="src/layui.all.js"></script>
   <script type="text/javascript" src="jqueryui/jquery-ui.min.js"></script>
   <script type="text/javascript" src="js/equip-stats-change.jquery.ui.js"></script>
   <script type="text/javascript" src="js/basic-layout.js"></script>
   <script type="text/javascript" src="pages/js/pages/siderbar.js"></script>
   <script type="text/javascript" src="js/pageUtil.js"></script>
   <script type="text/javascript" src="src/layui.all.js"></script>
   <script type="text/javascript" src="js/popup.js"></script>
   <script type="text/javascript" src="pages/js/pages/homeInfo.js"></script>
   <script type="text/javascript">
      var arrTh = [];
      var arrTd = [];
@@ -125,9 +164,20 @@
      };
      var layerMsg;
      
      var localNav = new Popup($('#localNav'));
      // 初始化localNav弹出框
      $('#localNav').find('.close').bind('click', function() {
         localNav.hidePopup();   // 隐藏localNav弹出框和遮罩层
      });
      // 窗口大小改变
      $(window).resize(function() {
         localNav.hidePopup();
      });
      // 生成页面中的表格
      $(function () {
         arrTh = ['设备Id', '机房名称', '变迁前状态', '变迁后状态', '变迁原因', '变迁时间'];
         arrTh = ['设备Id', '机房名称', '事件类型', '变迁前状态', '变迁后状态', '变迁原因','模块编号','变迁时间'];
         createFullTbl($('.tbl-header'), $('.tbl-body'), arrTh, arrTd);
         var stop_types = [
            '手动停止', '暂停', '正在放电测试', '正在等待放电', '正在限流放电', 
@@ -183,15 +233,18 @@
              success: function(data){ 
               data = eval('('+data+')');
               var model = eval('('+data.result+')');
               //console.info(model);
               console.info(model);
               if(model.code == 1){
                  for(var i=0;i<model.data.length;i++){
                     arrTd.push(model.data[i].dev_id);                  //设备id
                     arrTd.push(model.data[i].note);                     //机房名称
                     arrTd.push(model.data[i].last_stat_name);            //变换前状态
                     arrTd.push(model.data[i].now_stat_name);            //变化后状态
                     arrTd.push(model.data[i].state_change_reason_name);      //变换原因
                     arrTd.push(model.data[i].rec_time);                  //变换时间
                  for(var i=0;i<model.data.length;i++){
                     var _data = model.data[i];
                     arrTd.push(_data.dev_id);                  //设备id
                     arrTd.push(_data.note);                     //机房名称
                     arrTd.push(_data.eve_type_name);            //变迁前事件类型
                     arrTd.push(_data.last_stat_name);            //变换前状态
                     arrTd.push(_data.now_stat_name);            //变化后状态
                     arrTd.push(_data.state_change_reason_name);      //变换原因
                     arrTd.push(_data.module_num);                                 //模块编号
                     arrTd.push(_data.rec_time);                  //变换时间
                     
                     if(model.data[i].page != undefined){                     
                        Page.pageAll = model.data[i].page.pageAll;         //总记录条数
@@ -209,6 +262,28 @@
               createFullTbl($('.tbl-header'), $('.tbl-body'), arrTh, arrTd);         
              }             
         });
       }
       // 事件类型
       function getTextByVal(num) {
          var _num = Number(num);
          var rs = '';
          switch(_num){
             case 0:
                rs = 'BTS工作状态:';
             break;
             case 11:
                rs = 'SD卡故障:';
             break;
             case 12:
                rs = '电池离线状态:';
             break;
             case 20:
                rs = 'DCDC模块告警状态:';
             break;
          }
          return rs;
       }
       
       /**
@@ -317,6 +392,8 @@
         var second = GLOBAL.pages.siderbar.second;   // 二级导航
         var third = GLOBAL.pages.siderbar.third;   // 三级导航
         var fourth = GLOBAL.pages.siderbar.fourth;   // 四级导航
         var fifth = GLOBAL.pages.siderbar.fifth;   // 五级导航
         var localSideBar = GLOBAL.pages.siderbar.localSideBar;   // 定位机房
         var treeView = new TreeView($('#lside'));
         $('#lside').width($('#ele_content').width());
         treeView.setContainer();
@@ -340,11 +417,19 @@
            second(treeView, $(this).parent(), province);
         });
         
         // 市->机房
         // 市->区/县
         treeView.ele.on('click', '.city', function() {
            var city = $(this).data('attr');
            third(treeView, $(this).parent(), city);
         });
         // 市->机房
         treeView.ele.on('click', '.county', function() {
            var city = $(this).data('attr');
            fourth(treeView, $(this).parent(), city);
         });
         
         battinlist = [];
         // 机房->电池组
@@ -353,19 +438,117 @@
            var tmp = {
               StationName1: home.StationName1,
               StationName2: home.StationName2,
               StationName5: home.StationName5,
               StationName: home.StationName,
               StationId: home.StationId
            };
            fourth(treeView, $(this).parent(), tmp);
            fifth(treeView, $(this).parent(), tmp);
         });
         
         // 电池组
         treeView.ele.on('click', '.eleGroup', function() {
            var eleGroup = $(this).data('attr');
            searchDevHistoryRecord();
         });
         // 工具条-全部收缩
         $('#siderbarToolsHide').click(function(){
            treeView.ele.find('li').removeClass('sider-menu-open');
         });
         // 工具条-机历卡
         $('#siderbarToolsCard').click(function(){
            var batt = getBatt();
            var tmp = {
               province: batt.StationName1,
               city: batt.StationName2,
               county: batt.StationName5,
               home: batt.StationName,
               homeid: batt.StationId,
               battid: batt.BattGroupId
            };
            // 显示基站机历卡
            showHomeInfo(batt.StationId);
            // 根据数据定位
            localSideBar(treeView, treeView.container, tmp);
         });
         // 工具条-查询
         $('#siderbarToolsSearch').click(function(){
            localNav.homeInfo = undefined;
            $('#popupHomeName').val('');
            localNav.showPopup();
         });
         // 点击面板的确定按钮
         $('#localNav_en').click(function() {
            // 定位
            if(localNav.homeInfo) {
               localNav.hidePopup();
               localSideBar(treeView, treeView.container, localNav.homeInfo);
            }else {
            }
         });
         // 查询机房并更新source
         var homeSource = [];
         findHome();
         // 定义机房查询信息
         $( "#popupHomeName" ).autocomplete({
            source: homeSource,
            select: function(event, ui) {
               localNav.homeInfo = ui.item;   // 设置机房信息内容
            }
         });
         // 查询机房
         function findHome() {
            var tmp = {
               StationName1:'',
               StationName2: '',
               StationName5:''
            };
            // 查询将信息
            $.post("BattInfAction!serchStationName3","json="+JSON.stringify(tmp),function(result){
               var rs = JSON.parse(result.result);
               if(rs.code==1){
                  homeSource = [];
                  var data = rs.data;
                  for(var i=0; i<data.length; i++) {
                     var _data = data[i];
                     var tmp = {
                        label: _data.StationName+'('+_data.StationId+')',
                        province: _data.StationName1,
                        city: _data.StationName2,
                        county: _data.StationName5,
                        home: _data.StationName,
                        homeid: _data.StationId,
                        battid: undefined
                     };
                     // 添加到资源
                     homeSource.push(tmp);
                  }
                  $( "#popupHomeName" ).autocomplete('option', 'source', homeSource);
               }
            });
         }
      });
      //根据当前选中的电池组id获取当前电池组的信息
      function getBatt(){
         var activeFile = $('.whyc-sider-menu .sider-menu-file.active');
         if(activeFile.length == 1) {
            return activeFile.data('attr');
         }else {
            return undefined;
         }
      }
   </script>
  </body>
</html>