| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <base href="<%=basePath%>">
-
- <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">
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta http-equiv="X-UA-Compatible" content="IE=10"/>
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
- <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
- <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
- <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
- <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
- <script type="text/javascript">
- var state = false;
- function formatDatebox(value) {
- if (value == null || value == '') {
- return '';
- }
- var dt = parseToDate(value);//关键代码,将那个长字符串的日期值转换成正常的JS日期格式
- return dt.format("yyyy-MM-dd"); //这里用到一个javascript的Date类型的拓展方法,这个是自己添加的拓展方法,在后面的步骤3定义
- }
- /*带时间*/
- function formatDateBoxFull(value) {
- if (value == null || value == '') {
- return '';
- }
- var dt = parseToDate(value);
- return dt.format("yyyy-MM-dd hh:mm:ss");
- }
-
- </script>
- <script type="text/javascript">
- var i = 1;//第几页
- var sum;//总条数
- var totalpage;//总页数
- $(document).ready(function(){
- fLoadTable();
- fLoadData(1,10);
- });
- function fLoadTable(){
- $('#tt').datagrid({
- fit: true,//自动大小
- title: '',
- width: '100%',
- height: 580,
- toolbar: '#toolbar',
- fitColumns: true,
- loadMsg:'正在加载, 请稍等 …',
- nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
- striped : true,//设置为true将交替显示行背景
- collapsible : true,//显示可折叠按钮
- fitColumns:true,//允许表格自动缩放,以适应父容器
- rownumbers:true,
- columns:[[
- {field:'stationName',title:'地区',width:'250px',align:'left',formatter: function(value, row, index){
- return '<font style="color:black;" class="hzbspan" >'+value+'</font>';
-
-
- }},
- {field:'state',title:'链接状态',width:'180px',height:'26px',align:'left',formatter: function(value, row, index){
- if (value == "1") {
- state = true;
- return '<img src="images/rzx/connect.png"/>';
- }
- else if(value == "0") {
- state = false;
- return '<img src="images/rzx/disconnect.png"/>';
- }
- }},
- {field:'connectTime1',title:'链接时间',width:'180px',align:'left',formatter: function(value, row, index){
- if(state==true){
- return '<font style="color:green;font-weight: bold;" class="hzbspan">'+value+'</font>';}
-
-
- }},
- {field:'disconnectTime1',title:'断开时间',width:'180px',align:'left',formatter: function(value, row, index){
- if(state==false){
- return '<font style="color:red;font-weight: bold;" class="hzbspan">'+value+'</font>';}
-
- }},
- {field:'serverIp',title:'服务器IP',width:'180px',align:'left',formatter: function(value, row, index){
- return '<font style="color:blue;" class="hzbspan">'+value+'</font>';
-
-
- }},
- {field:'clientIp',title:'客户端IP',width:'180px',align:'left',formatter: function(value, row, index){
- return '<font style="color:blue;" class="hzbspan">'+ value+'</font>';
-
-
- }}
- ]]
- });
- }
- function show(message) {
- $.messager.show({
- title: '提示信息',
- msg: message,
- timeout: 2000,
- showType: 'slide'
- });
- }
- function fLoadData(page,rows){
- $.messager.progress({
- title: '请等待',
- msg: '正在加载数据...',
- text: '查询中.......'
- });
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- url:"ajax/getCNGStationTranInfoList",
- success:function (data){
- $.messager.progress('close');
- var vData = $.parseJSON(data);
- sum = vData.total;
- if(sum <=0){
- show("没有查询到相关数据!!!");
- }
- totalpage = Math.ceil(sum/rows);
- $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
- $('#pp').pagination({
- total:sum,
- pageList: [2,10,50,100],
- beforePageText: '第',//页数文本框前显示的汉字
- afterPageText: '页 共 {pages} 页',
- displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
- onSelectPage:function(pageNumber, pageSize){
- fLoadData();
- }
-
-
- });
- }
- });
-
-
- }
- </script>
- </head>
-
- <body>
- <!-- 查询结果:数据表格 -->
- <table id="tt" cellspacing="0" cellpadding="0" >
- </table>
- </body>
- </html>
|