index.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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/jqdatagrid.js"></script>
  8. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  9. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  10. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  11. <style type="text/css">
  12. </style>
  13. <script type="text/javascript">
  14. function queryClear(){
  15. $("#targetName").val("");
  16. }
  17. function returnMainPage(){
  18. var recordDateQ = $("#recordDateQ").val();
  19. $("#formView").attr("action", "/statisticsAnalysisBranch/analysisBranchMain.action?recordDateQ="+recordDateQ).submit();
  20. }
  21. function queryData(){
  22. // 风场ID
  23. var id = $("#id").val();
  24. // 指标名称
  25. var targetName = $("#targetName").val();
  26. jQuery("#gridTable").jqGrid('setGridParam',{url:encodeURI(encodeURI("/statisticsAnalysisBranch/analysisBranchList.action?id="+ id + "&targetName="+targetName))}).trigger("reloadGrid");
  27. }
  28. $(function(){
  29. showJqGrid();
  30. // 风场名称
  31. var wsnametext = $("#wfId").find("option:selected").text();
  32. $("#wsname").text(wsnametext);
  33. // 日期
  34. var wstimetext = $("#recordDate").val();
  35. $("#wstime").text(wstimetext);
  36. });
  37. // 加载jqgrid表格
  38. function showJqGrid(){
  39. // 风场ID
  40. var id = $("#id").val();
  41. // 指标名称
  42. var targetName = $("#targetName").val();
  43. jQuery("#gridTable").jqGrid({
  44. url:'/statisticsAnalysisBranch/analysisBranchList.action?id='+id+'&targetName='+targetName,
  45. datatype: "json",
  46. colNames:['编号', '指标名称','单位','当日值(只读)','当日值(可变)','当前星期值','当前月份值','当前季度值','当前年值','类别','公式描述'],
  47. colModel:[
  48. { name: 'id', index: 'id', width: 200, align: 'center', hidden: true},
  49. { name: 'targetName', index: 'targetName', width: 200, align: 'center'},
  50. { name: 'unit', index: 'unit', width: 200, align: 'center'},
  51. { name: 'dayValueR', index: 'dayValueR', width: 200, align: 'center'},
  52. { name: 'dayValue', index: 'dayValue', width: 200, align: 'center',editable : true},
  53. { name: 'weekValue', index: 'weekValue', width: 200, align: 'center'},
  54. { name: 'monthValue', index: 'monthValue', width: 200, align: 'center'},
  55. { name: 'quarterValue', index: 'wpId', width: 200, align: 'center'},
  56. { name: 'yearValue', index: 'wpName', width: 200, align: 'center'},
  57. { name: 'type', index: 'recordDate', width: 200, align: 'center'},
  58. { name: 'formulaDesc', index: 'operate', width: 200, align: 'center'}
  59. ],
  60. rowNum:1000,
  61. height:'670',
  62. width:'1610',
  63. editurl : '/statisticsAnalysisBranch/analysisBranchList.action?id='+id+'&targetName='+targetName+"/RowEditing",
  64. autowidth: true,
  65. sortorder: "desc",
  66. caption: "统计分析列表",
  67. pager: '#gridPager',
  68. viewrecords: true,
  69. afterInsertRow:function(rowid,rowdata,rowelem){
  70. if(rowdata.type == '基础' ){
  71. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Green>"+rowdata.targetName+"</font>"});
  72. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Green>"+rowdata.unit+"</font>"});
  73. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Green>"+rowdata.dayValueR+"</font>"});
  74. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Green>"+rowdata.dayValue+"</font>"});
  75. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Green>"+rowdata.weekValue+"</font>"});
  76. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Green>"+rowdata.monthValue+"</font>"});
  77. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Green>"+rowdata.quarterValue+"</font>"});
  78. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Green>"+rowdata.yearValue+"</font>"});
  79. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Green>"+rowdata.type+"</font>"});
  80. } else if(rowdata.type == '计算' ){
  81. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Purple>"+rowdata.targetName+"</font>"});
  82. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Purple>"+rowdata.unit+"</font>"});
  83. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Green>"+rowdata.dayValueR+"</font>"});
  84. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Purple>"+rowdata.dayValue+"</font>"});
  85. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Purple>"+rowdata.weekValue+"</font>"});
  86. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Purple>"+rowdata.monthValue+"</font>"});
  87. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Purple>"+rowdata.quarterValue+"</font>"});
  88. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Purple>"+rowdata.yearValue+"</font>"});
  89. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Purple>"+rowdata.type+"</font>"});
  90. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{formulaDesc:"<font color=Purple>"+rowdata.formulaDesc+"</font>"});
  91. } else if(rowdata.type == '默认' ){
  92. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Orange>"+rowdata.targetName+"</font>"});
  93. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Orange>"+rowdata.unit+"</font>"});
  94. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Orange>"+rowdata.dayValueR+"</font>"});
  95. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Orange>"+rowdata.dayValue+"</font>"});
  96. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Orange>"+rowdata.weekValue+"</font>"});
  97. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Orange>"+rowdata.monthValue+"</font>"});
  98. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Orange>"+rowdata.quarterValue+"</font>"});
  99. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Orange>"+rowdata.yearValue+"</font>"});
  100. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Orange>"+rowdata.type+"</font>"});
  101. } else if(rowdata.type == '手填' ){
  102. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Blue>"+rowdata.targetName+"</font>"});
  103. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Blue>"+rowdata.unit+"</font>"});
  104. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Blue>"+rowdata.dayValueR+"</font>"});
  105. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Blue>"+rowdata.dayValue+"</font>"});
  106. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Blue>"+rowdata.weekValue+"</font>"});
  107. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Blue>"+rowdata.monthValue+"</font>"});
  108. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Blue>"+rowdata.quarterValue+"</font>"});
  109. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Blue>"+rowdata.yearValue+"</font>"});
  110. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Blue>"+rowdata.type+"</font>"});
  111. } else if(rowdata.type == '特殊' ){
  112. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Red>"+rowdata.targetName+"</font>"});
  113. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Red>"+rowdata.unit+"</font>"});
  114. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Red>"+rowdata.dayValueR+"</font>"});
  115. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Red>"+rowdata.dayValue+"</font>"});
  116. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Red>"+rowdata.weekValue+"</font>"});
  117. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Red>"+rowdata.monthValue+"</font>"});
  118. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Red>"+rowdata.quarterValue+"</font>"});
  119. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Red>"+rowdata.yearValue+"</font>"});
  120. jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Red>"+rowdata.type+"</font>"});
  121. }
  122. }
  123. });
  124. }
  125. </script>
  126. </head>
  127. <body>
  128. <table width="100%">
  129. <tr>
  130. <td align="left" class="navbar" style="font-size: 12px;"><font id="wsname"></font>统计分析<font id="wstime"></font></td>
  131. <td align="right">
  132. <input type="button" class="button" onclick="javascript:returnMainPage();" value="返回"/>
  133. </td>
  134. </tr>
  135. </table>
  136. <hr/>
  137. <fieldset style="height: 60px" id="fst">
  138. <legend class="item_Name">查询条件</legend>
  139. <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
  140. <tr>
  141. <td align="left" >
  142. <input type="text" id="id" value="${id}" style="display: none;"/>
  143. <!-- 风场: --><s:select list="windpowers" cssStyle="width:173px;display:none" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="javascript:queryData()" ></s:select>
  144. 指标名称:<s:textfield name="targetName" id="targetName"></s:textfield>
  145. <!--指标编码:<s:textfield name="targetCode" id="targetCode"></s:textfield> -->
  146. <!-- 日期: --><s:textfield
  147. cssClass="Wdate"
  148. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  149. id="recordDate" name="recordDate" title="日期" onchange="javascript:queryData()" style="display:none"/>
  150. <s:textfield
  151. cssClass="Wdate"
  152. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  153. id="recordDateQ" name="recordDateQ" title="日期" style="display:none" />
  154. <input type="button" class="button" onclick="javascript:queryData();" value="查询"/>
  155. <input type="button" class="button" onclick="javascript:queryClear();" value="清空"/>
  156. </td>
  157. </tr>
  158. </table>
  159. </fieldset>
  160. <br/>
  161. <table id='gridTable'></table>
  162. <div id='gridPager'></div>
  163. <form action="" method="post" id="formView">
  164. </form>
  165. </body>