0c941977b229b925705a18f5bb3ba36cb7b6c2d5.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. <script type="text/javascript" src="/nwyj/scripts/highcharts/highcharts.js"></script>
  24. <script type="text/javascript" src="/nwyj/page/cockpit/chart_pie.js"></script>
  25. <link rel="stylesheet" type="text/css" href="/nwyj/page/cockpit/chartPage.css">
  26. <script type="text/javascript" src="/nwyj/page/cockpit/laydate/laydate.js"></script>
  27. <script type="text/javascript" src="/nwyj/page/cockpit/webgis/util.js"></script>
  28. <!-- 数字步进器start -->
  29. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/form/stepper.js"></script>
  30. <!-- 数字步进器end -->
  31. </head>
  32. <body>
  33. <div id="title" style="background-color:#144E52; width:100%; height:35px; line-height:35px; color:#ffc000; text-align:center; font-weight:bold; font-size:26px; "></div>
  34. <div id="container"></div>
  35. <div id="choose_content">
  36. <h2>单位:</h2>
  37. <div id="compTree" class="selectTree _left_margin" selWidth="280" asyncMode="true" multiMode="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. <div class="_endTime">
  44. <h2>查询时间:</h2>
  45. <!-- <input id="dataTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"> -->
  46. <input id="dataTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
  47. </div>
  48. <h2 >间隔时间(/s(秒)):</h2>
  49. <input id="interval" class="_left_margin" type="text" val="5">
  50. <!-- <input id="interval" class="_left_margin" type="text" val="5"> -->
  51. <!-- <div class="_startTime _hide">
  52. <h2>起始时间(YYYY-MM-DD HH:mm:ss):</h2>
  53. <input id="startTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
  54. </div> -->
  55. <h2 class="_center">
  56. <span class="_query_command">查询</span>
  57. <span class="_query_command">刷新</span>
  58. </h2>
  59. </div>
  60. <script type="text/javascript">
  61. /******************************************************查询条件***********************************************************/
  62. // dept_id//user_id//user_name//dept_name
  63. var interval=null;//定时器
  64. var dataFrom="peo";//数据源的状态
  65. var n=5;//初始化默认刷新时间
  66. var list=intervalList
  67. var urlParams=resolveUrl();
  68. HTitle["fixed"]=urlParams["dept_name"];
  69. HTitle["change"]=urlParams["dept_name"];
  70. var text=HTitle[tState]+personChart;
  71. var childId="'"+urlParams["dept_id"]+"'";
  72. var bindChildId=childId.split(",");
  73. var parentId=urlParams["dept_id"];
  74. var dateTime=getNowDateTime();
  75. var chart;
  76. var categorie=[urlParams["dept_name"]];
  77. var categories= [];
  78. var series= [
  79. {name: '', size: '60%',type: 'pie',data:[],
  80. dataLabels: {formatter: function () { return this.y > 5 ? this.point.name : null; },distance: -20}
  81. },
  82. {name: '', size: '100%', innerSize: '60%',type: 'pie',data:[],
  83. dataLabels: {formatter: function () { return this.y > 5 ? this.point.name+":"+this.point.y : null; }
  84. }
  85. }
  86. ];
  87. var deptUrl=deptTreePath;
  88. var zNodes2 ={"treeNodes":[
  89. { id:11, parentId:1, name:"用户数(户)" ,column:"YH"},
  90. { id:12, parentId:1, name:"特级重要用户(户)",column:"TJYH"} ,
  91. { id:13, parentId:1, name:"一级重要用户(户)",column:"YJYH"},
  92. { id:13, parentId:1, name:"二级重要用户(户)",column:"EJYH"}
  93. ]};
  94. function init(){
  95. loadSelect($("#selectList"),list);
  96. // 添加额外属性主要用于最初的初始节点
  97. $("#compTree").attr('params', '{"deptId":"'+urlParams["dept_id"]+'"}');
  98. // 异步加载请求地址
  99. $("#compTree").attr('url', deptUrl);
  100. $.post(deptUrl, {"id" : urlParams["dept_id"]}, function(data) {$("#compTree").data("data", data);$("#compTree").render();}, "json");
  101. //$("#levelTree").data("data",zNodes2);
  102. // $("#levelTree").render();
  103. $("._query_command").on("click",query);
  104. $("._rend_command").on("click",function(){
  105. rendChart(getNowDateTime());
  106. });
  107. $("._rend_command").on("click",function(){
  108. getInterval();
  109. removeRendChart();
  110. outoRendChart();
  111. getDepartment();
  112. text=privence+"应急人员投入统计图";
  113. rendChart(getNowDateTime());
  114. });
  115. /* $("#from").on("click",function(){
  116. changeDataSource();
  117. }); */
  118. }
  119. //切换数据源
  120. /* function changeDataSource(){
  121. dataFrom=$("#from input[name='from']:checked").val();
  122. if(dataFrom=="sys"){
  123. $("._startTime").removeClass("_hide");
  124. $("._endTime").find("h2").eq(0).text("截止时间(YYYY-MM-DD HH:mm:ss):");
  125. }else{
  126. $("._startTime").addClass("_hide");
  127. $("._endTime").find("h2").eq(0).text("时间(YYYY-MM-DD HH:mm:ss):");
  128. }
  129. } */
  130. function query(){
  131. removeRendChart();
  132. /* categories=[];
  133. series= [
  134. {name: "",color: '#FF3300', size: '60%',type: 'pie',data:[],
  135. dataLabels: {formatter: function () { return this.y > 5 ? this.point.name : null; },color: 'white',distance: -20}
  136. },
  137. {name: "",color: '#FF3300', size: '100%', innerSize: '60%',type: 'pie',data:[] },
  138. ]; */
  139. //获取部门
  140. getDepartment();
  141. //获取时间
  142. getTime();
  143. loadChart(parentId,childId,dateTime);
  144. console.log(JSON.stringify({categories:categories}));
  145. console.log(JSON.stringify({categories:categories}));
  146. console.log("categorie_________:"+JSON.stringify({categorie:categorie}));
  147. console.log("childId_________:"+childId);
  148. }
  149. //获取间隔时间
  150. function getInterval(){
  151. if($("#selectList").data("selectedNode")==""||$("#selectList").data("selectedNode")==undefined)return;
  152. n=$("#selectList").data("selectedNode").value;
  153. }
  154. //获取时间
  155. function getTime(){
  156. //********************************************************************************************************====校验日期格式
  157. dateTime=$("#dataTime").val()==""?getNowDateTime():$("#dataTime").val();
  158. }
  159. //获取部门相关信息
  160. function getDepartment(){
  161. if($("#compTree").data("selectedNodes").length>0){
  162. HTitle["change"]="";
  163. categorie=[];
  164. childId="";
  165. bindChildId=[];
  166. $.each($("#compTree").data("selectedNodes"),function(index,item){
  167. HTitle["change"]+=',"'+item.name+'"';
  168. categorie.push(item.name)
  169. childId+="'"+item.id+"',"
  170. parentId=item.parentId;
  171. });
  172. childId=childId.substring(0,childId.lastIndexOf(","));
  173. bindChildId=childId.split(",");
  174. HTitle["change"]=HTitle["change"].substring(1,HTitle["change"].length);
  175. text=HTitle[tState]+personChart;
  176. }
  177. return false;
  178. }
  179. function getInitParams(){
  180. if(loadState["emergencyPersonChart"]==0){
  181. loadChart(parentId,childId,dateTime);
  182. }else{
  183. $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getParentsInfo",{comId:urlParams["dept_id"],count:loadState["emergencyPersonChart"]},function(result){
  184. categorie=[];
  185. childId="'"+result.rows.childId.join("','")+"'";
  186. bindChildId=childId.split(",");
  187. categorie=result.rows.childName;
  188. HTitle["change"]='"'+categorie.join('","')+'"';
  189. text=HTitle[tState]+personChart;
  190. parentId=urlParams["dept_id"];
  191. loadChart(parentId,childId,dateTime);
  192. outoRendChart();
  193. },"json");
  194. }
  195. }
  196. //初始化
  197. $(function(){
  198. init();
  199. getInitParams();
  200. });
  201. //接触自动刷新
  202. function removeRendChart(){
  203. clearInterval(interval)
  204. }
  205. //自动自动刷星表
  206. function outoRendChart(){
  207. interval=setInterval(function(){
  208. rendChart(dateTime);
  209. },n*1000);
  210. }
  211. function rendChart(datetime){
  212. categories=[];
  213. /* series= [
  214. {name: '', size: '60%',type: 'pie',data:[],
  215. dataLabels: {formatter: function () { return this.y > 5 ? this.point.name : null; },color: 'white',distance: -20}
  216. },
  217. {name: '', size: '100%', innerSize: '60%',type: 'pie',data:[] },
  218. ]; */
  219. loadChart(parentId,childId,datetime);
  220. }
  221. /*****************************************************************************************************************/
  222. function loadChart(compId,childId,date){
  223. series= [
  224. {name: '', size: '60%',type: 'pie',data:[],
  225. dataLabels: {formatter: function () { return this.y > 0 ? this.point.name : null; },color:"white",distance: -50}
  226. },
  227. {name: '', size: '100%', innerSize: '60%',type: 'pie',data:[],
  228. dataLabels: {formatter: function () { return this.y > 0 ? this.point.name+":"+this.point.y : null; },color:"white",distance: -20}}
  229. ];
  230. $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getChartInfo",{comId:compId,childId:childId,typeId:"8",date:date},function(result){
  231. console.log("result====="+JSON.stringify(result));
  232. console.log("resultthleng====="+result.length);
  233. for(var index=0,len=result.length;index<len;index++){
  234. ///nwyj/WebContent/page/cockpit/emergency_action/emergency_personnel_investment_grid.html
  235. series[0].data.push({data:{url:path+"page/cockpit/emergency_action/emergency_personnel_investment_grid.html",
  236. comId:compId,
  237. childId:bindChildId[index],
  238. typeId:"8",
  239. deptName:categorie[index],
  240. date:date},
  241. name:categorie[index],
  242. color:color[0][index],
  243. y:changeQ(result[index]["PERSON_BD"])+parseInt(result[index]["PERSON_KQ"])
  244. });
  245. series[1].data.push({data:{url:path+"page/cockpit/emergency_action/emergency_personnel_investment_grid.html",
  246. comId:compId,
  247. childId:bindChildId[index],
  248. typeId:"8",
  249. deptName:categorie[index],
  250. date:date},
  251. name:categorie[index]+"本地抢修人员",
  252. color:restorColor[colorStyle],
  253. y:changeQ(result[index]["PERSON_BD"])});
  254. series[1].data.push({
  255. data:{url:path+"page/cockpit/emergency_action/emergency_personnel_investment_grid.html",
  256. comId:compId,
  257. childId:bindChildId[index],
  258. typeId:"8",
  259. deptName:categorie[index],
  260. date:date},
  261. name:categorie[index]+"跨区抢修人员",
  262. color:recoveColor[colorStyle],
  263. y:changeQ(result[index]["PERSON_KQ"])});
  264. }
  265. console.log("categories===="+JSON.stringify({categories:categories}))
  266. console.log("series===="+JSON.stringify({series:series}))
  267. var options={
  268. "title.text":text,
  269. "xAxis.categories":categorie,
  270. "yAxis.title.text":"单位(/个)",
  271. "subtitle.text":"数据:系统运行部<br/>时间:"+getNowTime(),
  272. series:series
  273. }
  274. $("#container").createChart(options,null);
  275. },"json");
  276. $("#title").html(text) ;
  277. }
  278. </script>
  279. </body>
  280. </html>