| | |
| | |
|
| | | //根据stationid查询基站的信息
|
| | | function findStationInfoByStation(temp){
|
| | | //console.info(temp);
|
| | | console.info(JSON.stringify(temp));
|
| | | $.ajax({
|
| | | type:"post",
|
| | | url: "Battinf_exAction!serchByCondition",
|
| | |
| | | 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);
|
| | | //console.info(station);
|
| | | $('#station_stationid_ex').text(temp.StationId_ex); //站点id
|
| | | $('#station_stationname').text(station.stationName); //机房名称
|
| | | $('#station_stationid').text(station.stationId); //机房名称
|
| | |
| | | return '格式不正确';
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | 检测服务器连接是否正常
|
| | | 程序功能: 通过请求后台程序如果三次都请求失败认为服务器挂掉,跳转到登陆页面
|
| | | */
|
| | | ;(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);
|
| | |
|
| | | /*****************常用判断数据类型*****************/
|
| | |
|