d428474cdf05cc5a9b4e3da0bed098bdbcf0a32d.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>日常应急预案修订</title>
  5. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <script type="text/javascript" src="/nwyj/page/cockpit/context.js"></script>
  8. <!--框架必需start-->
  9. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  10. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
  11. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/main.js"></script>
  12. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
  13. <link href="/nwyj/scripts/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  14. <link rel="stylesheet" type="text/css" id="skin" prePath="/nwyj/scripts/qui/" scrollerY="false"/>
  15. <link rel="stylesheet" type="text/css" id="customSkin"/>
  16. <!--框架必需end-->
  17. <!--树组件start-->
  18. <link rel="stylesheet" type="text/css" href="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.css" />
  19. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.js"></script>
  20. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/form/selectTree.js"></script>
  21. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/form/listerTree.js"></script>
  22. <!--树组件end-->
  23. <link rel="stylesheet" type="text/css" href="/nwyj/page/cockpit/chartPage.css">
  24. <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/echarts-all.js"></script>
  25. <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/chart/bar.js"></script>
  26. <script type="text/javascript" src=" /nwyj/page/cockpit/cockpit_echart.js"></script>
  27. <script type="text/javascript" src="/nwyj/page/cockpit/laydate/laydate.js"></script>
  28. <script type="text/javascript" src="/nwyj/page/cockpit/webgis/util.js"></script>
  29. <link rel="stylesheet" type="text/css" href="/nwyj/css/cockpit/charTitle.css">
  30. </head>
  31. <body>
  32. <div id="container" class="jsc_chartitle"></div>
  33. <div id="choose_content">
  34. <h2>单位:</h2>
  35. <div id="compTree" class="selectTree _left_margin" selWidth="280" asyncMode="true" multiMode="true"></div></br>
  36. <h2>电压等级:</h2>
  37. <div class="selectTree _left_margin" id="levelTree" selWidth="280" multiMode="true" keepDefaultStyle="true"></div></br>
  38. <h2>数据源:</h2>
  39. <div id="from">
  40. <input type="radio" class="_left_margin" name="from" value="sys">系统数据源
  41. <input type="radio" class="_left_margin" name="from" value="peo" checked="checked">人工数据源
  42. </div>
  43. <h2>间隔时间:</h2>
  44. <select id="selectList" value=""></select><br/>
  45. <div class="_startTime _hide">
  46. <h2>起始时间:</h2>
  47. <input id="startTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
  48. </div>
  49. <div class="_endTime">
  50. <h2>时间:</h2>
  51. <input id="dataTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
  52. </div>
  53. <h2 class="_center"><span class="_query_command">查询</span><span class="_rend_command">刷新</span></h2>
  54. </div>
  55. <script type="text/javascript">
  56. /******************************************************查询条件***********************************************************/
  57. //图表用参数
  58. // dept_id//user_id//user_name//dept_name
  59. var customMadeTool=["search","render","list","enlarge","resource"];//父页面显示的工具栏
  60. var interval=null;//定时器
  61. var dataFrom="peo";//数据源的状态
  62. var n=xn;//初始化默认刷新时间
  63. var list=intervalList
  64. var urlParams=resolveUrl();
  65. HTitle["fixed"]=urlParams["dept_name"];
  66. HTitle["change"]=urlParams["dept_name"];
  67. var text=HTitle[tState]+planReviseChart;
  68. var childId="'"+urlParams["dept_id"]+"'";
  69. var bindChildId=childId.split(",");//绑定点击事件查询id
  70. var parentId=urlParams["parentId"];
  71. var dateTime=getNowDateTime();
  72. var chart;
  73. var categorie=[{name:urlParams["dept_name"],column:urlParams["dept_name"]}];
  74. //默认查询全信息
  75. var level=planLevel;
  76. //查询条件配置参数
  77. var deptUrl=deptTreePath;
  78. var zNodes2 ={"treeNodes":planLevel};
  79. function init(){
  80. //添加预案种类列表
  81. loadSelect($("#selectList"),list);
  82. // 添加额外属性主要用于最初的初始节点
  83. $("#compTree").attr('params', '{"deptId":"'+urlParams["dept_id"]+'"}');
  84. // 异步加载请求地址
  85. $("#compTree").attr('url', deptUrl);
  86. $.post(deptUrl, {"id" : urlParams["dept_id"]}, function(data) {$("#compTree").data("data", data);$("#compTree").render();}, "json");
  87. $("#levelTree").data("data",zNodes2);
  88. $("#levelTree").render();
  89. //绑定查询历史事件
  90. $("._query_command").on("click",query);
  91. //绑定时时刷新事件
  92. $("._rend_command").on("click",rend);
  93. }
  94. //切换查询条件
  95. function query(){
  96. //alert("query start...");
  97. //移除定时器
  98. interval=removeRendChart(interval);
  99. //获取部门
  100. getDepartment();
  101. //获取预案类型
  102. level=getLevel($("#levelTree"),level);
  103. //校验数据
  104. alert("parentId="+parentId+";categorie="+JSON.stringify({categorie:categorie})+",childId="+childId+"level="+JSON.stringify({categorie:categorie}));
  105. rendChart();
  106. }
  107. function rend(){
  108. alert("rend start...");
  109. //移除定时器
  110. interval=removeRendChart(interval);
  111. //获取刷新间隔时间
  112. n=getInterval($("#selectList"),n);
  113. //获取部门
  114. getDepartment();
  115. //获取预案类型
  116. level=getLevel($("#levelTree"),level);
  117. //检查数据
  118. alert("parentId="+parentId+";categorie="+JSON.stringify({categorie:categorie})+",childId="+childId+"level="+JSON.stringify({categorie:categorie}));
  119. //获取电压等级信息
  120. rendChart();
  121. //加载表格
  122. interval=outoRendChart(interval,n,rendChart);
  123. }
  124. //获取部门相关信息
  125. function getDepartment(){
  126. if($("#compTree").data("selectedNodes").length>0){
  127. HTitle["change"]="";
  128. categorie=[];
  129. childId="";
  130. bindChildId=[];
  131. $.each($("#compTree").data("selectedNodes"),function(index,item){
  132. HTitle["change"]+=',"'+item.name+'"';
  133. categorie.push({name:item.name,column:item.id})
  134. childId+="'"+item.id+"',"
  135. });
  136. childId=childId.substring(0,childId.lastIndexOf(","));
  137. bindChildId=childId.split(",");
  138. HTitle["change"]=HTitle["change"].substring(1,HTitle["change"].length);
  139. text=HTitle[tState]+planReviseChart;
  140. }
  141. return false;
  142. }
  143. function getInitParams(){
  144. if(loadState["planChart"]==0){
  145. rendChart();
  146. interval=outoRendChart(interval,n,rendChart);
  147. }else{
  148. $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getParentsInfo",{comId:urlParams["dept_id"],count:loadState["planChart"]},function(result){
  149. categorie=[];
  150. for(var item in result.rows.childId){
  151. categorie.push({name:result.rows.childName[item],column:result.rows.childId[item]})
  152. }
  153. HTitle["change"]="";
  154. bindChildId=result.rows.childId;
  155. HTitle["change"]='"'+categorie.join('","')+'"';
  156. text=HTitle[tState]+planReviseChart;
  157. //alert("parentId="+parentId+";childId="+childId+";dateTime="+dateTime);
  158. rendChart();
  159. interval=outoRendChart(interval,n,rendChart);
  160. // outoRendChart();
  161. },"json");
  162. }
  163. }
  164. function appendJSONColumnToStr(params,column,cStr){
  165. var temp=[];
  166. for(var index in params){
  167. temp.push(params[index][column]);
  168. }
  169. return temp.join(cStr);
  170. }
  171. //初始化
  172. $(function(){
  173. init();
  174. getInitParams();
  175. });
  176. function rendChart(){
  177. loadChart(appendJSONColumnToStr(categorie,"column","-"),appendJSONColumnToStr(level,"column","-"));
  178. }
  179. /*****************************************************************************************************************/
  180. function loadChart(compId,typeId){
  181. var leArr=[];
  182. var xArr=[];
  183. var sArr=[];
  184. $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getEmergencyPlans",{comId:compId,typeId:typeId},function(result){
  185. console.log("result======"+JSON.stringify(result));
  186. console.log("result_length====="+result.length);
  187. for(var index in level){
  188. var temp={name:level[index]["name"],
  189. type:'bar',
  190. data:[]
  191. };
  192. leArr.push(temp.name);
  193. for(var item in categorie){
  194. //x轴坐标
  195. if(index==0){
  196. xArr.push(categorie[item].name);
  197. }
  198. //获取主数据
  199. //alert(JSON.stringify(result));
  200. ///nwyj/WebContent/page/cockpit/emergency_daily/contingency_plans_revised_grid.html
  201. //alert("===1");
  202. //alert("==="+bindChildId[item/bindChildId.length]+":"+categorie[item].name);
  203. //alert("==="+bindChildId[item/bindChildId.length]+":"+categorie[item].name);
  204. temp.data.push({ data:{url:path+"page/cockpit/emergency_daily/contingency_plans_revised_grid.html",comId:categorie[item].column,state:"NO_RECOVER_",
  205. childId:bindChildId[item/bindChildId.length],
  206. typeId:typeId,
  207. level:level,
  208. deptName:categorie[item].name},
  209. value:changeQ(result.rows[categorie[item].column][index]["AMOUNT"])});
  210. }
  211. sArr.push(temp);
  212. }
  213. /* for(var index=0,len=result.length;index<len;index++){
  214. series[0].data.push({data:{url:path+"page/cockpit/line_trip/line_trip_grid.html",comId:compId,state:"NO_RECOVER_",
  215. childId:bindChildId[index/bindChildId.length],typeId:"1",date:date,level:level,deptName:categorie[index]},
  216. y:changeQ(result[index]["AMOUNT"])});
  217. }
  218. console.log("categories===="+JSON.stringify({categories:categories}))
  219. console.log("series===="+JSON.stringify({series:series}))
  220. */
  221. var opParams={
  222. title:"",//标题
  223. unit:"单位:台",//单位
  224. leArr:leArr,//图例
  225. xArr:xArr,//x轴
  226. sArr:sArr//主数据
  227. };
  228. //console.log("==="+JSON.stringify(opParams))
  229. chart=getEchart($("#container"),getOption,opParams,chart);
  230. chart.on("click",function(params){
  231. alert("===");
  232. var str =encodeURI("params="+JSON.stringify(params.data.data));
  233. alert("==="+JSON.stringify(params.data.data));
  234. alert(params.data.data.url+"?"+str);
  235. location.href =params.data.data.url+"?"+str;
  236. });
  237. $(window).resize(function(){
  238. chart.resize();
  239. });
  240. },"json");
  241. $("#title").html(text) ;
  242. }
  243. /**********************************************************************************/
  244. </script>
  245. </body>
  246. </html>