analysismain.jsp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp" %>
  3. <head>
  4. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js"></script>
  5. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
  6. <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
  7. <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/js/system/jqdatagridpage.js"></script><script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  8. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  9. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  10. <script type="text/javascript">
  11. function queryData(){
  12. // 日期
  13. var recordDate = $("#recordDate").val();
  14. jQuery("#gridTable").jqGrid('setGridParam',{url:"/statisticsAnalysis/analysismainlist.action?recordDate="+recordDate}).trigger("reloadGrid");
  15. }
  16. function queryClear(){
  17. $("#wfId").val("");
  18. $("#recordDate").val("");
  19. $("#wfIdQ").val("");
  20. $("#recordDateQ").val("");
  21. }
  22. function requestAction(url){
  23. $("#f1").attr("action",url);
  24. $("#f1").submit();
  25. }
  26. $(function(){
  27. showJqGrid();
  28. });
  29. // 加载jqgrid表格
  30. function showJqGrid(){
  31. // 日期
  32. //var recordDate = $("#recordDate").val();
  33. jQuery("#gridTable").jqGrid({
  34. url:'/statisticsAnalysis/analysismainlist.action',
  35. datastr: 'data.json',
  36. datatype: "json",
  37. colNames:['编号', '场站编号','场站','日期','操作'],
  38. colModel:[
  39. { name: 'id', index: 'id', width: 200, align: 'center', hidden: true},
  40. { name: 'wpId', index: 'wpId', width: 200, align: 'center', hidden: true},
  41. { name: 'wpName', index: 'wpName', width: 200, align: 'center'},
  42. { name: 'recordDate', index: 'recordDate', width: 200, align: 'center'},
  43. { name: 'operate', index: 'operate', width: 200, align: 'center'}
  44. ],
  45. rowNum:10,
  46. rowList:[10,20,30],
  47. height:'670',
  48. width:'1610',
  49. pager: '#gridPager',
  50. sortname: 'recordDate',
  51. viewrecords: true,
  52. autowidth: true,
  53. sortorder: "desc",
  54. caption: "统计分析列表",
  55. jsonReader: {
  56. repeatitems: false,
  57. root: function (obj) { return obj.rows; },
  58. page: function (obj) { return obj.pageindex; },
  59. total: function (obj) { return obj.pagecount; },
  60. records: function (obj) { return obj.total; }
  61. },
  62. prmNames: {
  63. page: 'page',
  64. rows: 'pageSize'
  65. },
  66. afterInsertRow:function(rowid,rowdata,rowelem){
  67. /*var operateLink = "<a href=\"#\" onclick=\"requestAction('/windTurbineAnalysis/windturbineanalysismain.action?wfId=" + rowdata.wpId + "&recordDate=" + rowdata.recordDate + "')\">查看</a>";
  68. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{operate:operateLink});*/
  69. var operateLink = "<a href=\"#\" onclick=\"requestAction('/statisticsAnalysis/index.action?wfId=" + rowdata.wpId + "&stId=" + rowdata.id + "&recordDate=" + rowdata.recordDate + "&wfIdQ=" + wfIdQ + "&recordDateQ=" + recordDateQ + "')\">场站统计分析</a>&nbsp/&nbsp"+
  70. "<a href=\"#\" onclick=\"requestAction('/windTurbineAnalysis/windturbineanalysismain.action?wfId=" + rowdata.wpId + "&stId=" + rowdata.id + "&recordDate=" + rowdata.recordDate + "&wfIdQ=" + wfIdQ + "&recordDateQ=" + recordDateQ + "')\">设备统计分析</a>";
  71. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{operate:operateLink});
  72. }
  73. });
  74. }
  75. </script>
  76. <style type="text/css">
  77. fieldset legend {
  78. color:#302A2A;
  79. font: bold 16px/2 Verdana, Geneva, sans-serif;
  80. font-weight: bold;
  81. text-align: left;
  82. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  83. }
  84. </style>
  85. </head>
  86. <body>
  87. <fieldset id="fst">
  88. <legend class="item_Name">查询条件</legend>
  89. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  90. <tr>
  91. <td align="left" >
  92. 日期:<s:textfield
  93. cssClass="Wdate"
  94. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  95. id="recordDate" name="recordDate" title="日期" onchange="javascript:queryData()"/>
  96. <input type="button" class="button" onclick="javascript:queryData();" value="查询"/>
  97. <input type="button" class="button" onclick="javascript:queryClear();" value="清空"/>
  98. </td>
  99. </tr>
  100. </table>
  101. </fieldset>
  102. <br/>
  103. <table id='gridTable'></table>
  104. <div id='gridPager'></div>
  105. <form action="" method="post" id="f1">
  106. </body>