hdw
2018-11-14 5b91f290dea4d6b6c1f159e28e0159e32aa5ac53
gx_tieta/WebRoot/js/base.js
@@ -380,17 +380,17 @@
      //data=eval("("+data+")");
      data=data.result;
      data=eval("("+data+")");
      console.info(data);
      //console.info(data);
      if(data.code==1){
         if(data.data.length>0){
            data=data.data[0];
            document.getElementById("StationId").innerHTML=data.StationId;               //机房id
            document.getElementById("StationName").innerHTML=data.StationName;            //机房名称
            document.getElementById("StationIP").innerHTML=data.StationIp;               //机房ip
            //document.getElementById("batt_group_id").innerHTML=data.BattGroupId;         //电池组ip
            document.getElementById("batt_group_id").innerHTML=data.BattGroupId;         //电池组ip
            
            document.getElementById("BattGroupName").innerHTML=data.BattGroupName;         //电池组名称
            document.getElementById("BattGroupNum").innerHTML=data.BattGroupNum;         //电池组序号
            document.getElementById("BattGroupNum").innerHTML=data.GroupIndexInFBSDevice+1;         //电池组序号
            document.getElementById("BattProducer").innerHTML=data.BattProducer;         //电池品牌
            document.getElementById("BattModel").innerHTML=data.BattModel;               //电池型号
            document.getElementById("MonCapStd").innerHTML=data.MonCapStd;               //标称容量
@@ -422,6 +422,64 @@
   });
}
//根据stationid查询基站的信息
function findStationInfoByStation(temp){
   console.info(JSON.stringify(temp));
   $.ajax({
        type:"post",
        url: "Battinf_exAction!serchByCondition",
        async:true,
        dataType:'json',
        data:"json="+JSON.stringify(temp),
        success: function(data){
         var model = eval('('+data.result+')');
         console.log(model);
         if(model.code == 1 && model.data.length>0){
            var station = model.data[0];
            //console.info(station);
            $('#station_stationid_ex').text(temp.StationId_ex);                                 //站点id
            $('#station_stationname').text(station.stationName);                              //机房名称
            $('#station_stationid').text(station.stationId);                                 //机房名称
            $('#station_affiliation').text(station.affiliation);                              //所属组织
            $('#station_dataSources').text(station.dataSources);                              //数据来源
            $('#station_stationType').text(station.stationType);                              //站址类型
            $('#station_jinweidu').text("经度:" + station.longitude+";纬度:"+station.latitude);         //经纬度
            $('#station_stationAddr').text(station.stationAddr);                              //所在地址
            $('#station_stationstate').text("站址等级:"+station.stationLevel+";维护状态:"+station.maintenanceState+";封锁状态:"+(station.blockedState==0?'否':'是'));         //机房状态
            $('#station_maintenanceCompany').text(station.maintenanceCompany);                                                                        //维护单位
            $('#station_stationscenario').text("业务场景:"+station.businessScenario+";覆盖场景:"+station.CoverScenario+";站址地形:"+station.siteTerrain);                  //站址场景
            $('#station_stationproperty').text("产权性质:"+station.propertyRights+";(原)产权单位:"+station.propertyUnit+";是否共享:"+(station.isShare==1?'是':'否'));         //站址产权
            $('#station_useUnit').text(station.useUnit);                              //使用单位
            $('#station_siteCode').text(station.siteCode);                              //物理站址编码
            $('#station_historySiteCode').text(station.historySiteCode);                  //历史物理站址编码
            $('#station_siteInternalNumber').text(station.siteInternalNumber);               //站址内部编号
            $('#station_sitePinyinReferred').text(station.sitePinyinReferred);               //站址拼音简称
            $('#station_siteChineseReferred').text(station.siteChineseReferred);            //中文简称
            $('#station_isOpenBusiness').text(station.isOpenBusiness);                     //是否开通业务
            $('#station_schoolPersonnel').text(station.schoolPersonnel);                  //录入人员
            $('#station_entryTime').text(station.entryTime);                           //录入时间
            $('#station_modifyPeople').text(station.modifyPeople);                        //修改人
            $('#station_modifyTime').text(station.modifyTime);                           //修改时间
            $('#station_note').text(station.note);                                    //备注
            $('#station_receiveorvalidity').text("站址接收标记:"+(station.siteReceivesMark==1?'是':'否')+";是否有效:"+(station.siteValidity==1?'是':'否'));                                    //备注
            $('#station_siteNameCMCC').text(station.siteNameCMCC);                        //移动站址名称
            $('#station_siteNameCTC').text(station.siteNameCTC);                        //联通站址名称
            $('#station_siteNameCUCC').text(station.siteNameCUCC);                        //电信站址名称
            $('#station_producer').text(station.producer);                              //品牌
            $('#station_lastTimeLong').text(station.lastTimeLong);                        //续航测算时长
            $('#station_lastTimeType').text(station.lastTimeType);                        //续航测算类别
            $('#station_lastTimeDate').text(station.lastTimeDate);                        //续航发生时间
            $('#station_shareInfo').text(station.shareInfo);                           //共享情况
            $('#station_electPower').text("移动购买:"+(station.electPowerCMCC==1?'是':'否')+";电信购买:"+(station.electPowerCTC==1?'是':'否')+";联通购买:"+(station.electPowerCUCC==1?'是':'否'));                           //共享情况
            $('#station_isCanElectPower').text(station.isCanElectPower==1?'是':'否');         //是否具备发电条件
            $('#station_upperStationRoute').text(station.upperStationRoute);               //上站路程
            $('#station_upperStationDifficult').text(station.upperStationDifficult);         //上站难易程度
            $('#station_clienteleErrorService').text(station.clienteleErrorService);         //客户问题库未完成蓄电池维修
         }
       }
   });
}
   
