From 1229c0030c8bb76ee89b9c08c074315b4bbfd44a Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.9>
Date: 星期一, 26 十一月 2018 15:16:54 +0800
Subject: [PATCH] 首页上电池告警率加入容量更换和容量告警告警
---
gx_tieta/WebRoot/Top.jsp | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 100 insertions(+), 15 deletions(-)
diff --git a/gx_tieta/WebRoot/Top.jsp b/gx_tieta/WebRoot/Top.jsp
index 0e52f03..ed8a59f 100644
--- a/gx_tieta/WebRoot/Top.jsp
+++ b/gx_tieta/WebRoot/Top.jsp
@@ -64,7 +64,7 @@
<div class="batt-state">
<div class="list">
- <div class="list-contain"><s:text name='Computer_room'/><s:text name='Power_cut'/><s:text name='Num'/>:<a href="batt-state-manage.jsp?station_state=2" class="badge default" id="poweroff_num">0</a></div> <!-- 鏈烘埧鍋滅數鏁� -->
+ <div class="list-contain"><s:text name='Power_cut'/><s:text name='Computer_room'/><s:text name='Num'/>:<a href="batt-state-manage.jsp?station_state=2" class="badge default" id="poweroff_num">0</a></div> <!-- 鏈烘埧鍋滅數鏁� -->
</div>
<div class="list">
<div class="list-contain"><s:text name="Batt"/><s:text name="Alarm"/><s:text name="Num"/>:<a href="elewarn.jsp" class="badge danger" id="batt_alarm_num">0</a></div> <!-- 鐢垫睜鍛婅鏁� -->
@@ -84,7 +84,7 @@
</c:forEach>
<div class="list">
<div class="list-contain">
- 鏍稿娴嬭瘯璁惧:<a href="javascript:void(0);" class="badge default" id="nuclear_test">0</a>
+ 鏍稿娴嬭瘯璁惧鏁�:<a href="javascript:void(0);" class="badge default" id="nuclear_test">0</a>
</div>
</div>
</div>
@@ -127,9 +127,9 @@
<div class="cell-list plan-ele">
<img src="image/webStatus/plan_normal.gif" alt="鏀剧數璁″垝鐩戞祴绾跨▼" title="鏀剧數璁″垝鐩戞祴绾跨▼锛氭甯�">
</div>
- <div class="cell-list break-ele">
+ <div class="cell-list break-ele" style="display: none;">
<img src="image/webStatus/break_ele_normal.gif" alt="鏈烘埧鍋滅數鐩戞祴绾跨▼" title="鏈烘埧鍋滅數鐩戞祴绾跨▼锛氭甯�">
- </div>
+ </div>
<div class="cell-list control">
<img src="image/webStatus/control_normal.gif" alt="绾跨▼鐩戞帶绋嬪簭" title="绾跨▼鐩戞帶绋嬪簭杩愯锛氭甯�">
</div>
@@ -194,6 +194,7 @@
<script src="js/createTab.js"></script>
<script type="text/javascript" src="js/scrollBar.js"></script>
<script type="text/javascript" src="js/VoiceUtil.js"></script>
+ <script type="text/javascript" src="js/rightmenu.js"></script>
<script type="text/javascript">
$(document).ready(function(){
setUserName(); //璁剧疆鐢ㄦ埛鍚嶇О
@@ -557,7 +558,7 @@
//鏌ヨ鐢垫睜鍛婅淇℃伅
function searchBattAlarm(data){
- //console.info(data);
+ console.info(data);
$.ajax({
type:"post",
url: "Battalarm_dataAction!serchBatt_alarm",
@@ -574,16 +575,17 @@
var model = eval('('+data.result+')');
if(model.code == 1){
var obj = model.data[0];
- //console.info(obj);
+ console.info(obj);
if(obj.alm_cleared_type == 0){
//瀹炴椂鍛婅
- window.open("elewarn.jsp?stationId="+obj.stationid+"&battgroupId="+obj.BattGroupId);
+ window.open("elewarn.jsp?home="+obj.stationname+"&battid="+obj.BattGroupId);
}else{
//鍘嗗彶鍛婅
- window.open("eleHistoryWarn.jsp?stationId="+obj.stationid+"&battgroupId="+obj.BattGroupId);
+ window.open("eleHistoryWarn.jsp?home="+obj.stationname+"&battid="+obj.BattGroupId);
}
}else{
- alert("璇ュ憡璀﹀凡缁忚鍒犻櫎");
+ alert("璇ュ憡璀﹀凡缁忔仮澶�");
+ //window.open("eleHistoryWarn.jsp?home="+obj.stationname+"&battid="+obj.BattGroupId);
}
}
});
@@ -609,12 +611,12 @@
var obj = model.data[0];
console.info(obj);
if(obj.alm_cleared_type == 0){
- window.open("equipWarn1.jsp");
+ window.open("equipWarn1.jsp?home="+obj.stationName);
}else{
- window.open("equipHistWarn1.jsp?stationId="+obj.stationId);
+ window.open("equipHistWarn1.jsp?home="+obj.stationName);
}
}else{
- alert("璇ュ憡璀﹀凡缁忚鍒犻櫎");
+ alert("璇ュ憡璀﹀凡缁忔仮澶�");
}
}
});
@@ -651,7 +653,7 @@
// 鏍稿娴嬭瘯妯″潡
$(function() {
- var arrTh = ['鏈烘埧鍚嶇О', '璁惧ID', '璁惧鍚嶇О','璁惧鐘舵��', '鍦ㄧ嚎鐢靛帇锛圴锛�', '缁勭鐢靛帇锛圴锛�', '缁勭鐢垫祦锛坢A锛�','璁惧娓╁害锛堚剝锛�', '宸叉祴瀹归噺锛圓H锛�', '璁惧鍛婅', '宸叉祴鏃堕棿'];
+ var arrTh = ['鏈烘埧鍚嶇О', '璁惧ID', '璁惧鍚嶇О','璁惧鐘舵��', '鍦ㄧ嚎鐢靛帇锛圴锛�', '缁勭鐢靛帇锛圴锛�', '缁勭鐢垫祦锛圓锛�','璁惧娓╁害锛堚剝锛�', '宸叉祴瀹归噺锛圓H锛�', '璁惧鍛婅', '宸叉祴鏃堕棿'];
var arrTd = [];
var eleTh = $('#navNuclearTest-data .nuclearTest-tbl-header');
var eleTd = $('#navNuclearTest-data .nuclearTest-tbl-body');
@@ -690,6 +692,36 @@
alert('褰撳墠涓鸿鎯呴〉锛屼笉鐢ㄨ烦杞紒');
}
});
+
+ var menuItems = [{
+ txt: '瀹炴椂-鐩戞祴鏁版嵁',cla: 'menu-control'
+ }];
+
+ eleTd.on('mousedown', 'tr',function(e) {
+ // 鍒ゆ柇鏄惁涓哄彸閿�
+ if(e.which == 3) {
+ var disX = (e || event).clientX + 10; //鑾峰彇榧犳爣鐐瑰嚮鐨勬í鍧愭爣
+ var disY = (e || event).clientY + 10; // 鑾峰彇榧犳爣鐐瑰嚮鐨勭旱鍧愭爣
+ var trData = $(this).data('attr');
+ menuItems[0].data = trData;
+ //console.log(trData);
+ rightMenu.showMenu(menuItems, disX, disY);
+ }
+ });
+
+ // 鐐瑰嚮瀹炴椂-鐩戞祴鏁版嵁璺宠浆
+ $('body').on('click', '.menu-control', function() {
+ var _data = $(this).data('data');
+ //console.log(_data);
+ var province = _data.stationName1;
+ var city = _data.stationName2;
+ var county = _data.stationName5;
+ var home = _data.stationName;
+
+ var url = skipUrl('control.jsp',province,city,county,home);
+ window.open(url);
+ });
+
//鏌ヨ褰撳墠鐢ㄦ埛绠$悊鐨凚TS姝e湪澶勪簬鏍稿娴嬭瘯鐨勮澶囪褰�
function searchNuclear_cap(){
$.ajax({
@@ -700,7 +732,7 @@
data:null,
success: function(data){
var model = eval('('+data.result+')');
- console.info(model);
+ //console.info(model);
if(model.code == 1){
$('#nuclear_test').text(model.data.length);
if(model.data.length != 0) {
@@ -737,9 +769,16 @@
arrTd.push(data.dev_temp); // 璁惧娓╁害
arrTd.push(data.dev_captest_cap); // 宸叉祴瀹归噺
arrTd.push(getStateByArray(data.dev_alarmstate,BTS_alarmstates)); // 璁惧鍛婅
- arrTd.push(formatSeconds(data.num)); // 宸叉祴鏃堕棿
+ arrTd.push(formatSeconds(data.dev_captest_timelong)); // 宸叉祴鏃堕棿
}
createFullTbl(eleTh, eleTd, arrTh, arrTd);
+
+ // 缁欐瘡涓�琛屾坊鍔犳暟鎹�
+ var trList = eleTd.find('tbody tr');
+ // 閬嶅巻鍐呭缁檛r娣诲姞attr
+ for(var i=0; i<model.data.length; i++) {
+ trList.eq(i).data('attr', model.data[i]);
+ }
// 鏍规嵁鍛婅鍊艰缃俯搴︼紝k1鐢甸樆锛屽閫氬帇闄嶇殑瀛椾綋棰滆壊
/* var trList = eleTd.find('tbody tr');
@@ -777,5 +816,51 @@
return str;
}
});
+
+ /**
+ 妫�娴嬫湇鍔″櫒杩炴帴鏄惁姝e父
+ 绋嬪簭鍔熻兘: 閫氳繃璇锋眰鍚庡彴绋嬪簭濡傛灉涓夋閮借姹傚け璐ヨ涓烘湇鍔″櫒鎸傛帀,璺宠浆鍒扮櫥闄嗛〉闈�
+ */
+ ;(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++;
+ // 鏈嶅姟鍣ㄨ繛鎺ヤ笉姝e父
+ if(linkNum == 3) {
+ console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛佽烦杞埌鐧婚檰");
+ // 缃戠粶姝e父浣嗘湇鍔″櫒杩炵画澶氭妫�娴嬩笉姝e父璺宠浆鍒扮櫥闄嗛〉闈�
+ alert('缃戠粶杩炴帴寮傚父锛岃妫�鏌ョ綉缁滆繛鎺ユ槸鍚︽甯革紒');
+ window.location.replace("login.jsp");
+ }else {
+ console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛�");
+ checkServer();
+ }
+ }
+ }
+ });
+ }
+ })(jQuery);
</script>
</html>
--
Gitblit v1.9.1