index.jsp 66.7 KB
Newer Older
afe's avatar
afe committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.hp.cmsz.commons.utils.IPUtils" %>
<%@ page import="com.hp.cmsz.entity.UserInfo" %>
<%@ page import="com.hp.cmsz.commons.utils.Constant"%>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ page import="org.apache.shiro.authc.ExcessiveAttemptsException"%>
<%@ page import="org.apache.shiro.authc.IncorrectCredentialsException"%>
<%@ page import="org.apache.shiro.authc.UnknownAccountException"%>
<%@ page import="org.apache.shiro.authc.LockedAccountException"%>
<%@ page import="org.apache.shiro.authc.IncorrectCredentialsException"%>
<%@ page import="org.springframework.util.StringUtils" %>
<%@ page import="com.hp.cmsz.commons.utils.TokenProcessor"%>
<%@ page import="org.apache.shiro.authc.IncorrectCredentialsException" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>


<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html>
<head>
<title>首页</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
#main-container {
 background: url(${ctx}/static/images/indexBg.jpg);
 background-size: cover;
}
.section {
  overflow: hidden;
   background-color: transparent; 
  padding: 3px 15px 15px 15px;
  margin-bottom: 20px;
}
.container {
padding-right: 10px;
padding-left: 20px;
}
.carousel-caption {
  position: absolute;
  top: 2px;
  width:93%;
  left:5%;
  right:5%;
  z-index: 10;
  color: #000000;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.content-div {
  position: absolute;
  width: 450px;
  right: 1%;
  z-index: 10;
  color: #000000;
  text-align: left; 
  font-size: 24px;
}
.content-div p {
  font-size: 14px;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
  height: 410px;
  width: 100%;
} 
.content-div .h-content{
    color:blue;
}
.h-content .con{
color:red;
font-weight:bold;
}
h3 {
margin-top: 12px;
}
.col-xs-11{
 width: 75%;
 padding-top: 15px;
padding-left: 30px;
}
.col-xs-1{
 width: 22%;
 right:2%;
 top: 15px;
}
.col-xs-12{
padding-right: 0px;
  padding-left: 0px;
}
.col-xs-4{
padding-right: 0px;
  padding-left: 0px;
  /*  padding-top: 10px; */
   text-align: center;
} 
.col-xs-1 > .col-xs-4 {
padding-right: 0px;
  padding-left: 0px;
  /*  padding-top: 10px; */
   text-align: center;
   box-shadow: -1px -1px 1px rgba(34, 146, 225, 0.3),1px -1px 1px rgba(34, 146, 225, 0.3);
   border: 1px gray solid;
 /*  -moz-border-radius:2px 2px 0px 0px;
   -webkit-border-radius:2px 2px 0px 0px; */
    border-radius: 5px 5px 0px 0px; 
  background:-moz-linear-gradient(top,#D6F1F1,#C3DBE7);
background:-webkit-gradient(linear,top,from(#D6F1F1),to(#C3DBE7));
background:-webkit-linear-gradient(top,#D6F1F1,#C3DBE7);
background:-o-linear-gradient(top,#D6F1F1,#C3DBE7); 
background:linear-gradient(to top,#D6F1F1,#C3DBE7);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#D6F1F1', endColorstr='#C3DBE7',GradientType=0 );
}
.gradient {
       filter: none;
    }
.col-xs-1 > .col-xs-4.active,
.col-xs-1 > .col-xs-4:hover {
padding-right: 0px;
  padding-left: 0px;
  /*  padding-top: 10px; */
   text-align: center;
   box-shadow: -1px -1px 1px rgba(34, 146, 225, 0.3),1px -1px 1px rgba(34, 146, 225, 0.3);
   border: 1px gray solid;
   border-bottom: 1px #68B5E5 solid;
   /*  border-bottom: none; */
 border-radius: 5px 5px 0px 0px; 
   background:-moz-linear-gradient(top,#68B5E5,#C2E3F8);
 background:-webkit-gradient(linear,top,from(#68B5E5),to(#C2E3F8)); 
background:-webkit-linear-gradient(top,#68B5E5,#C2E3F8);
background:-o-linear-gradient(top,#68B5E5,#C2E3F8); 
background:linear-gradient(to top, #68B5E5,#C2E3F8);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C2E3F8', endColorstr='#68B5E5',GradientType=0 );
}
.gradient {
       filter: none;
    }
.carousel-indicators li {
border:1px gray solid;
background-color:gray;
}
.number {
width:100%;
height:30px;
/* background: url(${ctx}/static/images/indexRight.png);
background-size: cover; */
 padding-top: 5px;
text-align: center;
color:black;
font-weight: bold;
}
.table1 {
 border-left: 1px gray solid; 
 width: 100%;
  margin-bottom: 10px;
  -webkit-box-shadow: 3px 3px 3px gray ;
  -moz-box-shadow: 3px 3px 3px gray;
  box-shadow: 3px 3px 3px gray ;
  background: url(${ctx}/static/images/indexNum.png);
  background-size:100% 100%;
  /*  background:-moz-linear-gradient(top,rgba(104,181,229,0.8),rgba(104,181,229,0));
background:-webkit-gradient(linear,top,from(rgba(104,181,229,0.8)),to(rgba(104,181,229,0)));
background:-webkit-linear-gradient(top,rgba(104,181,229,0.8),rgba(104,181,229,0));
background:-o-linear-gradient(top,rgba(104,181,229,0.8),rgba(104,181,229,0)); 
background:linear-gradient(to top, rgba(104,181,229,0.8), rgba(104,181,229,0));
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='rgba(104,181,229,0.8)', endColorstr=' rgba(104,181,229,0)',GradientType=0);  */
}
.table1 > thead > tr > th,
.table1 > tbody > tr > th,
.table1 > tfoot > tr > th,
.table1 > thead > tr > td,
.table1 > tbody > tr > td,
.table1 > tfoot > tr > td {
  padding: 8px;
  line-height: 1.5;
  vertical-align: top;
/*   border-top: 1px solid #dddddd; */
}
.number1 {
width:100%;
height:230px;
background: url(${ctx}/static/images/indexBottomBg.png);
background-size: cover;
text-align: center;
color:black;
 font-weight:bold;
}
.section .row {
margin-top: 0px;
}
.section .row .col-xs-4{
width:32%
}

.number1 .col-xs-3 {
width:30%;
height:110px;
top:60px;
padding:10px 0 10px 20px;
}
.number1 .col-xs-3 img {
width:120%;
}
.number1 .col-xs-9 {
width:65%;
height:90%;
top:30px;
 font-weight:normal;
 text-align: left;
 margin-left:15px;
}
 .col-xs-9 span ,
  .col-xs-9 ul {
  font-size:13px;
  float:left;
  width:100%;
  }
pre {
background-color: transparent;
border-color:transparent;
padding:0;
margin:0 0 5px;
font-size:24px;
font-weight:500;
 color:blue;
}
.fontAll {
width:100%;
font-weight:bold;
text-align: left;
}

ul {
padding-left:30px;
float:left;
}
.col-xs-9 img {
width:30%;
float:right;
margin:10px 20% 0 0;
}
/* 小圈圈的样式 */
.carousel-indicators {
bottom: 10px;
}
/* 工作视图 */
.row .col-xs-12 {
padding-left:10px;
padding-right:55px
}
.row .col-xs-12 .panel{
margin-bottom:0px;
margin-top:10px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
    var loginState;
    var currentLoginUserName = "";
    var loginPrompt = "";
    var wrongCount;
    $("#main-container").hide();
   /*  $("#sticky-wrap").hide(); */
    <%
    Object error = request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
    String prompt = null;      
    if(error != null){
         if("org.apache.shiro.authc.UnknownAccountException".equals(error)) {
             prompt = "该用户不存在!";
         } else if("org.apache.shiro.authc.LockedAccountException".equals(error)) {
             prompt = "该用户已经被禁用!";
         } else if("org.apache.shiro.authc.IncorrectCredentialsException".equals(error)) {
            prompt = "你输入的密码不正确!";
   		//add by huach on 20140804 begin
   		} else if(Constant.MUST_LOGIN_FROM_4A .equals(error)) {      
           prompt="该系统已被4A平台接管,请通过4A平台登录!";
        //add by huach on 20140804 end   
         } else if("org.apache.shiro.authc.ExcessiveAttemptsException".equals(error)){
        	 prompt = "密码输入错误5次 账号已被锁定10分钟!";
         }else {
            prompt = "用户名或密码错误!";
         } %>
         loginState = "<%=prompt  %>";
         loginPrompt = "<%=prompt  %>";
         <%
         	int wrongCount = 0;
	         //添加验证次数
	         Object countObj = session.getAttribute("WRONG_COUNT");
	         if(countObj != null) {
	        	 wrongCount = Integer.parseInt((String)countObj);
	        	 wrongCount += 1;
	        	 session.setAttribute("WRONG_COUNT",wrongCount+"");
	        	 
	         }else {
	        	 session.setAttribute("WRONG_COUNT","1");
	        	 wrongCount = 1;
	         }
	         %>
	         wrongCount = <%= wrongCount  %>;
    <%  } else {
          Object current_user_session = session.getAttribute("CURRENT_USER_SESSION");
          if(current_user_session != null){%>
              loginState = 'loginSuccess';
              currentLoginUserName = '<%= ((UserInfo)(session.getAttribute("CURRENT_USER_SESSION"))).getUserName()%>';
              console.log(currentLoginUserName + ",欢迎回来!");
              
         <%} %>
         
    <%} %>
    
    //超过三次时出现验证码输入
    if(wrongCount && wrongCount >= 3) {
    	$("#checkCodeArea").show();
    }
    if(wrongCount && wrongCount >= 5){
    	loginPrompt = "密码输入错误5次 账号已被锁定10分钟!";
    }
    
     if (loginState == 'loginSuccess' && currentLoginUserName != '') {//登录成功
         
          $("#main-container").show();
          $("#logindiv").hide();
          $("#logo").hide();
		  var iddiv1 = window.document.getElementById("contentdiv1");
          var iddiv2 = window.document.getElementById("contentdiv2");
          if(iddiv1!=null&&iddiv2!=null){
             $("#contentdiv2").hide();
          }
           var href="${ctx}/index/createLog";
					  $.ajax({
					           type : 'GET',
					           contentType : 'application/json',
					           url: href,
					           dataType : 'text',
					           beforeSend: function(data) {
					            },
					           success: function(data) {
						   
						   }
					  });    
        /*  $("#sticky-wrap").show(); */
     } else {
         $('#errormsg').html(loginPrompt);
         $("#main-container").hide();
         $("#logindiv").show();
          $("#logo").show();
          document.getElementById('username').focus();
         <%--/*  $(".d-buttons input:first").css({--%>
                              <%--"color": "#ffffff",--%>
                              <%--"background": "#428bca",--%>
                              <%--"border-color": "#357ebd"--%>
           <%--});--%>
            <%--*/--%>
        <%--/*  var loginDialog = $.dialog({--%>
            <%--id: "login",--%>
            <%--title: "欢迎光临",--%>
            <%--content: "<div style='width: 272px;height: 117px;'><div><form class='form-horizontal' id='loginForm' action='#' method='post' role='form'>"--%>
            <%--+"<div class='form-group'><div class='col-xs-3'><label class='control-label' style='margin:7px 9px'>帐号:</label></div><div class='col-xs-9' style='margin:7px 0 0 -15px'><input id='username' name='username' class='form-control' type='text' value='' /></div></div>"--%>
            <%--+ "<div class='form-group'><div class='col-xs-3'><label class='control-label' style='margin:7px 9px'>密码:</label></div><div class='col-xs-9' style='margin:7px 0 0 -15px'><input id='password' name='password' class='form-control' type='password' value='' /></div></div>"--%>
            <%--+ "<div class='form-group'><div class='col-xs-3' style='display:none'><label class='checkbox' for='rememberMe'><input type='checkbox' id='rememberMe' name='rememberMe'/> 记住我</label></div><div class='col-sm-6'><label class='control-label'><font color='red'>" + loginPrompt + "</font></label></div></div>"--%>
            <%--+"</form></div></div>",--%>
            <%--initialize: function () {--%>
            <%--document.getElementById('username').focus();--%>
            <%--$(".d-buttons input:first").css({--%>
                              <%--"color": "#ffffff",--%>
                              <%--"background": "#428bca",--%>
                              <%--"border-color": "#357ebd"--%>
                      <%--});--%>
                          <%----%>
            <%--},--%>
            <%--button: [{--%>
            <%--value: "登录",--%>
            <%--callback: function () {--%>
                <%--var loginForm=$("#loginForm");--%>
                <%--loginForm.attr("action","${ctx}/index");--%>
                <%--loginForm.submit();--%>
                <%--loginForm.attr("action","#");--%>
              <%--}  --%>
            <%--}--%>
            <%--],--%>
            <%--cancel:false,--%>
            <%--lock: false--%>
        <%--}); */--%>
        var flag = false;
        
        $("#loginbutton").click(function(){
        	$("#password").val(strEnc($("#password").val(),"venustech_tbu_venus4A","2","3"))
        	if(wrongCount && wrongCount >= 3 && !flag) {
				$("#errormsg").html("请输入正确验证码"); 
				return;
        	}
        	$("#errormsg").html("");
            var loginForm=$("#loginForm");
                loginForm.attr("action","${ctx}/index");
                loginForm.submit();
                loginForm.attr("action","#");   
        });
     }
     //按回车键登录
     document.onkeydown=function(){
            if (event.keyCode==13) {
            	 $("#password").val(strEnc($("#password").val(),"venustech_tbu_venus4A","2","3"))
            	if(wrongCount && wrongCount >= 3 && !flag) {
    				$("#errormsg").html("请输入正确验证码"); 
    				return;
            	}
            	$("#errormsg").html("");
                var loginForm=$("#loginForm");
                loginForm.attr("action","${ctx}/index");
                loginForm.submit();
                loginForm.attr("action","#");
            }
     };
     getData();
     setInterval('getData()',4500);
     indexTable('early_warning');
     //tt();  //初始化点击事件
     //setInterval('tabNum()',10000);
   //add by eric   
   if (loginState == 'loginSuccess' && currentLoginUserName != '') {//登录成功
     if($("#contentdiv2").is(":hidden")){}else{
	    indexTable1();
	    indexTable2();
      }
    }
   //end 
   
   /*****************************
    *                           *
    *	登录验证码				*
    *							*
    *****************************/
	$("#checkCode").blur(function() {
		var code = $(this).val();
		$.ajax({
				type : "POST",
				data : {"code" : code},
				url : "${ctx}/index/graphics/ajaxCheck",
				success : function(obj) {
					if (obj == "1") {
						$("#checkCode").css({ "border-color": "blue" });
						flag = true;
					} else {
						$("#checkCode").css({ "border-color": "red" });
						flag = false;
					}
				}
		});
	});
});

var i = 0;
function getData() {
  if(i == 3) { i=0; }
    i++;
    $.ajax({
       type: 'GET',
       contentType : 'application/json',
       url : '${ctx}/index/DataRefresh/'+Date.parse(new Date()),
       dataType : 'text',
       beforeSend : function(data) {},
       success : function(data) {
            data=data.replace(/\"/gi,"'");
            data = eval("(" + data + ")");
            if(i == 1){
                $("#p1").html(data[0]+": ");
                $("#p11").html(Math.ceil(parseFloat(data[1])/(1024*1024))+" ");
                $("#p2").html(data[2]+": ");
                $("#p21").html(Math.ceil(parseFloat(data[3])/(1024*1024))+" ");
                $("#p3").html(data[4]+": ");
                $("#p31").html(Math.ceil(parseFloat(data[5])/1024)+" "); 
            }else if(i == 2){
                $("#p4").html(data[12]+": ");
                $("#p41").html(data[13]);
                $("#p5").html(data[14]+": ");
                $("#p51").html(data[15]);
            }else{
                $("#p6").html(data[6]+": ");
                $("#p61").html(data[7]);
                $("#p7").html(data[8]+": ");
                $("#p71").html(data[9]);
               /*  $("#p8").html(data[10]+": ");
                $("#p81").html(data[11]); */
            }
       }
    });
    
}

function tt() {
 $("#ol1 li").click(function(){
   var t = $(this).index();
   console.log(t);
   $("#t"+t).attr("class","active");
   $("ol li[id!='t"+t+"']").attr("class","");
   for(var i = 0 ; i< 4;i++){
        if(i == t){
         $("#tab"+i).attr("class","item active");
        }else{
         $("#tab"+i).attr("class","item");
        }
   }
  
  });
}
function change(o) {
	o.src = "${ctx}/index/graphics/checkCode.html?" + new Date().getTime();
}




//=====================================DES加密

function strEnc(data,firstKey,secondKey,thirdKey){  
	 var leng = data.length;  
	 var encData = "";  
	 var firstKeyBt,secondKeyBt,thirdKeyBt,firstLength,secondLength,thirdLength;  
	 if(firstKey != null && firstKey != ""){      
	   firstKeyBt = getKeyBytes(firstKey);  
	   firstLength = firstKeyBt.length;  
	 }  
	 if(secondKey != null && secondKey != ""){  
	   secondKeyBt = getKeyBytes(secondKey);  
	   secondLength = secondKeyBt.length;  
	 }  
	 if(thirdKey != null && thirdKey != ""){  
	   thirdKeyBt = getKeyBytes(thirdKey);  
	   thirdLength = thirdKeyBt.length;  
	 }    
	   
	 if(leng > 0){  
	   if(leng < 4){  
	     var bt = strToBt(data);        
	     var encByte ;  
	     if(firstKey != null && firstKey !="" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != ""){  
	       var tempBt;  
	       var x,y,z;  
	       tempBt = bt;          
	       for(x = 0;x < firstLength ;x ++){  
	         tempBt = enc(tempBt,firstKeyBt[x]);  
	       }  
	       for(y = 0;y < secondLength ;y ++){  
	         tempBt = enc(tempBt,secondKeyBt[y]);  
	       }  
	       for(z = 0;z < thirdLength ;z ++){  
	         tempBt = enc(tempBt,thirdKeyBt[z]);  
	       }          
	       encByte = tempBt;          
	     }else{  
	       if(firstKey != null && firstKey !="" && secondKey != null && secondKey != ""){  
	         var tempBt;  
	         var x,y;  
	         tempBt = bt;  
	         for(x = 0;x < firstLength ;x ++){  
	           tempBt = enc(tempBt,firstKeyBt[x]);  
	         }  
	         for(y = 0;y < secondLength ;y ++){  
	           tempBt = enc(tempBt,secondKeyBt[y]);  
	         }  
	         encByte = tempBt;  
	       }else{  
	         if(firstKey != null && firstKey !=""){              
	           var tempBt;  
	           var x = 0;  
	           tempBt = bt;              
	           for(x = 0;x < firstLength ;x ++){  
	             tempBt = enc(tempBt,firstKeyBt[x]);  
	           }  
	           encByte = tempBt;  
	         }  
	       }          
	     }  
	     encData = bt64ToHex(encByte);  
	   }else{  
	     var iterator = parseInt(leng/4);  
	     var remainder = leng%4;  
	     var i=0;        
	     for(i = 0;i < iterator;i++){  
	       var tempData = data.substring(i*4+0,i*4+4);  
	       var tempByte = strToBt(tempData);  
	       var encByte ;  
	       if(firstKey != null && firstKey !="" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != ""){  
	         var tempBt;  
	         var x,y,z;  
	         tempBt = tempByte;  
	         for(x = 0;x < firstLength ;x ++){  
	           tempBt = enc(tempBt,firstKeyBt[x]);  
	         }  
	         for(y = 0;y < secondLength ;y ++){  
	           tempBt = enc(tempBt,secondKeyBt[y]);  
	         }  
	         for(z = 0;z < thirdLength ;z ++){  
	           tempBt = enc(tempBt,thirdKeyBt[z]);  
	         }  
	         encByte = tempBt;  
	       }else{  
	         if(firstKey != null && firstKey !="" && secondKey != null && secondKey != ""){  
	           var tempBt;  
	           var x,y;  
	           tempBt = tempByte;  
	           for(x = 0;x < firstLength ;x ++){  
	             tempBt = enc(tempBt,firstKeyBt[x]);  
	           }  
	           for(y = 0;y < secondLength ;y ++){  
	             tempBt = enc(tempBt,secondKeyBt[y]);  
	           }  
	           encByte = tempBt;  
	         }else{  
	           if(firstKey != null && firstKey !=""){                        
	             var tempBt;  
	             var x;  
	             tempBt = tempByte;  
	             for(x = 0;x < firstLength ;x ++){                  
	               tempBt = enc(tempBt,firstKeyBt[x]);  
	             }  
	             encByte = tempBt;                
	           }  
	         }  
	       }  
	       encData += bt64ToHex(encByte);  
	     }        
	     if(remainder > 0){  
	       var remainderData = data.substring(iterator*4+0,leng);  
	       var tempByte = strToBt(remainderData);  
	       var encByte ;  
	       if(firstKey != null && firstKey !="" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != ""){  
	         var tempBt;  
	         var x,y,z;  
	         tempBt = tempByte;  
	         for(x = 0;x < firstLength ;x ++){  
	           tempBt = enc(tempBt,firstKeyBt[x]);  
	         }  
	         for(y = 0;y < secondLength ;y ++){  
	           tempBt = enc(tempBt,secondKeyBt[y]);  
	         }  
	         for(z = 0;z < thirdLength ;z ++){  
	           tempBt = enc(tempBt,thirdKeyBt[z]);  
	         }  
	         encByte = tempBt;  
	       }else{  
	         if(firstKey != null && firstKey !="" && secondKey != null && secondKey != ""){  
	           var tempBt;  
	           var x,y;  
	           tempBt = tempByte;  
	           for(x = 0;x < firstLength ;x ++){  
	             tempBt = enc(tempBt,firstKeyBt[x]);  
	           }  
	           for(y = 0;y < secondLength ;y ++){  
	             tempBt = enc(tempBt,secondKeyBt[y]);  
	           }  
	           encByte = tempBt;  
	         }else{  
	           if(firstKey != null && firstKey !=""){              
	             var tempBt;  
	             var x;  
	             tempBt = tempByte;  
	             for(x = 0;x < firstLength ;x ++){  
	               tempBt = enc(tempBt,firstKeyBt[x]);  
	             }  
	             encByte = tempBt;  
	           }  
	         }  
	       }  
	       encData += bt64ToHex(encByte);  
	     }                  
	   }  
	 }  
	 return encData;  
	}  
	  
	/* 
	* decrypt the encrypted string to the original string  
	* 
	* return  the original string   
	*/  
	function strDec(data,firstKey,secondKey,thirdKey){  
	 var leng = data.length;  
	 var decStr = "";  
	 var firstKeyBt,secondKeyBt,thirdKeyBt,firstLength,secondLength,thirdLength;  
	 if(firstKey != null && firstKey != ""){      
	   firstKeyBt = getKeyBytes(firstKey);  
	   firstLength = firstKeyBt.length;  
	 }  
	 if(secondKey != null && secondKey != ""){  
	   secondKeyBt = getKeyBytes(secondKey);  
	   secondLength = secondKeyBt.length;  
	 }  
	 if(thirdKey != null && thirdKey != ""){  
	   thirdKeyBt = getKeyBytes(thirdKey);  
	   thirdLength = thirdKeyBt.length;  
	 }  
	   
	 var iterator = parseInt(leng/16);  
	 var i=0;    
	 for(i = 0;i < iterator;i++){  
	   var tempData = data.substring(i*16+0,i*16+16);      
	   var strByte = hexToBt64(tempData);      
	   var intByte = new Array(64);  
	   var j = 0;  
	   for(j = 0;j < 64; j++){  
	     intByte[j] = parseInt(strByte.substring(j,j+1));  
	   }      
	   var decByte;  
	   if(firstKey != null && firstKey !="" && secondKey != null && secondKey != "" && thirdKey != null && thirdKey != ""){  
	     var tempBt;  
	     var x,y,z;  
	     tempBt = intByte;  
	     for(x = thirdLength - 1;x >= 0;x --){  
	       tempBt = dec(tempBt,thirdKeyBt[x]);  
	     }  
	     for(y = secondLength - 1;y >= 0;y --){  
	       tempBt = dec(tempBt,secondKeyBt[y]);  
	     }  
	     for(z = firstLength - 1;z >= 0 ;z --){  
	       tempBt = dec(tempBt,firstKeyBt[z]);  
	     }  
	     decByte = tempBt;  
	   }else{  
	     if(firstKey != null && firstKey !="" && secondKey != null && secondKey != ""){  
	       var tempBt;  
	       var x,y,z;  
	       tempBt = intByte;  
	       for(x = secondLength - 1;x >= 0 ;x --){  
	         tempBt = dec(tempBt,secondKeyBt[x]);  
	       }  
	       for(y = firstLength - 1;y >= 0 ;y --){  
	         tempBt = dec(tempBt,firstKeyBt[y]);  
	       }  
	       decByte = tempBt;  
	     }else{  
	       if(firstKey != null && firstKey !=""){  
	         var tempBt;  
	         var x,y,z;  
	         tempBt = intByte;  
	         for(x = firstLength - 1;x >= 0 ;x --){  
	           tempBt = dec(tempBt,firstKeyBt[x]);  
	         }  
	         decByte = tempBt;  
	       }  
	     }  
	   }  
	   decStr += byteToString(decByte);  
	 }        
	 return decStr;  
	}  
	/* 
	* chang the string into the bit array 
	*  
	* return bit array(it's length % 64 = 0) 
	*/  
	function getKeyBytes(key){  
	 var keyBytes = new Array();  
	 var leng = key.length;  
	 var iterator = parseInt(leng/4);  
	 var remainder = leng%4;  
	 var i = 0;  
	 for(i = 0;i < iterator; i ++){  
	   keyBytes[i] = strToBt(key.substring(i*4+0,i*4+4));  
	 }  
	 if(remainder > 0){  
	   keyBytes[i] = strToBt(key.substring(i*4+0,leng));  
	 }      
	 return keyBytes;  
	}  
	/*
	* chang the string(it's length <= 4) into the bit array 
	*  
	* return bit array(it's length = 64) 
	*/  
	function strToBt(str){    
	 var leng = str.length;  
	 var bt = new Array(64);  
	 if(leng < 4){  
	   var i=0,j=0,p=0,q=0;  
	   for(i = 0;i<leng;i++){  
	     var k = str.charCodeAt(i);  
	     for(j=0;j<16;j++){        
	       var pow=1,m=0;  
	       for(m=15;m>j;m--){  
	         pow *= 2;  
	       }          
	       bt[16*i+j]=parseInt(k/pow)%2;  
	     }  
	   }  
	   for(p = leng;p<4;p++){  
	     var k = 0;  
	     for(q=0;q<16;q++){        
	       var pow=1,m=0;  
	       for(m=15;m>q;m--){  
	         pow *= 2;  
	       }          
	       bt[16*p+q]=parseInt(k/pow)%2;  
	     }  
	   }    
	 }else{  
	   for(i = 0;i<4;i++){  
	     var k = str.charCodeAt(i);  
	     for(j=0;j<16;j++){        
	       var pow=1;  
	       for(m=15;m>j;m--){  
	         pow *= 2;  
	       }          
	       bt[16*i+j]=parseInt(k/pow)%2;  
	     }  
	   }    
	 }  
	 return bt;  
	}  
	/*
	* chang the bit(it's length = 4) into the hex 
	*  
	* return hex 
	*/  
	function bt4ToHex(binary) {  
	 var hex;  
	 switch (binary) {  
	   case "0000" : hex = "0"; break;  
	   case "0001" : hex = "1"; break;  
	   case "0010" : hex = "2"; break;  
	   case "0011" : hex = "3"; break;  
	   case "0100" : hex = "4"; break;  
	   case "0101" : hex = "5"; break;  
	   case "0110" : hex = "6"; break;  
	   case "0111" : hex = "7"; break;  
	   case "1000" : hex = "8"; break;  
	   case "1001" : hex = "9"; break;  
	   case "1010" : hex = "A"; break;  
	   case "1011" : hex = "B"; break;  
	   case "1100" : hex = "C"; break;  
	   case "1101" : hex = "D"; break;  
	   case "1110" : hex = "E"; break;  
	   case "1111" : hex = "F"; break;  
	 }  
	 return hex;  
	}  
	  
	/* 
	* chang the hex into the bit(it's length = 4) 
	*  
	* return the bit(it's length = 4) 
	*/  
	function hexToBt4(hex) {  
	 var binary;  
	 switch (hex) {  
	   case "0" : binary = "0000"; break;  
	   case "1" : binary = "0001"; break;  
	   case "2" : binary = "0010"; break;  
	   case "3" : binary = "0011"; break;  
	   case "4" : binary = "0100"; break;  
	   case "5" : binary = "0101"; break;  
	   case "6" : binary = "0110"; break;  
	   case "7" : binary = "0111"; break;  
	   case "8" : binary = "1000"; break;  
	   case "9" : binary = "1001"; break;  
	   case "A" : binary = "1010"; break;  
	   case "B" : binary = "1011"; break;  
	   case "C" : binary = "1100"; break;  
	   case "D" : binary = "1101"; break;  
	   case "E" : binary = "1110"; break;  
	   case "F" : binary = "1111"; break;  
	 }  
	 return binary;  
	}  
	  
	/* 
	* chang the bit(it's length = 64) into the string 
	*  
	* return string 
	*/  
	function byteToString(byteData){  
	 var str="";  
	 for(i = 0;i<4;i++){  
	   var count=0;  
	   for(j=0;j<16;j++){          
	     var pow=1;  
	     for(m=15;m>j;m--){  
	       pow*=2;  
	     }                
	     count+=byteData[16*i+j]*pow;  
	   }          
	   if(count != 0){  
	     str+=String.fromCharCode(count);  
	   }  
	 }  
	 return str;  
	}  
	  
	function bt64ToHex(byteData){  
	 var hex = "";  
	 for(i = 0;i<16;i++){  
	   var bt = "";  
	   for(j=0;j<4;j++){      
	     bt += byteData[i*4+j];  
	   }      
	   hex+=bt4ToHex(bt);  
	 }  
	 return hex;  
	}  
	  
	function hexToBt64(hex){  
	 var binary = "";  
	 for(i = 0;i<16;i++){  
	   binary+=hexToBt4(hex.substring(i,i+1));  
	 }  
	 return binary;  
	}  
	  
	/* 
	* the 64 bit des core arithmetic 
	*/  
	  
	function enc(dataByte,keyByte){    
	 var keys = generateKeys(keyByte);      
	 var ipByte   = initPermute(dataByte);    
	 var ipLeft   = new Array(32);  
	 var ipRight  = new Array(32);  
	 var tempLeft = new Array(32);  
	 var i = 0,j = 0,k = 0,m = 0, n = 0;  
	 for(k = 0;k < 32;k ++){  
	   ipLeft[k] = ipByte[k];  
	   ipRight[k] = ipByte[32+k];  
	 }      
	 for(i = 0;i < 16;i ++){  
	   for(j = 0;j < 32;j ++){  
	     tempLeft[j] = ipLeft[j];  
	     ipLeft[j] = ipRight[j];        
	   }    
	   var key = new Array(48);  
	   for(m = 0;m < 48;m ++){  
	     key[m] = keys[i][m];  
	   }  
	   var  tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight),key))), tempLeft);        
	   for(n = 0;n < 32;n ++){  
	     ipRight[n] = tempRight[n];  
	   }    
	     
	 }    
	   
	   
	 var finalData =new Array(64);  
	 for(i = 0;i < 32;i ++){  
	   finalData[i] = ipRight[i];  
	   finalData[32+i] = ipLeft[i];  
	 }  
	 return finallyPermute(finalData);    
	}  
	  
	function dec(dataByte,keyByte){    
	 var keys = generateKeys(keyByte);      
	 var ipByte   = initPermute(dataByte);    
	 var ipLeft   = new Array(32);  
	 var ipRight  = new Array(32);  
	 var tempLeft = new Array(32);  
	 var i = 0,j = 0,k = 0,m = 0, n = 0;  
	 for(k = 0;k < 32;k ++){  
	   ipLeft[k] = ipByte[k];  
	   ipRight[k] = ipByte[32+k];  
	 }    
	 for(i = 15;i >= 0;i --){  
	   for(j = 0;j < 32;j ++){  
	     tempLeft[j] = ipLeft[j];  
	     ipLeft[j] = ipRight[j];        
	   }    
	   var key = new Array(48);  
	   for(m = 0;m < 48;m ++){  
	     key[m] = keys[i][m];  
	   }  
	     
	   var  tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight),key))), tempLeft);        
	   for(n = 0;n < 32;n ++){  
	     ipRight[n] = tempRight[n];  
	   }    
	 }    
	   
	   
	 var finalData =new Array(64);  
	 for(i = 0;i < 32;i ++){  
	   finalData[i] = ipRight[i];  
	   finalData[32+i] = ipLeft[i];  
	 }  
	 return finallyPermute(finalData);    
	}  
	  
	function initPermute(originalData){  
	 var ipByte = new Array(64);  
	 for (i = 0, m = 1, n = 0; i < 4; i++, m += 2, n += 2) {  
	   for (j = 7, k = 0; j >= 0; j--, k++) {  
	     ipByte[i * 8 + k] = originalData[j * 8 + m];  
	     ipByte[i * 8 + k + 32] = originalData[j * 8 + n];  
	   }  
	 }      
	 return ipByte;  
	}  
	  
	function expandPermute(rightData){    
	 var epByte = new Array(48);  
	 for (i = 0; i < 8; i++) {  
	   if (i == 0) {  
	     epByte[i * 6 + 0] = rightData[31];  
	   } else {  
	     epByte[i * 6 + 0] = rightData[i * 4 - 1];  
	   }  
	   epByte[i * 6 + 1] = rightData[i * 4 + 0];  
	   epByte[i * 6 + 2] = rightData[i * 4 + 1];  
	   epByte[i * 6 + 3] = rightData[i * 4 + 2];  
	   epByte[i * 6 + 4] = rightData[i * 4 + 3];  
	   if (i == 7) {  
	     epByte[i * 6 + 5] = rightData[0];  
	   } else {  
	     epByte[i * 6 + 5] = rightData[i * 4 + 4];  
	   }  
	 }        
	 return epByte;  
	}  
	  
	function xor(byteOne,byteTwo){    
	 var xorByte = new Array(byteOne.length);  
	 for(i = 0;i < byteOne.length; i ++){        
	   xorByte[i] = byteOne[i] ^ byteTwo[i];  
	 }    
	 return xorByte;  
	}  
	  
	function sBoxPermute(expandByte){  
	   
	   var sBoxByte = new Array(32);  
	   var binary = "";  
	   var s1 = [  
	       [14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7],  
	       [0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8],  
	       [4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0],  
	       [15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 ]];  
	  
	       /* Table - s2 */  
	   var s2 = [  
	       [15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10],  
	       [3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5],  
	       [0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15],  
	       [13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 ]];  
	  
	       /* Table - s3 */  
	   var s3= [  
	       [10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8],  
	       [13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1],  
	       [13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7],  
	       [1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 ]];  
	       /* Table - s4 */  
	   var s4 = [  
	       [7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15],  
	       [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9],  
	       [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4],  
	       [3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 ]];  
	  
	       /* Table - s5 */  
	   var s5 = [  
	       [2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9],  
	       [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6],  
	       [4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14],  
	       [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 ]];  
	  
	       /* Table - s6 */  
	   var s6 = [  
	       [12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11],  
	       [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8],  
	       [9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6],  
	       [4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 ]];  
	  
	       /* Table - s7 */  
	   var s7 = [  
	       [4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1],  
	       [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6],  
	       [1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2],  
	       [6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12]];  
	  
	       /* Table - s8 */  
	   var s8 = [  
	       [13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7],  
	       [1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2],  
	       [7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8],  
	       [2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11]];  
	     
	   for(m=0;m<8;m++){  
	   var i=0,j=0;  
	   i = expandByte[m*6+0]*2+expandByte[m*6+5];  
	   j = expandByte[m * 6 + 1] * 2 * 2 * 2   
	     + expandByte[m * 6 + 2] * 2* 2   
	     + expandByte[m * 6 + 3] * 2   
	     + expandByte[m * 6 + 4];  
	   switch (m) {  
	     case 0 :  
	       binary = getBoxBinary(s1[i][j]);  
	       break;  
	     case 1 :  
	       binary = getBoxBinary(s2[i][j]);  
	       break;  
	     case 2 :  
	       binary = getBoxBinary(s3[i][j]);  
	       break;  
	     case 3 :  
	       binary = getBoxBinary(s4[i][j]);  
	       break;  
	     case 4 :  
	       binary = getBoxBinary(s5[i][j]);  
	       break;  
	     case 5 :  
	       binary = getBoxBinary(s6[i][j]);  
	       break;  
	     case 6 :  
	       binary = getBoxBinary(s7[i][j]);  
	       break;  
	     case 7 :  
	       binary = getBoxBinary(s8[i][j]);  
	       break;  
	   }        
	   sBoxByte[m*4+0] = parseInt(binary.substring(0,1));  
	   sBoxByte[m*4+1] = parseInt(binary.substring(1,2));  
	   sBoxByte[m*4+2] = parseInt(binary.substring(2,3));  
	   sBoxByte[m*4+3] = parseInt(binary.substring(3,4));  
	 }  
	 return sBoxByte;  
	}  
	  
	function pPermute(sBoxByte){  
	 var pBoxPermute = new Array(32);  
	 pBoxPermute[ 0] = sBoxByte[15];   
	 pBoxPermute[ 1] = sBoxByte[ 6];   
	 pBoxPermute[ 2] = sBoxByte[19];   
	 pBoxPermute[ 3] = sBoxByte[20];   
	 pBoxPermute[ 4] = sBoxByte[28];   
	 pBoxPermute[ 5] = sBoxByte[11];   
	 pBoxPermute[ 6] = sBoxByte[27];   
	 pBoxPermute[ 7] = sBoxByte[16];   
	 pBoxPermute[ 8] = sBoxByte[ 0];   
	 pBoxPermute[ 9] = sBoxByte[14];   
	 pBoxPermute[10] = sBoxByte[22];   
	 pBoxPermute[11] = sBoxByte[25];   
	 pBoxPermute[12] = sBoxByte[ 4];   
	 pBoxPermute[13] = sBoxByte[17];   
	 pBoxPermute[14] = sBoxByte[30];   
	 pBoxPermute[15] = sBoxByte[ 9];   
	 pBoxPermute[16] = sBoxByte[ 1];   
	 pBoxPermute[17] = sBoxByte[ 7];   
	 pBoxPermute[18] = sBoxByte[23];   
	 pBoxPermute[19] = sBoxByte[13];   
	 pBoxPermute[20] = sBoxByte[31];   
	 pBoxPermute[21] = sBoxByte[26];   
	 pBoxPermute[22] = sBoxByte[ 2];   
	 pBoxPermute[23] = sBoxByte[ 8];   
	 pBoxPermute[24] = sBoxByte[18];   
	 pBoxPermute[25] = sBoxByte[12];   
	 pBoxPermute[26] = sBoxByte[29];   
	 pBoxPermute[27] = sBoxByte[ 5];   
	 pBoxPermute[28] = sBoxByte[21];   
	 pBoxPermute[29] = sBoxByte[10];   
	 pBoxPermute[30] = sBoxByte[ 3];   
	 pBoxPermute[31] = sBoxByte[24];      
	 return pBoxPermute;  
	}  
	  
	function finallyPermute(endByte){      
	 var fpByte = new Array(64);    
	 fpByte[ 0] = endByte[39];   
	 fpByte[ 1] = endByte[ 7];   
	 fpByte[ 2] = endByte[47];   
	 fpByte[ 3] = endByte[15];   
	 fpByte[ 4] = endByte[55];   
	 fpByte[ 5] = endByte[23];   
	 fpByte[ 6] = endByte[63];   
	 fpByte[ 7] = endByte[31];   
	 fpByte[ 8] = endByte[38];   
	 fpByte[ 9] = endByte[ 6];   
	 fpByte[10] = endByte[46];   
	 fpByte[11] = endByte[14];   
	 fpByte[12] = endByte[54];   
	 fpByte[13] = endByte[22];   
	 fpByte[14] = endByte[62];   
	 fpByte[15] = endByte[30];   
	 fpByte[16] = endByte[37];   
	 fpByte[17] = endByte[ 5];   
	 fpByte[18] = endByte[45];   
	 fpByte[19] = endByte[13];   
	 fpByte[20] = endByte[53];   
	 fpByte[21] = endByte[21];   
	 fpByte[22] = endByte[61];   
	 fpByte[23] = endByte[29];   
	 fpByte[24] = endByte[36];   
	 fpByte[25] = endByte[ 4];   
	 fpByte[26] = endByte[44];   
	 fpByte[27] = endByte[12];   
	 fpByte[28] = endByte[52];   
	 fpByte[29] = endByte[20];   
	 fpByte[30] = endByte[60];   
	 fpByte[31] = endByte[28];   
	 fpByte[32] = endByte[35];   
	 fpByte[33] = endByte[ 3];   
	 fpByte[34] = endByte[43];   
	 fpByte[35] = endByte[11];   
	 fpByte[36] = endByte[51];   
	 fpByte[37] = endByte[19];   
	 fpByte[38] = endByte[59];   
	 fpByte[39] = endByte[27];   
	 fpByte[40] = endByte[34];   
	 fpByte[41] = endByte[ 2];   
	 fpByte[42] = endByte[42];   
	 fpByte[43] = endByte[10];   
	 fpByte[44] = endByte[50];   
	 fpByte[45] = endByte[18];   
	 fpByte[46] = endByte[58];   
	 fpByte[47] = endByte[26];   
	 fpByte[48] = endByte[33];   
	 fpByte[49] = endByte[ 1];   
	 fpByte[50] = endByte[41];   
	 fpByte[51] = endByte[ 9];   
	 fpByte[52] = endByte[49];   
	 fpByte[53] = endByte[17];   
	 fpByte[54] = endByte[57];   
	 fpByte[55] = endByte[25];   
	 fpByte[56] = endByte[32];   
	 fpByte[57] = endByte[ 0];   
	 fpByte[58] = endByte[40];   
	 fpByte[59] = endByte[ 8];   
	 fpByte[60] = endByte[48];   
	 fpByte[61] = endByte[16];   
	 fpByte[62] = endByte[56];   
	 fpByte[63] = endByte[24];  
	 return fpByte;  
	}  
	  
	function getBoxBinary(i) {  
	 var binary = "";  
	 switch (i) {  
	   case 0 :binary = "0000";break;  
	   case 1 :binary = "0001";break;  
	   case 2 :binary = "0010";break;  
	   case 3 :binary = "0011";break;  
	   case 4 :binary = "0100";break;  
	   case 5 :binary = "0101";break;  
	   case 6 :binary = "0110";break;  
	   case 7 :binary = "0111";break;  
	   case 8 :binary = "1000";break;  
	   case 9 :binary = "1001";break;  
	   case 10 :binary = "1010";break;  
	   case 11 :binary = "1011";break;  
	   case 12 :binary = "1100";break;  
	   case 13 :binary = "1101";break;  
	   case 14 :binary = "1110";break;  
	   case 15 :binary = "1111";break;  
	 }  
	 return binary;  
	}  
	/* 
	* generate 16 keys for xor 
	* 
	*/  
	function generateKeys(keyByte){      
	 var key   = new Array(56);  
	 var keys = new Array();    
	   
	 keys[ 0] = new Array();  
	 keys[ 1] = new Array();  
	 keys[ 2] = new Array();  
	 keys[ 3] = new Array();  
	 keys[ 4] = new Array();  
	 keys[ 5] = new Array();  
	 keys[ 6] = new Array();  
	 keys[ 7] = new Array();  
	 keys[ 8] = new Array();  
	 keys[ 9] = new Array();  
	 keys[10] = new Array();  
	 keys[11] = new Array();  
	 keys[12] = new Array();  
	 keys[13] = new Array();  
	 keys[14] = new Array();  
	 keys[15] = new Array();    
	 var loop = [1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];  
	  
	 for(i=0;i<7;i++){  
	   for(j=0,k=7;j<8;j++,k--){  
	     key[i*8+j]=keyByte[8*k+i];  
	   }  
	 }      
	   
	 var i = 0;  
	 for(i = 0;i < 16;i ++){  
	   var tempLeft=0;  
	   var tempRight=0;  
	   for(j = 0; j < loop[i];j ++){            
	     tempLeft = key[0];  
	     tempRight = key[28];  
	     for(k = 0;k < 27 ;k ++){  
	       key[k] = key[k+1];  
	       key[28+k] = key[29+k];  
	     }    
	     key[27]=tempLeft;  
	     key[55]=tempRight;  
	   }  
	   var tempKey = new Array(48);  
	   tempKey[ 0] = key[13];  
	   tempKey[ 1] = key[16];  
	   tempKey[ 2] = key[10];  
	   tempKey[ 3] = key[23];  
	   tempKey[ 4] = key[ 0];  
	   tempKey[ 5] = key[ 4];  
	   tempKey[ 6] = key[ 2];  
	   tempKey[ 7] = key[27];  
	   tempKey[ 8] = key[14];  
	   tempKey[ 9] = key[ 5];  
	   tempKey[10] = key[20];  
	   tempKey[11] = key[ 9];  
	   tempKey[12] = key[22];  
	   tempKey[13] = key[18];  
	   tempKey[14] = key[11];  
	   tempKey[15] = key[ 3];  
	   tempKey[16] = key[25];  
	   tempKey[17] = key[ 7];  
	   tempKey[18] = key[15];  
	   tempKey[19] = key[ 6];  
	   tempKey[20] = key[26];  
	   tempKey[21] = key[19];  
	   tempKey[22] = key[12];  
	   tempKey[23] = key[ 1];  
	   tempKey[24] = key[40];  
	   tempKey[25] = key[51];  
	   tempKey[26] = key[30];  
	   tempKey[27] = key[36];  
	   tempKey[28] = key[46];  
	   tempKey[29] = key[54];  
	   tempKey[30] = key[29];  
	   tempKey[31] = key[39];  
	   tempKey[32] = key[50];  
	   tempKey[33] = key[44];  
	   tempKey[34] = key[32];  
	   tempKey[35] = key[47];  
	   tempKey[36] = key[43];  
	   tempKey[37] = key[48];  
	   tempKey[38] = key[38];  
	   tempKey[39] = key[55];  
	   tempKey[40] = key[33];  
	   tempKey[41] = key[52];  
	   tempKey[42] = key[45];  
	   tempKey[43] = key[41];  
	   tempKey[44] = key[49];  
	   tempKey[45] = key[35];  
	   tempKey[46] = key[28];  
	   tempKey[47] = key[31];  
	   switch(i){  
	     case 0: for(m=0;m < 48 ;m++){ keys[ 0][m] = tempKey[m]; } break;  
	     case 1: for(m=0;m < 48 ;m++){ keys[ 1][m] = tempKey[m]; } break;  
	     case 2: for(m=0;m < 48 ;m++){ keys[ 2][m] = tempKey[m]; } break;  
	     case 3: for(m=0;m < 48 ;m++){ keys[ 3][m] = tempKey[m]; } break;  
	     case 4: for(m=0;m < 48 ;m++){ keys[ 4][m] = tempKey[m]; } break;  
	     case 5: for(m=0;m < 48 ;m++){ keys[ 5][m] = tempKey[m]; } break;  
	     case 6: for(m=0;m < 48 ;m++){ keys[ 6][m] = tempKey[m]; } break;  
	     case 7: for(m=0;m < 48 ;m++){ keys[ 7][m] = tempKey[m]; } break;  
	     case 8: for(m=0;m < 48 ;m++){ keys[ 8][m] = tempKey[m]; } break;  
	     case 9: for(m=0;m < 48 ;m++){ keys[ 9][m] = tempKey[m]; } break;  
	     case 10: for(m=0;m < 48 ;m++){ keys[10][m] = tempKey[m]; } break;  
	     case 11: for(m=0;m < 48 ;m++){ keys[11][m] = tempKey[m]; } break;  
	     case 12: for(m=0;m < 48 ;m++){ keys[12][m] = tempKey[m]; } break;  
	     case 13: for(m=0;m < 48 ;m++){ keys[13][m] = tempKey[m]; } break;  
	     case 14: for(m=0;m < 48 ;m++){ keys[14][m] = tempKey[m]; } break;  
	     case 15: for(m=0;m < 48 ;m++){ keys[15][m] = tempKey[m]; } break;  
	   }  
	 }  
	 return keys;    
	} 
	  //================================================DES加密end




</script>
</head>
<body>
 <!-- 登录信息 -->
                <div class="col-xs-6" >
                  <div id="logo" style="margin-left:28%;margin-top:111px;">
                    <img src="${ctx}/static/images/login3.png" alt="" width="120%" height="398px">
                  </div>
                </div>
                
                <div id="login" class="col-xs-6">
                    <div id="logindiv" style='width: 70%;height: 50%;position:relative;left:-50px;top:111px;'>
                       <img src="${ctx}/static/images/login4.png" alt="" width="70%" height="398px">
                    </div>
                    <div id="formdiv" style='width: 60%;height: 50%;position:absolute;left:20px;top:180px;'>
                       
                           <form class='form-horizontal' id='loginForm' action='#' method='post' role='form'>
			                 <div class='form-group' style="position:relative;left:25%;width:80%;height:50px;"><div class='col-xs-3'><label class='control-label' style='margin:6% 6%;'><span style="font-size:18px">帐号:</span></label></div><div class='col-xs-9' style='margin:1% 0 0 -8%'><input id='username' name='username' class='form-control' sytle="background-color:#F5F7F9;" type='text' value='' /></div></div>
			                 <div class='form-group' style="position:relative;left:25%;width:80%;height:50px;"><div class='col-xs-3'><label class='control-label' style='margin:6% 6%'><span style="font-size:18px">密码:</span></label></div><div class='col-xs-9' style='margin:1% 0 0 -8%'><input id='password' name='password' class='form-control' sytle="background-color:#F5F7F9;" type='password' value='' /></div></div>
			                 <div class='form-group' style="position:relative;left:22%;width:80%;height:50px;"><div class='col-xs-3'></div><div class='col-sm-6' style='margin-left:-18px;' ><label class='checkbox' for='rememberMe' style="display:none;"><input type='checkbox'  id='rememberMe' name='rememberMe' />记住用户名</label><label class='control-label'><font  color='red'></font></label></div></div>
			                <!--  <div class='form-group' style="position:relative;left:25%;top:40px;width:80%;height:50px;"><div class='col-xs-3'><label class='control-label' style='margin:6% 6%'><span style="font-size:18px">密码:</span></label></div><div class='col-xs-9' style='margin:1% 0 0 -8%'><input id='password' name='password' class='form-control' sytle="background-color:#F5F7F9;" type='password' value='' /></div></div>
			                 <div class='form-group' style="position:relative;left:22%;width:80%;height:50px;"><div class='col-xs-3'></div><div class='col-sm-6' style='margin-left:-18px;' ><label class='checkbox' for='rememberMe' style="display:none;"><input type='checkbox'  id='rememberMe' name='rememberMe' />记住登录信息</label><label class='control-label'><font  color='red'></font></label></div></div>
			              -->
				              <div class='form-group' style="position:relative;left:25%;width:80%;height:50px;top:-60px;display:none;" id="checkCodeArea">
				              	<div class='col-xs-6'>
				              		<img src="${ctx}/index/graphics/checkCode" onclick="change(this)" style="border: 1px solid black;"/>
				              	</div>
				              	<div class='col-xs-6' style='margin:1% 0 0 -8%'>
				              		<input type="hidden" id="tokenID" name="tokenID" value="<%=TokenProcessor.createToken(session)%>">
				              		<input autocomplete="off" class="form-control" name="checkCode" id="checkCode"
										placeholder="请输入左侧验证码" maxlength="4""/>
				              	</div>
				              </div>
				              <p style="float:left;margin-left:25%;margin-top:-60px;font-family: 微软雅黑;color: red;" id="errormsg"></p>
			               </form>
			               <div style="position:relative;left:38%;">
			               <button id="loginbutton" class="btn btn-primary" style="width:25%;height:40px;">登录</button>
			               
			               
			               
			               
			               </div>
			       </div>
                </div>

    <div id="main-container">
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
            <div class="container">
                <div class="col-xs-11" >
                <!-- Indicators -->
                <ol id="ol1" class="carousel-indicators" onclick="javascript:tt()">
                    <li id="t0" data-target="#carousel-example-generic" 
                        class="active"></li>
                    <li id="t1" data-target="#carousel-example-generic"></li>
                    <li id="t2" data-target="#carousel-example-generic"></li>
                     <li id="t3" data-target="#carousel-example-generic"></li>
                </ol>
                
                <!-- Wrapper for slides -->
                    <div class="carousel-inner">
                    <div id="tab0" class="item active">
                        <img src="${ctx}/static/images/indexB1.png" alt="" >
                        <div class="carousel-caption">
                            <h1 align="left">基于大数据的分析平台</h1>
                            <div class="content-div">
                            <h3><span style="font-weight:bold;">基于<span style="font-size:32px;color:rgb(255,162,0);">Hadoop</span><span  style="font-size:32px;color:rgb(255,162,0);">MPP</span>混搭架构的大数据分析平台</span>,具备强大的数据处理与分析能力,支持近实时的从海量的监控数据发现潜在的问题。</h3>
                            <h3 class="h-content"><span id="p1"></span><span id="p11" class="con"></span><span>T</span></h3>
                            <h3 class="h-content"><span id="p2"></span><span id="p21" class="con"></span><span>T</span></h3>
                            <h3 class="h-content"><span id="p3"></span><span id="p31" class="con"></span><span>G</span></h3>
                            </div>
                        </div>
                    </div>
                    <div id="tab1" class="item">
                        <img src="${ctx}/static/images/indexB2.png" alt="">
                        <div class="carousel-caption">
                            <h1 align="left">灵活多变的分析模型</h1>
                            <div class="content-div">
                            <h3><span style="color:rgb(255,162,0);font-weight:bold;">支持多种已验证的分析模型</span>,包括业务量类故障预警模型、平台性能类故障预警模型、业务性能类隐患模型、平台性能类隐患模型、容量压力类隐患模型等;<br><span style="color:rgb(255,162,0);font-weight:bold;">支持自定义新的分析模型</span>,可使用Shell、Perl、R等编程语言。</h3>
                            <h3 class="h-content"><span id="p4"></span><span id="p41" class="con"></span><span></span></h3>
                            <h3 class="h-content"><span id="p5"></span><span id="p51" class="con"></span><span></span></h3>
                            </div>
                        </div>
                    </div>
                    <div id="tab2" class="item">
                        <img src="${ctx}/static/images/indexB3.png" alt="">
                        <div class="carousel-caption">
                            <h1 align="left">近实时的分析结果输出</h1>
                            <div class="content-div">
                            <h3>分析模型近实时地分析最新的监控数据,输出<span style="color:rgb(255,162,0);font-weight:bold;">故障预警</span>,回顾历史数据,输出<span style="color:rgb(255,162,0);font-weight:bold;">系统性能隐患</span>,提前发现系统问题。</h3>
                            <h3 class="h-content"><span id="p6"></span><span id="p61" class="con"></span><span></span></h3>
                            <h3 class="h-content"><span id="p7"></span><span id="p71" class="con"></span><span></span></h3>
                           <!--  <h3 class="h-content"><span id="p8"></span><span id="p81" class="con"></span><span>个</span></h3> -->
                            </div>
                        </div>
                    </div>
                    <div id="tab3" class="item">
                        <img src="${ctx}/static/images/indexB4.png" alt="">
                        <div class="carousel-caption">
                            <h1 align="left">全面的分析和管理流程</h1>
                            <div class="content-div">
                      <pre>   数据预分析</pre> 
                      <pre>      数据沙盒验证</pre>  
                      <pre>         数据模型管理</pre> 
                      <pre>            告警监控</pre> 
                      <pre>               协查单管理</pre> 
                       <pre>                   故障管理</pre>               
                            </div>
                        </div>
                    </div>
                </div>
                </div>
                <div class="col-xs-1" >
                <div class="col-xs-4" ><a id="risk" href="#" onclick="javascript:riskClick()"><div class="number">隐患</div></a></div>
                <div class="col-xs-4 active" ><a id="early_warning" href="#" onclick="javascript:earlyWarningClick()"><div class="number">预警</div></a></div>
                <div class="col-xs-4" ><a id="failure" href="#" onclick="javascript:failureClick()"><div class="number">故障</div></a></div>
                <div class="col-xs-12">
                <table id="numberTable" class="table1" style="text-align:center;">
                </table>
                </div>
                </div>
            

                <!-- Controls -->
                <!-- <a class="left carousel-control" href="#myCarousel"
                    data-slide="prev"> <span
                    class="glyphicon glyphicon-chevron-left"></span> </a> <a
                    class="right carousel-control" href="#myCarousel" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right"></span> </a> -->
            </div>
        </div>
     </div>      
    <shiro:hasAnyRoles name="admin,departmentManage,companyManage,groupManage">    
    <div  id="contentdiv1">   
     <div id="content1" class="container">
            <div class="section">
                <div class="row">
                    <div class="col-xs-4">
                       <div class="number1">
                         <div class="col-xs-3">
                           <img src="${ctx}/static/images/indexBottom1.png" alt="" >
                         </div>
                         <div class="col-xs-9">
                         <h3 class="fontAll">数据预分析</h3>
                          <span>应用于模型创建初期和改进阶段</span>
                          <span>   <ul>
                            <li>探查不同来源数据的特征</li>
                            <li>分析关键业务的环节短板</li></ul></span>
                            <span><a href="${ctx}/MonitorOperation/RegularityAnalysis"><img src="${ctx}/static/images/indexDetail.png" alt="" ></a></span>
                         </div>
                       </div>   
                    </div>
                    <div class="col-xs-4">
                        <div class="number1">
                         <div class="col-xs-3">
                           <img src="${ctx}/static/images/indexBottom2.png" alt="" >
                         </div>
                         <div class="col-xs-9">
                           <h3 class="fontAll">数据沙盒</h3>
                            <span>应用于模型研究阶段</span>
                           <span>  <ul>
                            <li>沙盒数据的配置与管理</li>
                            <li>沙盒任务的配置与管理</li></ul> </span>
                            <span><a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskDetail"><img src="${ctx}/static/images/indexDetail.png" alt="" ></a></span>
                         </div>
                        </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="number1">
                         <div class="col-xs-3">
                           <img src="${ctx}/static/images/indexBottom3.png" alt="" >
                         </div>
                       <div class="col-xs-9">
                            <h3 class="fontAll">数据建模</h3>
                            <span>应用于模型应用阶段</span>
                            <span> <ul>
                            <li>数据模型创建与修改</li>
                            <li>数据模型运行状态监控</li></ul></span>
                            <span><a href="${ctx}/ModelManage/ModelResult"><img src="${ctx}/static/images/indexDetail.png" alt=""></a></span>
                       </div>
                        </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="number1">
                         <div class="col-xs-3">
                           <img src="${ctx}/static/images/indexBottom4.png" alt="" >
                         </div>
                       <div class="col-xs-9">
                            <h3 class="fontAll">告警监控</h3>   
                             <span>模型输出结果的管理</span>
                           <span>  <ul>
                            <li>预警与隐患的维护</li>
                            <li>告警统计与分析</li>
                            <li>告警明细查询</li>
                            </ul>  </span>
                             <span><a href="${ctx}/MonitorOperation/WarnAnalysis"><img src="${ctx}/static/images/indexDetail.png" alt="" ></a></span>                 
                       </div>
                        </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="number1">
                         <div class="col-xs-3">
                           <img src="${ctx}/static/images/indexBottom5.png" alt="" >
                         </div>
                       <div class="col-xs-9">
                            <h3 class="fontAll">协查单管理</h3>
                             <span>根据模型输出结果与省公司的沟通管理</span>
                            <span> <ul>
                            <li>协查单统计与分析</li>
                            <li>协查单明细查询</li></ul></span>
                            <span><a href="${ctx}/MonitorOperation/WorkingOrderAnalysis"><img src="${ctx}/static/images/indexDetail.png" alt="" ></a></span>
                            
                       </div>
                        </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="number1">
                          <div class="col-xs-3">
                           <img src="${ctx}/static/images/indexBottom6.png" alt="" >
                         </div>
                       <div class="col-xs-9">
                            <h3 class="fontAll">故障管理</h3>
                             <span>省公司确认是故障的故障信息管理</span>
                            <span><ul>
                            <li>故障创建与维护</li>
                            <li>故障统计与分析</li>
                            <li>故障明细查询</li></ul></span>
                           <span><a href="${ctx}/MonitorOperation/FailureAnalysis"><img src="${ctx}/static/images/indexDetail.png" alt="" ></a></span> 
                       </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
       </div> 
      </shiro:hasAnyRoles>  
        <!-- 工作视图 -->
 <shiro:hasAnyRoles name="businessAnalysis,dataAnalysis">      
  <div id="contentdiv2">
  <div id="content2" class="container" >
            <div class="section">
                <div class="row">
                    <div class="col-xs-12">
                       <div class="panel panel-default" >
                           <div class="panel-heading">待处理的预警和隐患<span style="float:right"><a href="${ctx}/MonitorOperation/WorkingOrderManage?warningId=-2">查看更多...</a></span></div>
                           <div class="panel-body" >
			                     <table id="indexTable1" class="table table-hover table-striped" style="text-align:center;"></table>
                          </div>
                       </div>
		            </div>
                    <div class="col-xs-12">
			        <div class="panel panel-default" >
                           <div class="panel-heading">发出的预警和隐患相关未关闭的协查单<span style="float:right"><a href="${ctx}/MonitorOperation/WorkingOrderReasult?xcdId=-8">查看更多...</a></span></div>
                           <div class="panel-body">
			                     <table id="indexTable2" class="table table-hover table-striped"  style="text-align:center;"> </table>
                         </div>
                    </div>
			        </div>
                </div>
           </div>
     </div>
  </div> 
  </shiro:hasAnyRoles>
 <%--  <input type="hidden" id="xcdWarning" value='${xcdWarningInfo}'>
  <input type="hidden" id="xcdDetail" value='${xcdDetailInfo}'> --%>
     <script type="text/javascript" src="${ctx}/static/js/indexTable.js"></script> 
     <script type="text/javascript" src="${ctx}/static/js/indexTable1.js"></script>
      <script type="text/javascript" src="${ctx}/static/js/indexTable2.js"></script>
    <script type="text/javascript">
    function earlyWarningClick() {
    $("#early_warning").parent().attr("class","col-xs-4 active");
    $("#risk").parent().attr("class","col-xs-4 ");
    $("#failure").parent().attr("class","col-xs-4");
       indexTable('early_warning');
       j=1;
    }
    function riskClick() {
    $("#early_warning").parent().attr("class","col-xs-4");
    $("#risk").parent().attr("class","col-xs-4 active");
    $("#failure").parent().attr("class","col-xs-4");
       indexTable('risk');
       j=2;
    }
    function failureClick() {
    $("#early_warning").parent().attr("class","col-xs-4");
    $("#risk").parent().attr("class","col-xs-4");
    $("#failure").parent().attr("class","col-xs-4 active");
       indexTable('failure');
       j=3;
    }
    
   function numAuto() {
    console.log($(".col-xs-4.active").find("a").attr("id"));
    indexTable($(".col-xs-4.active").find("a").attr("id"));
    } 
     var j = 1;
    function tabNum() {
      if(j == 1) {
        earlyWarningClick();
      }else if (j == 2) {
        riskClick();
      }else if(j == 3) {
        failureClick();
        j = 0;
      }
      j++;
        
    }
    
    
    //add by Eric 2014-05-15 17:52 start
  //链接至告警明细相关信息页面
    function openDialog(warningID,WarningSourceTag,DataSourceTag,channelId,businessId,kpiId,configItemId,provinceId,warningTitle,provinceName,channelName,businessName,dataSourceName,warningSourceName,kpiCode,kpiName,ciCode,ciName,providerName,importanceLevelName,occurTime,closeTime,workingOrderCode,relevantFailureId,riskEarlyWarningTypeId,dataModelName,closestatus,warningStatus) {
        $.dialog({
            title:'告警明细相关信息页面 告警ID:'+warningID, 
            content:"<div class='dialog-p'>"
                + "<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>告警明细</div><div class='panel-body'><table class='table table-vertical'><tr><td>告警标题</td><td colspan='7'>"+warningTitle+"</td></tr><tr><td width='10%'>告警ID</td><td>"+warningID+"</td><td width='10%'>省份</td><td>"+provinceName+"</td><td width='10%'>业务</td><td>"+businessName+"</td><td width='10%'>渠道</td><td>"+channelName+"</td></tr><tr><td>指标编码</td><td>"+kpiCode+"</td><td>指标名称</td><td>"+kpiName+"</td><td>相关集成商</td><td>"+providerName+"</td><td>告警级别</td><td>"+importanceLevelName+"</td></tr><tr><td>配置项编码</td><td>"+ciCode+"</td><td>配置项名称</td><td>"+ciName+"</td><td>关闭类型</td><td>"+closestatus+"</td><td>告警状态</td><td>"+warningStatus+"</td></tr><tr><td>发生时间</td><td>"+occurTime+"</td><td>结束时间</td><td>"+closeTime+"</td><td>协查单号</td><td>"+workingOrderCode+"</td><td>故障单号</td><td>"+relevantFailureId+"</td></tr><tr><td>分析模型</td><td>"+dataModelName+"</td><td width='10%'>数据来源</td><td>"+dataSourceName+"</td><td width='10%'>告警来源</td><td>"+warningSourceName+"</td><td></td><td></td></tr></table> </div> </div> </div>"//告警明细,参数从外部传入
                + ((WarningSourceTag==2||WarningSourceTag==3)?"<div class='dialog-p'><div name='loading' class='loading' style='top:270px;height:300px'><img src='${ctx}/static/images/loading.gif'/></div><iframe id='ewarningIf' style='height:300px;padding: 7px;' scrolling='no' src='${biserver_config}&path=MonitorOperation/WarnAnalysis&action=GJFX_DETAIL_RELATED_EWARN.xaction&wrapper=false&height=208&WarningID="+warningID+"&WarningSourceTag="+WarningSourceTag+"&DataSourceTag="+ DataSourceTag+"&ChannelTag="+ channelId+"&BusinessTag="+ businessId+"&KPITag="+ kpiId+"&ConfigItemTag="+ configItemId+"&ProvinceTag="+ provinceId+"&occurTimeTag="+((occurTime!='')?occurTime:"2014-01-01 00:00:00") +"'></iframe></div><br/>":"")//iframe,当为预警或隐患时显示iframe
                + "<div id='xcdList'> "
                + "<div class='col-xs-6'><div class='panel panel-default'><div class='panel-heading'>协查单</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='15%'>编号</th> <th width='45%'>协查单标题</th> <th width='20%'>开始时间</th> <th width='20%'>结束时间</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> "//协查单
                + "<div  class='col-xs-6'><div class='panel panel-default'><div class='panel-heading'>变更单</div><div class='panel-body'>  <table class='table table-hover table-striped'> <thead> <tr> <th width='15%'>编号</th> <th width='45%'>变更单标题</th> <th width='20%'>开始时间</th> <th width='20%'>结束时间</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> "//变更单 
                +"</div>",
            lock: true, 
            initialize:function(){
                $('#ewarningIf').load( function(){ $(this).parent().find('.loading').fadeOut("fast"); });
                var ajax_url='${ctx}/MonitorOperation/WarnAnalysisDetail/getWorkingOrderInfo/'+warningID+'/'+((warningStatus=='已关联协查单')?'null':riskEarlyWarningTypeId)+'/';//当已关联协查单时为null,输出关联的协查单;其他情况传入分析模型id继续查找协查单并输出
                $.ajax({
                    type : 'GET',
                    contentType : 'application/json',
                    url: ajax_url,
                    dataType : 'text',
                    beforeSend: function(data) {},
                    success: function(data) {
                        var obj = JSON.parse(data),  //由JSON字符串转换为JSON对象
                            a_link=" target='_blank' href='${ctx}/MonitorOperation/WorkingOrderDetail?xcdCode=";
                        for(var j=0;j<obj.length&&j<$('#xcdList tbody').length;j++){
                            for(var i=0;i<obj[j].length;i++){
                                $('#xcdList tbody').eq(j).append($("<tr></tr>")
                                    .append((String(obj[j][i][0]).length<27)?//当字数多于两行时隐藏用省略号,协查单时需添加链接
                                        (j==0)?$("<td></td>").append($("<a"+a_link+obj[j][i][0]+"'></a>").html(obj[j][i][0])):$("<td></td>").html(obj[j][i][0]):
                                        (j==0)?$("<td></td>").attr('title',obj[j][i][0]).append($("<a"+a_link+obj[j][i][0]+"'></a>").html(obj[j][i][0].substring(0,26)+'..')):$("<td></td>").attr('title',obj[j][i][0]).html(obj[j][i][0].substring(0,26)+'..'))                    
                                    .append((String(obj[j][i][1]).length<27)?
                                        $("<td></td>").html(obj[j][i][1]):
                                        $("<td></td>").attr('title',obj[j][i][1]).html(obj[j][i][1].substring(0,26)+'..'))
                                    .append("<td>"+((obj[j][i][2]!=null&&obj[j][i][2]!='')?formatDate(obj[j][i][2],"yyyy-MM-dd HH:mm:ss"):"")+"</td>")
                                    .append("<td>"+((obj[j][i][3]!=null&&obj[j][i][3]!='')?formatDate(obj[j][i][3],"yyyy-MM-dd HH:mm:ss"):"")+"</td>")); 
                            }
                        }
                    }
                });
            }
        });         
    }
//add by Eric 2014-05-15 17:52 end 
  
    </script>
</body>
</html>