//根据num获取故障类型和故障排除方法
@@ -506,8 +564,9 @@
function getQueryString(name) { 
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
   var r = window.location.search.substr(1).match(reg); 
   if (r != null)
      return unescape(r[2]);
   if (r != null) {
      return decodeURI(r[2]);
   }
   return null; 
}
@@ -1091,52 +1150,6 @@
   }
}
/**
  检测服务器连接是否正常
  程序功能: 通过请求后台程序如果三次都请求失败认为服务器挂掉,跳转到登陆页面
*/
;(function ($) {
   var url = window.location.href;
   var loginPatt = /\/login.jsp/;
   // 判断当前页面不是登陆页面开始执行检测服务器状态
   if(!loginPatt.test(url)) {
      checkServer();
   }
   var linkNum = 0;    // 测试服务器连接计数 =3 跳转到登陆页面
   function checkServer() {
       $.ajax({
           url:'User_infAction!checkService',
           type: 'post',
           async: true,
           success: function(rs) {
               linkNum = 0;    // 初始化测试连接
               setTimeout(checkServer, 200);
           },
           error:function() {
                // 网络连接不正常
               if(!navigator.onLine) {
                    linkNum = 0;
                    setTimeout(checkServer, 200);
               }else{
                   linkNum++;
                    // 服务器连接不正常
                    if(linkNum == 3) {
                       console.info('出现第'+linkNum+"次测试服务器连接失败!跳转到登陆");
                       // 网络正常但服务器连续多次检测不正常跳转到登陆页面
                      alert('服务器运行异常,请查看服务器是否正在运行!');
                       window.location.replace("login.jsp");
                    }else {
                       console.info('出现第'+linkNum+"次测试服务器连接失败!");
                       checkServer();
                    }
               }
           }
       });
   }
})(jQuery);
/*****************常用判断数据类型*****************/
//是否为数字
@@ -1176,4 +1189,29 @@
// 判断是否为对象
function isObject(s) {
   return (typeof s === 'object' && !isArray(s));
}
//使用XMLHttpRequest的方式获取模板页
function getTpl(url) {
   var xmlhttp;   // 实例化XMLHttpRequest对象
   if(window.XMLHttpRequest) {
      xmlhttp = new XMLHttpRequest();
   }else {
      xmlhttp = new ActiveXObject('Mocrosoft.XMLHTTP');
   }
   // 设置请求
   xmlhttp.open('GET', url, false);
   // 发送请求
   xmlhttp.send();
   var tpl;
   if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
      tpl = xmlhttp.responseText;
   }else {
      tpl = "";
   }
   return tpl;
}