analysistaskwtindex.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <%@ page language="java" contentType="text/html;charset=utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <head>
  4. <script type="text/javascript"
  5. src="<%=request.getContextPath()%>/resource/js/jquery-1.8.3.js">
  6. </script>
  7. <script
  8. src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts.js"
  9. type="text/javascript">
  10. </script>
  11. <script
  12. src="<%=request.getContextPath()%>/resource/js/highcharts/themes/grid.js"
  13. type="text/javascript">
  14. </script>
  15. <script type="text/ecmascript"
  16. src="<%=request.getContextPath()%>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js">
  17. </script>
  18. <script type="text/ecmascript"
  19. src="<%=request.getContextPath()%>/resource/js/system/jqdatagrid.js">
  20. </script>
  21. <script type="text/ecmascript"
  22. src="<%=request.getContextPath()%>/resource/js/system/jqdatatreegrid.js">
  23. </script>
  24. <script
  25. src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js"
  26. type="text/javascript">
  27. </script>
  28. <link rel="stylesheet" type="text/css"
  29. href="<%=request.getContextPath()%>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  30. <link rel="stylesheet" type="text/css" media="screen"
  31. href="<%=request.getContextPath()%>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  32. <link rel="stylesheet"
  33. href="<%=request.getContextPath()%>/resource/css/ztree/zTreeStyle.css"
  34. type="text/css">
  35. <script
  36. src="<%=request.getContextPath()%>/resource/js/ztree/jquery.ztree.all.min.js"
  37. type="text/javascript">
  38. </script>
  39. <link rel="stylesheet"
  40. href="<%=request.getContextPath()%>/resource/js/showloading/showLoading.css"
  41. type="text/css"/>
  42. <script
  43. src="<%=request.getContextPath()%>/resource/js/showloading/jquery.showLoading.js"
  44. type="text/javascript"></script>
  45. <style type="text/css">
  46. .normal {
  47. border-right-style: solid;
  48. border-bottom-style: solid;
  49. border-left-style: solid;
  50. border-top-style: solid;
  51. border-top-color: #ffffff;
  52. border-left-color: #f1f1f1;
  53. border-right-color: #f1f1f1;
  54. border-bottom-color: #f1f1f1;
  55. border-width: 1px;
  56. width: 100px;
  57. height: 28px;
  58. float: left;
  59. margin-top: -1px;
  60. cursor: pointer;
  61. text-align: center;
  62. line-height: 28px;
  63. overflow: hidden;
  64. font-weight: bold;
  65. font-size: 12px;
  66. font-family: tahoma, arial, verdana, sans-serif;
  67. }
  68. .disable {
  69. border-right-style: solid;
  70. border-bottom-style: solid;
  71. border-left-style: solid;
  72. border-top-style: solid;
  73. border-top-color: #f1f1f1;
  74. border-left-color: #f1f1f1;
  75. border-right-color: #f1f1f1;
  76. border-bottom-color: #f1f1f1;
  77. border-width: 1px;
  78. width: 100px;
  79. height: 25px;
  80. float: left;
  81. margin-top: -1px;
  82. cursor: pointer;
  83. text-align: center;
  84. background-color: #e1e1e1;
  85. line-height: 25px;
  86. overflow: hidden;
  87. font-weight: bold;
  88. font-size: 12px;
  89. font-family: tahoma, arial, verdana, sans-serif;
  90. }
  91. .panelcontainer {
  92. width: 100%;
  93. height: 70px;
  94. border-style: solid;
  95. border-color: #f1f1f1;
  96. border-width: 1px;
  97. }
  98. .panelquery {
  99. width: 100%;
  100. height: 25px;
  101. background-color: #f1f1f1;
  102. line-height: 25px;
  103. }
  104. .panelquerytext {
  105. margin-left: 3px;
  106. font-weight: bold;
  107. font-size: 12px;
  108. font-family: tahoma, arial, verdana, sans-serif;
  109. }
  110. .querycondcontainer {
  111. line-height: 39px;
  112. padding: 3px;
  113. float: left;
  114. font-size: 12px;
  115. }
  116. </style>
  117. <script type="text/javascript">
  118. function displaybuttons(cellvalue, options, rawObject) {
  119. var detail = "<input type='button' value='详情' onclick=showJqGrid1('"
  120. + rawObject.id + "')>";
  121. return "&nbsp;&nbsp;&nbsp;\t" + detail;
  122. };
  123. var queryType = "fc";
  124. var setting = {
  125. check : {
  126. enable : true,
  127. chkStyle : "radio"
  128. },
  129. view : {
  130. dblClickExpand : false
  131. },
  132. data : {
  133. simpleData : {
  134. enable : true
  135. }
  136. },
  137. callback : {
  138. beforeClick : beforeClickWindfarm,
  139. onCheck : selectWindfarm
  140. },
  141. async : {
  142. enable : true,
  143. url : "/power/windfarmAjax.action",
  144. dataType : "json"
  145. }
  146. };
  147. function beforeClickWindfarm(treeId, treeNode) {
  148. var zTree = $.fn.zTree.getZTreeObj(treeId);
  149. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  150. return false;
  151. }
  152. function showWindfarm() {
  153. var cityObj = $("#windpowerstationid");
  154. var cityOffset = $("#windpowerstationid").offset();
  155. $("#menuWindfarm").css( {
  156. left : cityOffset.left + "px",
  157. top : cityOffset.top + cityObj.outerHeight() + "px"
  158. }).slideDown("fast");
  159. $("body").bind("mousedown", onBodyDown);
  160. }
  161. function showWindturbine() {
  162. if (wpids == "") {
  163. alert("请选择风场!");
  164. return;
  165. }
  166. var setting2 = {
  167. check : {
  168. enable : true,
  169. chkStyle : "radio"
  170. },
  171. view : {
  172. dblClickExpand : false
  173. },
  174. data : {
  175. simpleData : {
  176. enable : true
  177. }
  178. },
  179. callback : {
  180. beforeClick : beforeClickWindfarm,
  181. onCheck : selectFj
  182. },
  183. async : {
  184. enable : true,
  185. url : "/power/wtAjax.action?wpIds=" + wpids,
  186. dataType : "json"
  187. }
  188. };
  189. $.fn.zTree.init($("#treeFj"), setting2);
  190. var cityObj = $("#windturbineid");
  191. var cityOffset = $("#windturbineid").offset();
  192. $("#menuFj").css( {
  193. left : cityOffset.left + "px",
  194. top : cityOffset.top + cityObj.outerHeight() + "px"
  195. }).slideDown("fast");
  196. $("body").bind("mousedown", onBodyDown);
  197. //$("#menuWindfarm").fadeOut("fas
  198. }
  199. function hideMenuWindfarm() {
  200. $("#menuWindfarm").fadeOut("fast");
  201. }
  202. var wpids = "";
  203. function selectWindfarm(e, treeId, treeNode) {
  204. var zTree = $.fn.zTree.getZTreeObj("treeWindfarm"), nodes = zTree
  205. .getCheckedNodes(true);
  206. v = "";
  207. d = "";
  208. for ( var i = 0, l = nodes.length; i < l; i++) {
  209. v += nodes[i].name + ",";
  210. d += nodes[i].id + ",";
  211. }
  212. if (v.length > 0)
  213. v = v.substring(0, v.length - 1);
  214. if (d.length > 0)
  215. d = d.substring(0, d.length - 1);
  216. wpids = d;
  217. var cityObj = $("#windpowerstationid");
  218. cityObj.attr("value", v);
  219. wtIds = '';
  220. $("#windturbineid").val("");
  221. //$("#menuWindfarm").fadeOut("fast");
  222. }
  223. var wtIds;
  224. function selectFj(e, treeId, treeNode) {
  225. var zTree = $.fn.zTree.getZTreeObj("treeFj"), nodes = zTree
  226. .getCheckedNodes(true);
  227. v = "";
  228. d = "";
  229. for ( var i = 0, l = nodes.length; i < l; i++) {
  230. v += nodes[i].name + ",";
  231. d += nodes[i].id + ",";
  232. }
  233. if (v.length > 0)
  234. v = v.substring(0, v.length - 1);
  235. if (d.length > 0)
  236. d = d.substring(0, d.length - 1);
  237. wtIds = d;
  238. var cityObj = $("#windturbineid");
  239. cityObj.attr("value", v);
  240. //$("#menuXl").fadeOut("fast");
  241. }
  242. function hideMenuFj() {
  243. $("#menuFj").fadeOut("fast");
  244. }
  245. $(document).ready(function() {
  246. $.fn.zTree.init($("#treeWindfarm"), setting);
  247. });
  248. function onBodyDown(event) {
  249. if ((event.target.id != "windpowerstationid"
  250. && event.target.id != "menuWindfarm" && $(event.target).parents(
  251. "#menuWindfarm").length <= 0)) {
  252. hideMenuWindfarm();
  253. }
  254. if (!(event.target.id == "windturbineid" || event.target.id == "menuFj" || $(
  255. event.target).parents("#menuFj").length > 0)) {
  256. hideMenuFj();
  257. }
  258. }
  259. function showJqGrid1() {
  260. var windturbineid = $("#windturbineid").val();
  261. var emid = $("#emid").val();
  262. //var begintime = $("#begintime").val();
  263. //var endtime = $("#endtime").val();
  264. var timetype = $("#timetype").val();
  265. var id = 'gridTable1';
  266. var url = "<%=request.getContextPath() %>/analysistask/analysistaskwtlist.action?windturbineid="+wtIds
  267. + "&emid="
  268. + emid
  269. + "&timetype="
  270. + timetype;
  271. //+ "&begintime="
  272. //+ begintime
  273. //+ "&endtime="
  274. //+ endtime
  275. var datatype = 'json';
  276. var colNames = [ '部件名称','评分'];
  277. var colModel = [
  278. { name: 'unitnmae', index: 'unitnmae', width: 600, align: 'left'},
  279. { name: 'factvalue', index: 'factvalue', width: 600, align: 'center'}
  280. ];
  281. var caption = '单机部件故障诊断明细';
  282. var sortname = 'unitnmae';
  283. var gridPagerID ='gridPager1';
  284. var sortorder='desc';
  285. var height='auto';
  286. var width='auto';
  287. var rownumbers=true;
  288. var multiselect=false;
  289. myJqTreeGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  290. multiselect,rownumbers);
  291. }
  292. function getDateDiv() {
  293. var timetype = $("#timetype").val()
  294. if (timetype == "ss") {
  295. $("#begindatediv").css("display", "none");
  296. $("#enddatediv").css("display", "none");
  297. } else {
  298. $("#begindatediv").css("display", "");
  299. $("#enddatediv").css("display", "");
  300. }
  301. }
  302. function queryApData() {
  303. $("#gridTable1").jqGrid('GridUnload');
  304. var windturbineid=$("#windturbineid").val();
  305. var windpowerstationid=$("#windpowerstationid").val();
  306. if(windpowerstationid=="" || wpids=="")
  307. {
  308. alert("请选择场站!");
  309. return false;
  310. }
  311. if(windturbineid=="" || wtIds=="")
  312. {
  313. alert("请选择风机!");
  314. return false;
  315. }
  316. showJqGrid1();
  317. }
  318. function saveApData() {
  319. //显示遮罩
  320. $("body").showLoading();
  321. var url="../analysistask/saveAnalysistaskwtindex.action";
  322. $.ajax({
  323. type:"post",
  324. url:url,
  325. dataType:"text",
  326. success: function(data){
  327. alert(data);
  328. //去除遮罩
  329. $("body").hideLoading();
  330. },
  331. error: function(xhr) {
  332. //显示失败信息
  333. //......
  334. //去除遮罩
  335. $("body").hideLoading();
  336. }
  337. });
  338. }
  339. function initial() {
  340. $("#windpowerstationid").val("麻黄山风电场");
  341. wpids="MHS_FDC";
  342. $("#windturbineid").val("麻黄山一号风机");
  343. wtIds="MG01_01";
  344. //showJqGrid1();
  345. }
  346. $(document).ready(function() {
  347. initial();
  348. });
  349. </script>
  350. </head>
  351. <body>
  352. <form action="" method="post" id="f1" style="width: 1620px;">
  353. <div class="panelcontainer" style="width: 1620px;">
  354. <div class="panelquery">
  355. <span class="panelquerytext">单机故障诊断</span>
  356. </div>
  357. <div class="querycondcontainer">
  358. 风场:
  359. <input id="windpowerstationid" type="text" readonly value=""
  360. style="width: 150px;" onclick="showWindfarm();" />
  361. </div>
  362. <div id="pjpanel" class="querycondcontainer">
  363. 风机:
  364. <input id="windturbineid" type="text" readonly value=""
  365. style="width: 150px;" onclick="showWindturbine();" />
  366. </div>
  367. <div id="modelpanel" class="querycondcontainer">
  368. 模型:
  369. <s:select list="emls" cssStyle="width:130px" listKey="id"
  370. listValue="name" id="emid" name="emid" ></s:select>
  371. </div>
  372. <div id="timepanel" class="querycondcontainer">
  373. 时间类型:
  374. <s:select list="#{'ss':'顺时','qs':'趋势'}" cssStyle="width:100px"
  375. id="timetype" name="timetype" ></s:select>
  376. </div>
  377. <!--
  378. <div class="querycondcontainer" id="begindatediv" style="display: none;">
  379. 开始时间:
  380. <input type="text" style="width: 150px;" class="Wdate"
  381. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,readOnly:true})"
  382. id="begintime" name="begintime" />
  383. </div>
  384. <div class="querycondcontainer" id="enddatediv" style="display: none;">
  385. 结束时间:
  386. <input type="text" style="width: 150px;" class="Wdate"
  387. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,readOnly:true})"
  388. id="endtime" name="endtime" />
  389. </div>
  390. -->
  391. <div
  392. style="float: left; line-height: 39px; margin-left: 20px; width: 200px;">
  393. <input type="button" value="查询" onClick="queryApData()" />
  394. <input type="button" value="保存记录" onClick="saveApData()" />
  395. </div>
  396. </div>
  397. <div id="menuWindfarm" class="menuContent"
  398. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  399. <ul id="treeWindfarm" class="ztree"
  400. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  401. </div>
  402. <div id="menuFj" class="menuContent"
  403. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  404. <ul id="treeFj" class="ztree"
  405. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  406. </div>
  407. <table id='gridTable1'>
  408. </table>
  409. <div id='gridPager1'></div>
  410. </form>
  411. </body>