shutDown.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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" src="<%=request.getContextPath()%>/resource/plugin/highslide/highslide-with-html.js"></script>
  11. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/plugin/highslide/highslide.css" />
  12. <style type="text/css">
  13. a{ /* 统一设置所以样式 */
  14. font-family:Arial;
  15. font-size:12px;
  16. text-align:center;
  17. margin:3px;
  18. }
  19. a:link,a:visited{ /* 超链接正常状态、被访问过的样式 */
  20. color:#000000;
  21. padding:4px 10px 4px 10px;
  22. background-color:#f1f1f1;
  23. text-decoration:none;
  24. border-top:1px solid #EEEEEE; /* 边框实现阴影效果 */
  25. border-left:1px solid #EEEEEE;
  26. border-bottom:1px solid #717171;
  27. border-right:1px solid #717171;
  28. }
  29. a:hover{ /* 鼠标指针经过时的超链接 */
  30. color:#821818; /* 改变文字颜色 */
  31. padding:5px 8px 3px 12px; /* 改变文字位置 */
  32. background-color:#e2c4c9; /* 改变背景色 */
  33. border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
  34. border-left:1px solid #717171;
  35. border-bottom:1px solid #EEEEEE;
  36. border-right:1px solid #EEEEEE;
  37. }
  38. fieldset legend {
  39. color:#302A2A;
  40. font: bold 16px/2 Verdana, Geneva, sans-serif;
  41. font-weight: bold;
  42. text-align: left;
  43. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  44. }
  45. </style>
  46. <script type="text/javascript">
  47. hs.graphicsDir = '<%=request.getContextPath()%>/resource/plugin/highslide/graphics/';
  48. hs.outlineType = 'rounded-white';
  49. hs.wrapperClassName = 'draggable-header';
  50. function showDiv() {
  51. var hc = $("#container1");
  52. return hs.htmlExpand(hc[0], {
  53. contentId : "showDiv",
  54. width : 980,
  55. height : 600,
  56. align : 'center',
  57. headingText : '查看报警信息'
  58. });
  59. }
  60. function displaybuttons(cellvalue, options, rawObject) {
  61. var detail = "<input type='button' value='查看报警信息' onclick=detail('"
  62. + rawObject.id+"','"+rawObject.warningId+ "')>";
  63. return "&nbsp;&nbsp;&nbsp;\t" + detail + "&nbsp;&nbsp;&nbsp;\t";
  64. };
  65. function detail(id,wainid) {
  66. $("#gridTable1").jqGrid('GridUnload');
  67. $("#gridTable2").jqGrid('GridUnload');
  68. showJqGrid1(id,wainid);
  69. showJqGrid2(id);
  70. showDiv();
  71. }
  72. function changeFc(fcId){
  73. var url1 = "../warn/changeFc.action?fcId="+fcId;
  74. $.ajax({
  75. type:"post",
  76. url:url1,
  77. dataType:"json",
  78. success: function(data){
  79. if(data.length != 0){
  80. eval(data);
  81. $("#wtId").empty();
  82. $("#wtId").append("<option value=''>请选择</option>");
  83. for(var i=0; i<data.length; i++){
  84. $("#wtId").append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
  85. }
  86. }else{
  87. $("#wtId").append("<option value=''>请选择</option>");
  88. $("#wtId").append("<option value=''>请选择</option>");
  89. }
  90. queryData();
  91. }
  92. });
  93. }
  94. function queryData(){
  95. var wfId = $("#wfId").val();
  96. var wtId = $("#wtId").val();
  97. var type = $("#type").val();
  98. var beginDate = $("#beginDate").val();
  99. var endDate = $("#endDate").val();
  100. if("" == beginDate){
  101. alert("请选择查询开始日期!");
  102. }else if("" ==endDate){
  103. alert("请选择查询结束日期!");
  104. }else if(beginDate >endDate){
  105. alert("结束日期不允许小于开始日期!");
  106. }else{
  107. var temp="query.action?beginDate="+beginDate
  108. +"&endDate="+endDate
  109. +"&wfId="+wfId
  110. +"&wtId="+wtId
  111. +"&type="+type;
  112. var url= encodeURI(encodeURI(temp));
  113. $("#gridTable").setGridParam({url:url}).trigger("reloadGrid");
  114. }
  115. }
  116. function toExcel() {
  117. var wfId = $("#wfId").val();
  118. var wtId = $("#wtId").val();
  119. var type = $("#type").val();
  120. var beginDate = $("#beginDate").val();
  121. var endDate = $("#endDate").val();
  122. if("" == beginDate){
  123. alert("请选择查询开始日期!");
  124. }else if("" ==endDate){
  125. alert("请选择查询结束日期!");
  126. }else if(beginDate >endDate){
  127. alert("结束日期不允许小于开始日期!");
  128. }else{
  129. var temp="shutDownExcel.action?beginDate="+beginDate
  130. +"&endDate="+endDate
  131. +"&wfId="+wfId
  132. +"&wtId="+wtId
  133. +"&type="+type;
  134. var url= encodeURI(encodeURI(temp));
  135. $('#toexcel').attr('href',url);
  136. }
  137. }
  138. $(document).ready(function () {
  139. showJqGrid();
  140. });
  141. function showJqGrid() {
  142. var wfId = $("#wfId").val();
  143. var wtId = $("#wtId").val();
  144. var type = $("#type").val();
  145. var beginDate = $("#beginDate").val();
  146. var endDate = $("#endDate").val();
  147. var temp="query.action?beginDate="+beginDate
  148. +"&endDate="+endDate
  149. +"&wfId="+wfId
  150. +"&wtId="+wtId
  151. +"&type="+type;
  152. var url= encodeURI(encodeURI(temp));
  153. var id = 'gridTable';
  154. var datatype = 'json';
  155. var colNames = ['场站', '机组','开始时刻','结束时刻','停机小时数(h)','状态','停机类型','损失电量(kWh)','报警信息','操作'];
  156. var colModel = [
  157. { name: 'wpName', index: 'wpName', width: 100, align: 'center'},
  158. { name: 'wtName', index: 'wtName', width: 100, align: 'center'},
  159. { name: 'stopTime', index: 'stopTime', width: 150, align: 'center'},
  160. { name: 'startTime', index: 'startTime', width: 150, align: 'center'},
  161. { name: 'stopHours', index: 'stopHours', width: 150, align: 'center'},
  162. { name: 'statusName', index: 'statusName', width: 150, align: 'center'},
  163. { name: 'stopTypeName', index: 'stopTypeName', width: 150, align: 'center'},
  164. { name: 'lossPower', index: 'lossPower', width: 150, align: 'center'},
  165. { name: 'handleWay', index: 'handleWay', width: 150, align: 'center'},
  166. { name: 'wpName', index: 'wpName', width: 150, align: 'center',formatter:displaybuttons}
  167. ];
  168. var caption = '停机事件记录列表';
  169. var sortname = 'stopTime';
  170. var gridPagerID ='gridPager';
  171. var sortorder='desc';
  172. var height='670';
  173. var width='1610';
  174. var rownumbers=true;
  175. var multiselect=false;
  176. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  177. multiselect,rownumbers);
  178. }
  179. function updateevent(id,eventid){
  180. $.ajax({
  181. url : "updateevent.action?warndata="+id+"&eventdata="+eventid+"",
  182. type : "post",
  183. cache : false,
  184. dataType : "json",
  185. ifModified : false,
  186. success : function(result) {
  187. alert("您已添加成功");
  188. queryData();
  189. }
  190. });
  191. }
  192. function showJqGrid1(id,warnid) {
  193. var temp="readWarm.action?event.id="+id+"&warndata="+warnid+"";
  194. var url= temp;
  195. var id = 'gridTable1';
  196. var datatype = 'json';
  197. var colNames = ['报警编号','报警时刻', '报警信息'];
  198. var colModel = [
  199. { name: 'levelname', index: 'levelname', width: 120, align: 'center'},
  200. { name: 'className', index: 'className', width: 150, align: 'center'},
  201. { name: 'warnDesc', index: 'warnDesc', width: 300, align: 'center'}
  202. ];
  203. var caption = '报警信息列表';
  204. var sortname = 'className';
  205. var gridPagerID ='gridPager1';
  206. var sortorder='desc';
  207. var height='300';
  208. var width='980';
  209. var rownumbers=true;
  210. var multiselect=false;
  211. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  212. multiselect,rownumbers);
  213. }
  214. function showJqGrid2(id) {
  215. var temp="earlyWarm.action?event.id="+id;;
  216. var url= encodeURI(encodeURI(temp));
  217. var id = 'gridTable2';
  218. var datatype = 'json';
  219. var colNames = ['所属场站', '所属机组', '预警描述', '预警等级', '开始时间', '结束时间'];
  220. var colModel = [
  221. { name: 'windpowerstationname', index: 'windpowerstationname', width: 150, align: 'center'},
  222. { name: 'windturbineid', index: 'windturbineid', width: 80, align: 'center'},
  223. { name: 'earlywarningname', index: 'earlywarningname', width: 150, align: 'center'},
  224. { name: 'type', index: 'type', width: 80, align: 'center'},
  225. { name: 'begindate', index: 'begindate', width: 150, align: 'center'},
  226. { name: 'enddate', index: 'enddate', width: 150, align: 'center'}
  227. ];
  228. var caption = '预警信息列表';
  229. var sortname = 'begindate';
  230. var gridPagerID ='gridPager2';
  231. var sortorder='desc';
  232. var height='300';
  233. var width='980';
  234. var rownumbers=true;
  235. var multiselect=false;
  236. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  237. multiselect,rownumbers);
  238. }
  239. </script>
  240. <style type="text/css">
  241. fieldset legend {
  242. color:#302A2A;
  243. font: bold 16px/2 Verdana, Geneva, sans-serif;
  244. font-weight: bold;
  245. text-align: left;
  246. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  247. }
  248. </style>
  249. </head>
  250. <body>
  251. <form action="index.action" method="post" id="f1">
  252. <fieldset style="height: 50px;width: 1580px" id="fst">
  253. <legend class="item_Name">查询条件</legend>
  254. <table class="dataform">
  255. <tr>
  256. <th width="5%" class="item_Name">
  257. 场站:
  258. </th>
  259. <td width="15%" >
  260. <s:select list="wps" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="javascript:changeFc(this.value);" ></s:select>
  261. </td>
  262. <th width="5%" class="item_Name">
  263. 机组:
  264. </th>
  265. <td width="15%">
  266. <select name="wtId" id="wtId" onchange="queryData();">
  267. <option value="">请选择</option>
  268. </select>
  269. </td>
  270. <th width="5%">
  271. 类型:
  272. </th>
  273. <td width="15%" >
  274. <s:select list="#{'':'全部','4':'维护','2':'故障'}" cssStyle="width:90%" id="type" name="type" onchange="javascript:queryData();"></s:select>
  275. </td>
  276. <th width="5%" class="item_Name">
  277. 开始日期
  278. </th>
  279. <td width="10%" style="text-align: left">
  280. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  281. id="beginDate" name="beginDate" title="开始日期" onchange="queryData();"/>
  282. </td>
  283. <th width="5%" class="item_Name">
  284. 结束日期
  285. </th>
  286. <td width="10%" style="text-align: left">
  287. <s:textfield cssClass="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  288. id="endDate" name="endDate" title="结束日期" onchange="queryData();"/>
  289. </td>
  290. <td width="10%" style="text-align: right">
  291. <a href="#" onclick="javascript:toExcel();" id="toexcel">导出</a>
  292. </td>
  293. <td width="40%"></td>
  294. </tr>
  295. </table>
  296. </fieldset>
  297. <br/>
  298. <table id='gridTable' height="100%">
  299. </table>
  300. <div id='gridPager'></div>
  301. <div class="highslide-html-content" id="showDiv" style="width: 980px">
  302. <div class="highslide-header">
  303. <ul>
  304. <li class="highslide-move">
  305. <a href="#" onclick="return false">Move</a>
  306. </li>
  307. <li class="highslide-close" style="width: 20px;height: 10px">
  308. <a href="#" onclick="return hs.close(this)" style="width: 10px;height: 10px"></a>
  309. </li>
  310. </ul>
  311. </div>
  312. <div class="highslide-body" id="container1" style="width: 980px">
  313. <table id='gridTable1' height="100%">
  314. </table>
  315. <table id='gridTable2' height="100%">
  316. </table>
  317. </div>
  318. </div>
  319. </form>
  320. </body>