analysistaskpjindex.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  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"></script>
  38. <link rel="stylesheet"
  39. href="<%=request.getContextPath()%>/resource/js/showloading/showLoading.css"
  40. type="text/css"/>
  41. <script
  42. src="<%=request.getContextPath()%>/resource/js/showloading/jquery.showLoading.js"
  43. type="text/javascript"></script>
  44. <style type="text/css">
  45. .normal {
  46. border-right-style: solid;
  47. border-bottom-style: solid;
  48. border-left-style: solid;
  49. border-top-style: solid;
  50. border-top-color: #ffffff;
  51. border-left-color: #f1f1f1;
  52. border-right-color: #f1f1f1;
  53. border-bottom-color: #f1f1f1;
  54. border-width: 1px;
  55. width: 100px;
  56. height: 28px;
  57. float: left;
  58. margin-top: -1px;
  59. cursor: pointer;
  60. text-align: center;
  61. line-height: 28px;
  62. overflow: hidden;
  63. font-weight: bold;
  64. font-size: 12px;
  65. font-family: tahoma, arial, verdana, sans-serif;
  66. }
  67. .disable {
  68. border-right-style: solid;
  69. border-bottom-style: solid;
  70. border-left-style: solid;
  71. border-top-style: solid;
  72. border-top-color: #f1f1f1;
  73. border-left-color: #f1f1f1;
  74. border-right-color: #f1f1f1;
  75. border-bottom-color: #f1f1f1;
  76. border-width: 1px;
  77. width: 100px;
  78. height: 25px;
  79. float: left;
  80. margin-top: -1px;
  81. cursor: pointer;
  82. text-align: center;
  83. background-color: #e1e1e1;
  84. line-height: 25px;
  85. overflow: hidden;
  86. font-weight: bold;
  87. font-size: 12px;
  88. font-family: tahoma, arial, verdana, sans-serif;
  89. }
  90. .panelcontainer {
  91. width: 100%;
  92. height: 70px;
  93. border-style: solid;
  94. border-color: #f1f1f1;
  95. border-width: 1px;
  96. }
  97. .panelquery {
  98. width: 100%;
  99. height: 25px;
  100. background-color: #f1f1f1;
  101. line-height: 25px;
  102. }
  103. .panelquerytext {
  104. margin-left: 3px;
  105. font-weight: bold;
  106. font-size: 12px;
  107. font-family: tahoma, arial, verdana, sans-serif;
  108. }
  109. .querycondcontainer {
  110. line-height: 39px;
  111. padding: 3px;
  112. float: left;
  113. font-size: 12px;
  114. }
  115. </style>
  116. <script type="text/javascript">
  117. function displaybuttons(cellvalue, options, rawObject) {
  118. var detail = "<input type='button' value='详情' onclick=showJqGrid1('"
  119. + rawObject.id + "')>";
  120. return "&nbsp;&nbsp;&nbsp;\t" + detail;
  121. };
  122. var queryType = "fc";
  123. var setting = {
  124. check : {
  125. enable : true,
  126. chkStyle : "radio"
  127. },
  128. view : {
  129. dblClickExpand : false
  130. },
  131. data : {
  132. simpleData : {
  133. enable : true
  134. }
  135. },
  136. callback : {
  137. beforeClick : beforeClickWindfarm,
  138. onCheck : selectWindfarm
  139. },
  140. async : {
  141. enable : true,
  142. url : "/power/windfarmAjax.action",
  143. dataType : "json"
  144. }
  145. };
  146. function beforeClickWindfarm(treeId, treeNode) {
  147. var zTree = $.fn.zTree.getZTreeObj(treeId);
  148. zTree.checkNode(treeNode, !treeNode.checked, null, true);
  149. return false;
  150. }
  151. function showWindfarm() {
  152. var cityObj = $("#windpowerstationid");
  153. var cityOffset = $("#windpowerstationid").offset();
  154. $("#menuWindfarm").css( {
  155. left : cityOffset.left + "px",
  156. top : cityOffset.top + cityObj.outerHeight() + "px"
  157. }).slideDown("fast");
  158. $("body").bind("mousedown", onBodyDown);
  159. }
  160. function showWindturbine() {
  161. if (wpids == "") {
  162. alert("请选择风场!");
  163. return;
  164. }
  165. var setting2 = {
  166. check : {
  167. enable : true,
  168. chkStyle : "radio"
  169. },
  170. view : {
  171. dblClickExpand : false
  172. },
  173. data : {
  174. simpleData : {
  175. enable : true
  176. }
  177. },
  178. callback : {
  179. beforeClick : beforeClickWindfarm,
  180. onCheck : selectFj
  181. },
  182. async : {
  183. enable : true,
  184. url : "/power/fjAjax.action?wpIds=" + wpids,
  185. dataType : "json"
  186. }
  187. };
  188. $.fn.zTree.init($("#treeFj"), setting2);
  189. var cityObj = $("#windturbine");
  190. var cityOffset = $("#windturbine").offset();
  191. $("#menuFj").css( {
  192. left : cityOffset.left + "px",
  193. top : cityOffset.top + cityObj.outerHeight() + "px"
  194. }).slideDown("fast");
  195. $("body").bind("mousedown", onBodyDown);
  196. //$("#menuWindfarm").fadeOut("fas
  197. }
  198. function showProject() {
  199. if (wpids == "") {
  200. alert("请选择风场!");
  201. return;
  202. }
  203. var setting3 = {
  204. check : {
  205. enable : true,
  206. chkStyle : "checkbox"
  207. },
  208. view : {
  209. dblClickExpand : false
  210. },
  211. data : {
  212. simpleData : {
  213. enable : true
  214. }
  215. },
  216. callback : {
  217. beforeClick : beforeClickWindfarm,
  218. onCheck : selectPj
  219. },
  220. async : {
  221. enable : true,
  222. url : "/power/projectAjax.action?wpIds=" + wpids,
  223. dataType : "json"
  224. }
  225. };
  226. $.fn.zTree.init($("#treePj"), setting3);
  227. var cityObj = $("#project");
  228. var cityOffset = $("#project").offset();
  229. $("#menuPj").css( {
  230. left : cityOffset.left + "px",
  231. top : cityOffset.top + cityObj.outerHeight() + "px"
  232. }).slideDown("fast");
  233. $("body").bind("mousedown", onBodyDown);
  234. pjIds = '';
  235. $("#project").val("");
  236. }
  237. function hideMenuWindfarm() {
  238. $("#menuWindfarm").fadeOut("fast");
  239. }
  240. var wpids = "";
  241. function selectWindfarm(e, treeId, treeNode) {
  242. var zTree = $.fn.zTree.getZTreeObj("treeWindfarm"), nodes = zTree
  243. .getCheckedNodes(true);
  244. v = "";
  245. d = "";
  246. for ( var i = 0, l = nodes.length; i < l; i++) {
  247. v += nodes[i].name + ",";
  248. d += nodes[i].id + ",";
  249. }
  250. if (v.length > 0)
  251. v = v.substring(0, v.length - 1);
  252. if (d.length > 0)
  253. d = d.substring(0, d.length - 1);
  254. wpids = d;
  255. var cityObj = $("#windpowerstationid");
  256. cityObj.attr("value", v);
  257. lineIds = '';
  258. pjIds = '';
  259. $("#project").val("");
  260. $("#line").val("");
  261. //$("#menuWindfarm").fadeOut("fast");
  262. }
  263. var pjIds;
  264. function selectPj(e, treeId, treeNode) {
  265. var zTree = $.fn.zTree.getZTreeObj("treePj"), nodes = zTree
  266. .getCheckedNodes(true);
  267. v = "";
  268. d = "";
  269. for ( var i = 0, l = nodes.length; i < l; i++) {
  270. v += nodes[i].name + ",";
  271. d += nodes[i].id + ",";
  272. }
  273. if (v.length > 0)
  274. v = v.substring(0, v.length - 1);
  275. if (d.length > 0)
  276. d = d.substring(0, d.length - 1);
  277. pjIds = d;
  278. var cityObj = $("#project");
  279. cityObj.attr("value", v);
  280. //$("#menuXl").fadeOut("fast");
  281. }
  282. function hideMenuPj() {
  283. $("#menuPj").fadeOut("fast");
  284. }
  285. $(document).ready(function() {
  286. $.fn.zTree.init($("#treeWindfarm"), setting);
  287. });
  288. function onBodyDown(event) {
  289. if ((event.target.id != "windpowerstationid"
  290. && event.target.id != "menuWindfarm" && $(event.target).parents(
  291. "#menuWindfarm").length <= 0)) {
  292. hideMenuWindfarm();
  293. }
  294. if (!(event.target.id == "project" || event.target.id == "menuPj" || $(
  295. event.target).parents("#menuPj").length > 0)) {
  296. hideMenuPj();
  297. }
  298. }
  299. function showJqGrid() {
  300. var windpowerstationid = $("#windpowerstationid").val();
  301. var project = $("#project").val();
  302. var emid = $("#emid").val();
  303. var timetype = $("#timetype").val();
  304. // var begintime = $("#begintime").val();
  305. // var endtime = $("#endtime").val();
  306. var id = 'gridTable';
  307. var url = "<%=request.getContextPath()%>/analysistask/analysistaskpjlist.action?windpowerstationid="
  308. + wpids
  309. + "&projectid="
  310. + pjIds
  311. + "&emid="
  312. + emid
  313. + "&timetype="
  314. + timetype ;
  315. // + "&begintime=" + begintime+ "&endtime=" + endtime
  316. var datatype = 'json';
  317. var colNames = [ '风机', '型号', '评分', '操作' ];
  318. var colModel = [
  319. {
  320. name : 'windturbineid',
  321. index : 'windturbineid',
  322. width : 300,
  323. align : 'center'
  324. }, {
  325. name : 'modelid',
  326. index : 'modelid',
  327. width : 300,
  328. align : 'center'
  329. }, {
  330. name : 'score',
  331. index : 'score',
  332. width : 300,
  333. align : 'center'
  334. }, {
  335. name : 'score',
  336. index : 'score',
  337. width : 300,
  338. align : 'center',
  339. formatter : displaybuttons
  340. } ];
  341. var caption = '单机故障诊断信息';
  342. var sortname = 'score';
  343. var gridPagerID = 'gridPager';
  344. var sortorder = 'desc';
  345. var height = 'auto';
  346. var width = 'auto';
  347. var rownumbers = true;
  348. var multiselect = false;
  349. myJqGrid(id, url, datatype, colNames, colModel, caption, sortname,
  350. gridPagerID, sortorder, height, width, multiselect, rownumbers);
  351. }
  352. function showJqGrid1(acid) {
  353. $("#task").css("display", "none");
  354. $("#taskdetail").css("display", "");
  355. $("#backbutton").css("display", "");
  356. var id = 'gridTable1';
  357. var url = "<%=request.getContextPath() %>/analysistask/analysistaskDetailpjlist.action?acid="+acid;
  358. var datatype = 'json';
  359. var colNames = [ '部件名称','评分'];
  360. var colModel = [
  361. { name: 'unitnmae', index: 'unitnmae', width: 600, align: 'left'},
  362. { name: 'factvalue', index: 'factvalue', width: 600, align: 'center'}
  363. ];
  364. var caption = '单机部件诊断明细';
  365. var sortname = 'unitnmae';
  366. var gridPagerID ='gridPager1';
  367. var sortorder='desc';
  368. var height='auto';
  369. var width='auto';
  370. var rownumbers=true;
  371. var multiselect=false;
  372. myJqTreeGrid(id, url, datatype, colNames, colModel, caption, sortname, gridPagerID,sortorder,height,width,
  373. multiselect,rownumbers);
  374. }
  375. function getDateDiv() {
  376. var timetype = $("#timetype").val()
  377. if (timetype == "ss") {
  378. $("#begindatediv").css("display", "none");
  379. $("#enddatediv").css("display", "none");
  380. } else {
  381. $("#begindatediv").css("display", "");
  382. $("#enddatediv").css("display", "");
  383. }
  384. }
  385. function goTask() {
  386. $("#task").css("display", "");
  387. $("#taskdetail").css("display", "none");
  388. $("#backbutton").css("display", "none");
  389. }
  390. function queryApData() {
  391. $("#gridTable").jqGrid('GridUnload');
  392. $("#gridTable1").jqGrid('GridUnload');
  393. $("#task").css("display", "");
  394. $("#taskdetail").css("display", "none");
  395. var project=$("#project").val();
  396. var windpowerstationid=$("#windpowerstationid").val();
  397. if(windpowerstationid=="" || wpids=="")
  398. {
  399. alert("请选择场站!");
  400. return false;
  401. }
  402. if(project=="" || pjIds=="")
  403. {
  404. alert("请选择工程!");
  405. return false;
  406. }
  407. showJqGrid();
  408. }
  409. function saveApData() {
  410. //显示遮罩
  411. //$("#onloadgif").css("display","");
  412. $("body").showLoading();
  413. var url="../analysistask/saveAnalysistaskpjindex.action";
  414. $.ajax({
  415. type:"post",
  416. url:url,
  417. dataType:"text",
  418. success: function(data){
  419. //alert(data);
  420. // $("#onloadgif").css("display","none");
  421. //去除遮罩
  422. $("body").hideLoading();
  423. },
  424. error: function(xhr) {
  425. //显示失败信息
  426. //......
  427. //去除遮罩
  428. $("body").hideLoading();
  429. }
  430. });
  431. }
  432. function initial() {
  433. $("#windpowerstationid").val("麻黄山风电场");
  434. wpids="MHS_FDC";
  435. $("#project").val("麻黄山一期工程");
  436. pjIds="MHS01_GC";
  437. //showJqGrid();
  438. }
  439. $(document).ready(function() {
  440. initial();
  441. });
  442. </script>
  443. </head>
  444. <body>
  445. <form action="" method="post" id="f1" style="width: 1620px;">
  446. <div class="panelcontainer" style="width: 1620px;">
  447. <div class="panelquery">
  448. <span class="panelquerytext">批量诊断</span>
  449. </div>
  450. <div class="querycondcontainer">
  451. 风场:
  452. <input id="windpowerstationid" type="text" readonly value=""
  453. style="width: 150px;" onclick="showWindfarm();" />
  454. </div>
  455. <div id="pjpanel" class="querycondcontainer">
  456. 项目:
  457. <input id="project" type="text" readonly value=""
  458. style="width: 150px;" onclick="showProject();" />
  459. </div>
  460. <div id="modelpanel" class="querycondcontainer">
  461. 模型:
  462. <s:select list="emls" cssStyle="width:130px" listKey="id"
  463. listValue="name" id="emid" name="emid"></s:select>
  464. </div>
  465. <div id="timepanel" class="querycondcontainer">
  466. 时间类型:
  467. <s:select list="#{'ss':'顺时','qs':'趋势'}" cssStyle="width:100px"
  468. id="timetype" name="timetype" ></s:select>
  469. </div>
  470. <!--
  471. <div class="querycondcontainer" id="begindatediv" style="display: none;">
  472. 开始时间:
  473. <input type="text" style="width: 150px;" class="Wdate"
  474. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,readOnly:true})"
  475. id="begintime" name="begintime" />
  476. </div>
  477. <div class="querycondcontainer" id="enddatediv" style="display: none;">
  478. 结束时间:
  479. <input type="text" style="width: 150px;" class="Wdate"
  480. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,readOnly:true})"
  481. id="endtime" name="endtime" />
  482. </div>
  483. -->
  484. <div
  485. style="float: left; line-height: 39px; margin-left: 20px; width: 200px;">
  486. <input type="button" value="查询" onClick="queryApData()" />
  487. <input type="button" value="保存记录" onClick="saveApData()" class="add_test_img"/>
  488. <input id="backbutton" type="button" value="返回上级" onClick="goTask()" style="display: none;"/>
  489. </div>
  490. </div>
  491. <div id="menuWindfarm" class="menuContent"
  492. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  493. <ul id="treeWindfarm" class="ztree"
  494. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  495. </div>
  496. <div id="menuPj" class="menuContent"
  497. style="overflow-y: scroll; overflow-x: auto; z-index: 9999; border: 1px solid #617775; background: #f0f6e4; display: none; position: absolute;">
  498. <ul id="treePj" class="ztree"
  499. style="margin-top: 0; width: 180px; height: 300px;"></ul>
  500. </div>
  501. <div id="task">
  502. <table id='gridTable'>
  503. </table>
  504. <div id='gridPager'></div>
  505. </div>
  506. <div id="taskdetail" style="display: none">
  507. <table id='gridTable1'>
  508. </table>
  509. </div>
  510. <div id='gridPager1'></div>
  511. </form>
  512. </body>