analysismain.jsp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 wfId = $("#wfId").val();
  14. // 日期
  15. var recordDate = $("#recordDate").val();
  16. $("#wfIdQ").val(wfId);
  17. $("#recordDateQ").val(recordDate);
  18. showJqGrid();
  19. jQuery("#gridTable").jqGrid('setGridParam',{url:"/statisticsAnalysis/analysismainlist.action?recordDate="+recordDate+"&wfId="+wfId}).trigger("reloadGrid");
  20. }
  21. function queryClear(){
  22. $("#wfId").val("");
  23. $("#recordDate").val("");
  24. $("#wfIdQ").val("");
  25. $("#recordDateQ").val("");
  26. }
  27. function requestAction(url){
  28. // 场站
  29. var wfIdQ = $("#wfIdQ").val();
  30. // 日期
  31. var recordDateQ = $("#recordDateQ").val();
  32. /*alert(url+"&wfIdQ=" + wfIdQ + "&recordDateQ=" + recordDateQ);
  33. return false;*/
  34. $("#f1").attr("action",url+"&wfIdQ=" + wfIdQ + "&recordDateQ=" + recordDateQ);
  35. $("#f1").submit();
  36. }
  37. $(function(){
  38. // 场站
  39. var wfIdQ = $("#wfIdQ").val();
  40. // 日期
  41. var recordDateQ = $("#recordDateQ").val();
  42. $("#wfId").val(wfIdQ);
  43. $("#recordDate").val(recordDateQ);
  44. showJqGrid();
  45. });
  46. // 加载jqgrid表格
  47. function showJqGrid(){
  48. // 场站
  49. var wfId = $("#wfId").val();
  50. // 日期
  51. var recordDate = $("#recordDate").val();
  52. // 场站
  53. var wfIdQ = $("#wfIdQ").val();
  54. // 日期
  55. var recordDateQ = $("#recordDateQ").val();
  56. jQuery("#gridTable").jqGrid({
  57. url:'/statisticsAnalysis/analysismainlist.action?recordDate='+recordDate+'&wfId='+wfId,
  58. datastr: 'data.json',
  59. mtype:'POST',
  60. datatype: "json",
  61. colNames:['编号', '场站编号','场站','日期','操作'],
  62. colModel:[
  63. { name: 'id', index: 'id', width: 200, align: 'center', hidden: true},
  64. { name: 'wpId', index: 'wpId', width: 200, align: 'center', hidden: true},
  65. { name: 'wpName', index: 'wpName', width: 200, align: 'center'},
  66. { name: 'recordDate', index: 'recordDate', width: 200, align: 'center'},
  67. { name: 'operate', index: 'operate', width: 200, align: 'center'}
  68. ],
  69. rowNum:20,
  70. rowList:[10,20,30],
  71. pager: '#gridPager',
  72. height:670,
  73. width:1610,
  74. sortname: 'recordDate',
  75. viewrecords: true,
  76. autowidth: true,
  77. sortorder: "desc",
  78. caption: "统计分析列表",
  79. jsonReader: {
  80. repeatitems: false,
  81. root: function (obj) { return obj.rows; },
  82. page: function (obj) { return obj.pageindex; },
  83. total: function (obj) { return obj.pagecount; },
  84. records: function (obj) { return obj.total; }
  85. },
  86. prmNames: {
  87. page: 'page',
  88. rows: 'pageSize'
  89. },
  90. afterInsertRow:function(rowid,rowdata,rowelem){
  91. var operateLink = "<a href=\"#\" onclick=\"requestAction('/statisticsAnalysis/index.action?wfId=" + rowdata.wpId + "&stId=" + rowdata.id + "&recordDate=" + rowdata.recordDate + "')\">场站统计分析</a>&nbsp/&nbsp"+
  92. "<a href=\"#\" onclick=\"requestAction('/windTurbineAnalysis/windturbineanalysismain.action?wfId=" + rowdata.wpId + "&stId=" + rowdata.id + "&recordDate=" + rowdata.recordDate + "')\">设备统计分析</a>";
  93. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{operate:operateLink});
  94. }
  95. });
  96. }
  97. </script>
  98. <style type="text/css">
  99. fieldset legend {
  100. color:#302A2A;
  101. font: bold 16px/2 Verdana, Geneva, sans-serif;
  102. font-weight: bold;
  103. text-align: left;
  104. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  105. }
  106. </style>
  107. </head>
  108. <body>
  109. <fieldset id="fst">
  110. <legend class="item_Name">查询条件</legend>
  111. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  112. <tr>
  113. <td width="100px">
  114. 场站:
  115. </td>
  116. <td width="100px">
  117. <s:select list="windpowers" cssStyle="width:173px;" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" ></s:select>
  118. <input type="text" id="wfIdQ" value="${wfIdQ}" style="display: none"/>
  119. </td>
  120. <td style="width: 50px;">
  121. 日期:
  122. </td>
  123. <td style="padding-left: 50px;width: 50px;">
  124. <s:textfield
  125. cssClass="Wdate"
  126. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  127. id="recordDate" name="recordDate" title="日期" />
  128. <s:textfield
  129. cssClass="Wdate"
  130. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  131. id="recordDateQ" name="recordDateQ" title="日期" style="display: none"/>
  132. </td>
  133. <td style="padding-left: 50px;">
  134. <input type="button" class="button" onclick="javascript:queryData();" value="查询"/>
  135. <input type="button" class="button" onclick="javascript:queryClear();" value="清空"/>
  136. </td>
  137. </tr>
  138. </table>
  139. </fieldset>
  140. <br/>
  141. <table id='gridTable'></table>
  142. <div id='gridPager'></div>
  143. <form action="" method="post" id="f1">
  144. </body>