Merge branch 'dev_lxw' of https://gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | </div>
|
| | | </div>
|
| | | </body>
|
| | | <script type="text/javascript">
|
| | | // 检测页面是否被访问
|
| | | var pageIsVisit = false;
|
| | | ;(function($) {
|
| | | // 隐藏的原型
|
| | | var hiddenProperty = 'hidden' in document ? 'hidden' : |
| | | 'webkitHidden' in document ? 'webkitHidden' : |
| | | 'mozHidden' in document ? 'mozHidden' : |
| | | null;
|
| | | |
| | | // 页面初始化
|
| | | if (!document[hiddenProperty]) { |
| | | pageIsVisit = true;
|
| | | }else{
|
| | | pageIsVisit = false;
|
| | | }
|
| | | |
| | | |
| | | var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');
|
| | | var onVisibilityChange = function(){
|
| | | if (!document[hiddenProperty]) { |
| | | pageIsVisit = true;
|
| | | }else{
|
| | | pageIsVisit = false;
|
| | | }
|
| | | }
|
| | | document.addEventListener(visibilityChangeEvent, onVisibilityChange);
|
| | | })(jQuery);
|
| | | </script>
|
| | | <script src="pages/js/base.js"></script>
|
| | | <script src="pages/js/common.js"></script>
|
| | | <script src="js/dev.js"></script>
|
| | |
| | |
|
| | | //查询落后单体总数
|
| | | function searchlowmon(){
|
| | | |
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchlowmon, 5000);
|
| | | return;
|
| | | }
|
| | | |
| | | $.ajax({
|
| | | type: "post",
|
| | | url: "BadBatt_monAction!searchNums",
|
| | |
| | |
|
| | | //查询机房停电总数
|
| | | function searchpoweroffOld(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchpoweroffOld, 5000);
|
| | | return;
|
| | | }
|
| | | |
| | | $.ajax({
|
| | | type: "post",
|
| | | url: "BattPower_offAction!serchPowerOff",
|
| | |
| | |
|
| | | //查询机房停电总数
|
| | | function searchpoweroff(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchpoweroff, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: "post",
|
| | | url: "Bts_station_stateAction_action_serchByState",
|
| | |
| | |
|
| | | //查询设备告警总数
|
| | | function searchdevalarm(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchdevalarm, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: "post",
|
| | | url: "Batt_devalarm_dataAction!searchNums",
|
| | |
| | |
|
| | | //查询放电计划延迟总数
|
| | | function searchnotcomplan(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchnotcomplan, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: "post",
|
| | | url: "BattDischarge_planAction!searchNums",
|
| | |
| | |
|
| | | // 机房续航不足个数
|
| | | function searchWeakHome() {
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchWeakHome, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | |
| | | // 查询所有的设备数
|
| | | searchAllDevNum();
|
| | | function searchAllDevNum() {
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchAllDevNum, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | |
| | | // 查询所有的电池组数
|
| | | searchAllEleGroupNum();
|
| | | function searchAllEleGroupNum() {
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchAllEleGroupNum, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: 'post'
|
| | | ,async: true
|
| | |
| | | * 实时查询告警信息
|
| | | */
|
| | | function searchBattAndDevAlarm(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchBattAndDevAlarm, 3000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type:"post",
|
| | | url: "Battalarm_dataAction!serchTopAlmTen",
|
| | |
| | | seachServerTime();
|
| | | //获取服务器上的时间
|
| | | function seachServerTime(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(seachServerTime, 1000);
|
| | | return;
|
| | | } |
| | | $.ajax({
|
| | | type:"post",
|
| | | url: "User_infAction!searchServerTime",
|
| | |
| | |
|
| | | //查询最近30内的设备和电池告警并播报语音
|
| | | function searchRecentlyAlarm(){
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchRecentlyAlarm, 5000);
|
| | | return;
|
| | | }
|
| | | $.ajax({
|
| | | type: "post",
|
| | | url: "Battalarm_dataAction!serchIn30",
|
| | |
| | | });
|
| | | }
|
| | | })(jQuery);
|
| | | |
| | | </script>
|
| | | </html>
|
| | |
| | | <select id="alarm_type">
|
| | | <option value="0">全部</option>
|
| | | <option value="119020">通信故障</option>
|
| | | <option value="618501">继电器告警</option>
|
| | | <!-- <option value="618501">继电器告警</option>
|
| | | <option value="618502">通讯告警</option>
|
| | | <option value="618503">设备过温告警</option>
|
| | | <option value="618504">二极管D1告警</option>
|
| | |
| | | <option value="119024">基站停电告警</option>
|
| | | <option value="119025">基站发电告警</option>
|
| | | <option value="119026">基站掉站告警</option>
|
| | | <option value="119027">基站开门告警</option>
|
| | | <option value="119027">基站开门告警</option> -->
|
| | | <option value ="119028">设备高温告警</option>
|
| | | <option value ="119032">设备SD卡故障</option>
|
| | | <option value ="119033">采集线告警</option>
|
| | |
| | |
|
| | | // 跳转到实时页面
|
| | | function controlPage(data) {
|
| | | console.log(data);
|
| | | // console.log(data);
|
| | | var home = data.StationName;
|
| | | var province = data.StationName1;
|
| | | var city = data.StationName2;
|
| | |
| | | ,complete: function() {
|
| | | layer.close(load);
|
| | | // 启动自动刷新
|
| | | //updateSearch();
|
| | | updateSearch();
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | //console.log(res);
|
| | | var rs = JSON.parse(res.result);
|
| | | var resData = [];
|
| | | var isUpdateTbl = false;
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | // console.log(data);
|
| | |
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = formaterResData(_data);
|
| | | |
| | | if(_data.apply_note != Page.all) {
|
| | | resData.push(_tmp);
|
| | | Page.setAll(_data.apply_note);
|
| | | isUpdateTbl = true;
|
| | | }
|
| | | }
|
| | | }else {
|
| | | Page.setAll(0);
|
| | | }
|
| | | // console.log(isUpdateTbl);
|
| | | if(isUpdateTbl) {
|
| | | $('#applyNum').text(Page.all); // 设置徽章
|
| | | tOptions.data = resData; // 设置表格的数据
|
| | | |
| | | // 生成表格数据
|
| | | table.reload('pageTbl', tOptions);
|
| | | table.render(tOptions);
|
| | | }
|
| | |
|
| | | // 实时回调
|
| | | updateSearch.timer = setTimeout(updateSearch, 4000);
|
| | |
| | |
|
| | | // 生成表格数据
|
| | | table.render(acceptOptions);
|
| | | console.log(table);
|
| | | // console.log(table);
|
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(load);
|
| | |
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">使用日期</label>
|
| | | <label class="layui-form-label">投入使用日期</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattInUseDate" disabled="" id="usedate" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattInUseDate }}">
|
| | | <input type="text" name="BattInUseDate" id="usedate" autocomplete="off" class="layui-input" value="{{= d.BattInUseDate }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | laydate.render({
|
| | | elem: '#usedate'
|
| | | ,format: 'yyyy-MM-dd HH:mm:ss'
|
| | | ,value: new Date()
|
| | | });
|
| | | });
|
| | |
|
| | |
| | |
|
| | | //需要实时查询的方法
|
| | | function Repeatoperation(){
|
| | | // 判断页面是否正在被访问
|
| | | if(pageIsVisit) {
|
| | | searchBattmaintrecords();
|
| | | searchUserTask();
|
| | | searchAnnounceall();
|
| | | searchTestsCale();
|
| | | |
| | | } |
| | | setTimeout(Repeatoperation,10000);
|
| | | }
|
| | |
|
| | |
| | | if($('#content .warn-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchalarm_data, 10000);
|
| | | return;
|
| | | }
|
| | | |
| | | //生成电池告警率饼状图
|
| | | var $warn=$('#content .pie-con .warn-pie'); //获取告警容器的jquery对象
|
| | | if($warn.length!=0){
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchmaintByMap, 10000);
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断是否为Echarts对象
|
| | | var isEcharts = isObject(brdnPie)?true:false;
|
| | |
|
| | |
| | | if($('#content .repair-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchBatt_maint_inf, 10000);
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断是否为Echarts对象
|
| | | var isEcharts = isObject(repairPie)?true:false;
|
| | | if(!isEcharts) {
|
| | |
| | | if($('#content .health-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchGood, 10000);
|
| | | return;
|
| | | }
|
| | | |
| | | //生成电池健康率
|
| | | var $health=$('#content .pie-con .health-pie'); //获取故障容器的jquery对象
|
| | | if($health.length!=0){
|
| | |
| | | var endurPie;
|
| | | function searchEndurHome() {
|
| | | if($('#content .endur-pie').length==0){
|
| | | return;
|
| | | }
|
| | | |
| | | // 判断页面是否被访问
|
| | | if(!pageIsVisit) {
|
| | | setTimeout(searchEndurHome, 10000);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | var powercut = mapImgDesc.find('.badge-powercut'); // 停电机房
|
| | | var normal = mapImgDesc.find('.badge-normal'); // 正常机房
|
| | | var weak = mapImgDesc.find('.badge-xuhang'); // 续航不足3小时机房
|
| | | console.log(warn.length);
|
| | | // console.log(warn.length);
|
| | | // 请求后台数据
|
| | | $.ajax({
|
| | | type: 'post'
|
| | |
| | | var bmap = GLOBAL.BMap; // BMap的命名空间
|
| | | var updateStationData = [];
|
| | |
|
| | | // 判断是否被访问
|
| | | if(!pageIsVisit) {
|
| | | // 关闭并添加延时执行
|
| | | clearInterval(updateTimeout);
|
| | | updateTimeout = setTimeout(updateStation, 4000);
|
| | | }
|
| | | |
| | | if(isLoad) {
|
| | | updateLoad = layer.load(1);
|
| | | }
|
| | |
| | | var model = new Array();
|
| | | console.info(data);
|
| | | for(var i=0;i<data.length;i++){
|
| | | if(data[i].check_en!=1){
|
| | | arrdata.push(data[i]);//存储数据
|
| | | if(model.length==0){
|
| | | model.push(data[i].binf.StationName);
|
| | | }else{
|
| | | if(model[model.length-1]!=data[i].binf.StationName){
|
| | | if(model[model.length-1]!=data[i].binf.StationName){//若不重复,则PUSH进去
|
| | | model.push(data[i].binf.StationName);
|
| | | }
|
| | | }
|
| | | console.info(model);
|
| | | stationlist=model;
|
| | | }
|
| | | }
|
| | | createUl($('#battList'),model);
|
| | | }
|
| | | |
| | | }
|
| | | });
|
| | | }
|
| | |
| | | $(function () {
|
| | | //setTimes($("#startTestrecord"),'2000-01-01');
|
| | | //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
|
| | | |
| | | installstartdata(temp);//导入初始页面值
|
| | | diubao();//初始丢包率
|
| | | updateinstalldata(temp);//实时更新验收状态
|
| | | timeer = window.setTimeout(function() {
|
| | | diubao();
|
| | | updateinstalldata(temp); |
| | | }, 4000); //丢包率,通信计数,4秒刷新1次。
|
| | | //4秒刷新一次页面
|
| | | getnewnumber(temp[0].binf.FBSDeviceId);
|
| | | updateinstalldata();
|
| | | });
|
| | | var timeer = '';
|
| | |
|
| | | function updateinstalldata(temp){
|
| | | //console.info(temp);
|
| | | |
| | | function updateinstalldata(){
|
| | | console.info(temp);
|
| | | // 清除计时器
|
| | | clearInterval(updateinstalldata.timer);
|
| | | var data=temp[0].binf.StationId;
|
| | | var _data ={ binf:{
|
| | | StationId:data
|
| | |
| | | data: "json="+data,
|
| | | dataType: 'json',
|
| | | success:function(data) {
|
| | | |
| | | data = JSON.parse(data.result);
|
| | | console.info(data);
|
| | | if(data.code==1&&data.data.length>0){
|
| | |
| | | //console.info(data[0].check_en);
|
| | | document.getElementById("check_en").value = yanshou(data[0].check_en);
|
| | | }
|
| | | |
| | | // 更新内容
|
| | | updateinstalldata.timer = setTimeout(function() {
|
| | | updateinstalldata();
|
| | | }, 4000);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | function diubao(){
|
| | | if(temp.length>0){
|
| | | data=temp[0].binf;
|
| | | document.getElementById("tongxunnumber").value = getCookienumber(data.StationId);
|
| | | document.getElementById("diubaonumber").value = getCookiediubao(data.StationId);
|
| | | } |
| | | }
|
| | | function getCookienumber(id){//输入ID,返回通讯计数。数据从缓存获取。
|
| | | var a = getnumber();
|
| | | //console.info(a);
|
| | | if(getCookie("numberget")){
|
| | | var number = getCookie("numberget");
|
| | | number = JSON.parse(number);
|
| | | console.info(number);
|
| | | if(number[0]){
|
| | | for(var i =0; i<number.length;i++){
|
| | | if(id == number[i].dev_id){
|
| | | return number[i].dev_commcount;
|
| | | }
|
| | | } |
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | function getnumber(){ //向获取所有通讯计数并存入缓存
|
| | |
|
| | | function getnewnumber(id){//丢包率,通讯计数
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | |
| | | data: null,
|
| | | dataType: 'json',
|
| | | success:function(data) {
|
| | | console.info(data);
|
| | | data = JSON.parse(data.result);
|
| | | if(data.code==1){
|
| | | console.info(data.data);
|
| | | var json =JSON.stringify(data.data);
|
| | | setCookie("numberget",json);
|
| | | //return data.data; |
| | | data=data.data;
|
| | | console.info(data[0]);
|
| | | for(var i=0;i<data.length;i++){
|
| | | console.info(data[i].dev_id);
|
| | | console.info(id)
|
| | | if(data[i].dev_id==id){
|
| | | console.info(id); |
| | | document.getElementById("tongxunnumber").value = data[i].dev_commcount;
|
| | | var errorCount = data[i].dev_errcommcount;
|
| | | var allCount = data[i].dev_commcount+errorCount;
|
| | | var parcent = (allCount==0?0:errorCount/allCount*100);
|
| | | console.info(parcent);
|
| | | document.getElementById("diubaonumber").value = parcent;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | function getCookiediubao(id){ //丢包率
|
| | | if(getCookie("numberget")){
|
| | | var number = getCookie("numberget");
|
| | | number = JSON.parse(number);
|
| | | console.info(number);
|
| | | if(number[0]){
|
| | | for(var i =0; i<number.length;i++){
|
| | | if(id == number[i].dev_id){
|
| | | var errorCount = number[i].dev_errcommcount;
|
| | | var allCount = number[i].dev_commcount+errorCount;
|
| | | var parcent = (allCount==0?0:errCount/allCount*100)
|
| | | return parcent;
|
| | | }
|
| | | } |
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | |
| | | // 格式化提交后台信息的对象数组并返回 单个修改,手机方式不修改多个电池组
|
| | | function getUpdateArr(){
|
| | | mon=$('#MonVolStd').val();
|
| | |
| | | //window.location.href="control.html";
|
| | | });
|
| | | });
|
| | |
|
| | | function nullOrn(){
|
| | | |
| | | return true;
|
| | | |
| | | |
| | | }
|
| | |
|
| | | function editBatt(){//
|
| | | console.info(getUpdateArr());
|
| | |
| | | },
|
| | | };
|
| | | console.info(temp);
|
| | | searchBattLife(temp)
|
| | | |
| | | |
| | | searchBattLife(temp); |
| | | }
|
| | | // 查询内容
|
| | | function searchBattLife(temp){
|