6edbabea3db9f6ec713170f9cec158cf5fbdcdb1.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. var deptName;
  2. //数据表格
  3. var g;
  4. var myCols = [{
  5. display: '业务指导书', name: 'national', width: "20%", align: 'center'
  6. },{
  7. display: '管理办法', name: 'occupation', width: "20%", align: 'center'
  8. },{
  9. display: '管理细则', name: 'provincial', width: "20%", align: 'center'
  10. },{
  11. display: '管理实施细则', name: 'international', width: "20%", align: 'center'
  12. }];
  13. var columns = [{display : '所属单位',"name" : 'name',id : 'name',width : "10%",dept_id:'dept_id',align : 'center',render: addStatus},
  14. {display: '规章制度分类', columns: myCols, width: "80%"},
  15. {display: '合计', name: 'num', width: "10%", align: 'center'}
  16. ];
  17. var json ="";
  18. var loadData;
  19. //柱状图
  20. var option = {
  21. title : {
  22. text: '规章制度统计图',
  23. subtext: '/条'
  24. },
  25. tooltip : {
  26. trigger: 'axis'
  27. },
  28. legend: {
  29. y : 'bottom',
  30. data:['业务指导书','管理办法','管理细则','管理实施细则']
  31. },
  32. toolbox: {
  33. show : true,
  34. feature : {
  35. mark : {show: true},
  36. dataView : {show: false, readOnly: false},
  37. magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
  38. restore : {show: true},
  39. saveAsImage : {show: true}
  40. }
  41. },
  42. calculable : true,
  43. xAxis : [
  44. {
  45. type : 'category',
  46. data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
  47. }
  48. ],
  49. yAxis : [
  50. {
  51. type : 'value'
  52. }
  53. ],
  54. series : [
  55. {
  56. name:'业务指导书',
  57. type:'bar',
  58. data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]
  59. },
  60. {
  61. name:'管理办法',
  62. type:'bar',
  63. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
  64. },
  65. {
  66. name:'管理细则',
  67. type:'bar',
  68. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
  69. },
  70. {
  71. name:'管理实施细则',
  72. type:'bar',
  73. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
  74. }
  75. ]
  76. };
  77. function changeBarOption(data){
  78. var legendData=[];
  79. var seriesData=[];
  80. var data1=[];
  81. var data2=[];
  82. var data3=[];
  83. var data4=[];
  84. for(var i=0;i<data.rows.length-1;i++){
  85. //alert(data.rows[i].name);
  86. legendData[i]=data.rows[i].name;
  87. data1[i]=data.rows[i].national;
  88. data2[i]=data.rows[i].occupation;
  89. data3[i]=data.rows[i].provincial;
  90. data4[i]=data.rows[i].international;
  91. }
  92. var series1={ name:'业务指导书',
  93. type:'bar',
  94. data:data1
  95. };
  96. var series2={ name:'管理办法',
  97. type:'bar',
  98. data:data2
  99. };
  100. var series3={ name:'管理细则',
  101. type:'bar',
  102. data:data3
  103. };
  104. var series4={ name:'管理实施细则',
  105. type:'bar',
  106. data:data4
  107. };
  108. seriesData=[series1,series2,series3,series4];
  109. option.xAxis[0].data=legendData;
  110. option.series=seriesData;
  111. }
  112. function changeBarOption2(data){
  113. var legendData=[];
  114. var seriesData=[];
  115. var data1=[];
  116. var data2=[];
  117. var data3=[];
  118. var data4=[];
  119. for(var i=0;i<data.rows.length-1;i++){
  120. //alert(data.rows[i].name);
  121. legendData[i]=data.rows[i].name;
  122. data1[i]=data.rows[i].national;
  123. data2[i]=data.rows[i].occupation;
  124. data3[i]=data.rows[i].provincial;
  125. data4[i]=data.rows[i].international;
  126. }
  127. var series1={ name:'业务指导书',
  128. type:'bar',
  129. data:data1
  130. };
  131. var series2={ name:'管理办法',
  132. type:'bar',
  133. data:data2
  134. };
  135. var series3={ name:'管理细则',
  136. type:'bar',
  137. data:data3
  138. };
  139. var series4={ name:'管理实施细则',
  140. type:'bar',
  141. data:data4
  142. };
  143. //seriesData=[series1,series2,series3,series4,series5];
  144. option.legend.data=$("#CLASSES_242").attr("relText").split(",");
  145. var getInput=$("#CLASSES_242").attr("relText").split(",");
  146. var j=0;
  147. if($.inArray('业务指导书',getInput)!=-1){
  148. seriesData[j]=series1;
  149. j++;
  150. }
  151. if($.inArray('管理办法',getInput)!=-1){
  152. seriesData[j]=series2;
  153. j++;
  154. }
  155. if($.inArray('管理细则',getInput)!=-1){
  156. seriesData[j]=series3;
  157. j++;
  158. }
  159. if($.inArray('管理实施细则',getInput)!=-1){
  160. seriesData[j]=series4;
  161. j++;
  162. }
  163. option.xAxis[0].data=legendData;
  164. option.series=seriesData;
  165. }
  166. //折线图option1
  167. var option1 = {
  168. title : {
  169. text: '规章制度统计图',
  170. subtext: '/条'
  171. },
  172. tooltip : {
  173. trigger: 'axis'
  174. },
  175. legend: {
  176. y:'bottom',
  177. data:['业务指导书','管理办法','管理细则','管理实施细则']
  178. },
  179. toolbox: {
  180. show : true,
  181. feature : {
  182. mark : {show: true},
  183. dataView : {show: false, readOnly: false},
  184. magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
  185. restore : {show: true},
  186. saveAsImage : {show: true}
  187. }
  188. },
  189. calculable : true,
  190. xAxis : [
  191. {
  192. type : 'category',
  193. boundaryGap : false,
  194. data : ['总体预案','专项预案','现场处置方案','部门预案']
  195. }
  196. ],
  197. yAxis : [
  198. {
  199. type : 'value'
  200. }
  201. ],
  202. series : [
  203. {
  204. name:'业务指导书',
  205. type:'line',
  206. data:[20, 30, 50,40]
  207. },
  208. {
  209. name:'管理办法',
  210. type:'line',
  211. data:[10, 18, 19, 24]
  212. },
  213. {
  214. name:'管理细则',
  215. type:'line',
  216. data:[15, 22, 20, 15]
  217. },
  218. {
  219. name:'管理实施细则',
  220. type:'line',
  221. data:[15, 22, 20, 15]
  222. }
  223. ]
  224. };
  225. function changeLineOption(data){
  226. var legendData=[];
  227. var seriesData=[];
  228. var data1=[];
  229. var data2=[];
  230. var data3=[];
  231. var data4=[];
  232. for(var i=0;i<data.rows.length-1;i++){
  233. //alert(data.rows[i].name);
  234. legendData[i]=data.rows[i].name;
  235. data1[i]=data.rows[i].national;
  236. data2[i]=data.rows[i].occupation;
  237. data3[i]=data.rows[i].provincial;
  238. data4[i]=data.rows[i].international;
  239. }
  240. var series1={ name:'业务指导书',
  241. type:'line',
  242. data:data1
  243. };
  244. var series2={ name:'管理办法',
  245. type:'line',
  246. data:data2
  247. };
  248. var series3={ name:'管理细则',
  249. type:'line',
  250. data:data3
  251. };
  252. var series4={ name:'管理实施细则',
  253. type:'line',
  254. data:data4
  255. };
  256. seriesData=[series1,series2,series3,series4];
  257. option1.xAxis[0].data=legendData;
  258. option1.series=seriesData;
  259. }
  260. function changeLineOption2(data){
  261. var legendData=[];
  262. var seriesData=[];
  263. var data1=[];
  264. var data2=[];
  265. var data3=[];
  266. var data4=[];
  267. for(var i=0;i<data.rows.length-1;i++){
  268. //alert(data.rows[i].name);
  269. legendData[i]=data.rows[i].name;
  270. data1[i]=data.rows[i].national;
  271. data2[i]=data.rows[i].occupation;
  272. data3[i]=data.rows[i].provincial;
  273. data4[i]=data.rows[i].international;
  274. }
  275. var series1={ name:'业务指导书',
  276. type:'line',
  277. data:data1
  278. };
  279. var series2={ name:'管理办法',
  280. type:'line',
  281. data:data2
  282. };
  283. var series3={ name:'管理细则',
  284. type:'line',
  285. data:data3
  286. };
  287. var series4={ name:'管理实施细则',
  288. type:'line',
  289. data:data4
  290. };
  291. option1.legend.data=$("#CLASSES_242").attr("relText").split(",");
  292. var getInput=$("#CLASSES_242").attr("relText").split(",");
  293. var j=0;
  294. if($.inArray('业务指导书',getInput)!=-1){
  295. seriesData[j]=series1;
  296. j++;
  297. }
  298. if($.inArray('管理办法',getInput)!=-1){
  299. seriesData[j]=series2;
  300. j++;
  301. }
  302. if($.inArray('管理细则',getInput)!=-1){
  303. seriesData[j]=series3;
  304. j++;
  305. }
  306. if($.inArray('管理实施细则',getInput)!=-1){
  307. seriesData[j]=series4;
  308. j++;
  309. }
  310. //seriesData=[series1,series2,series3,series4,series5];
  311. option1.xAxis[0].data=legendData;
  312. option1.series=seriesData;
  313. }
  314. //饼图option2
  315. var option2 = {
  316. title : {
  317. text: '规章制度统计图',
  318. subtext: '/条'
  319. },
  320. tooltip : {
  321. trigger: 'item',
  322. formatter: "{a} <br/>{b} : {c} ({d}%)"
  323. },
  324. legend: {
  325. y : 'bottom',
  326. data:['业务指导书','管理办法','管理细则','管理实施细则']
  327. },
  328. toolbox: {
  329. show : true,
  330. feature : {
  331. mark : {show: true},
  332. dataView : {show: false, readOnly: false},
  333. magicType : {
  334. show: false,
  335. type: ['pie', 'funnel'],
  336. option: {
  337. funnel: {
  338. x: '25%',
  339. width: '50%',
  340. funnelAlign: 'left',
  341. max: 1548
  342. }
  343. }
  344. },
  345. restore : {show: true},
  346. saveAsImage : {show: true}
  347. }
  348. },
  349. calculable : true,
  350. series : [
  351. {
  352. name:'规章制度',
  353. type:'pie',
  354. radius : '55%',
  355. center: ['50%', '55%'],
  356. data:[
  357. {value:335, name:'业务指导书'},
  358. {value:310, name:'管理办法'},
  359. {value:234, name:'管理细则'},
  360. {value:234, name:'管理实施细则'}
  361. ]
  362. }
  363. ]
  364. };
  365. function changePieOption3(data){
  366. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  367. option2.legend.data=$("#CLASSES_242").attr("relText").split(",");
  368. var getInput=$("#CLASSES_242").attr("relText").split(",");
  369. var index=data.rows.length-1;
  370. var seriesJson=[];
  371. var j=0;
  372. if($.inArray('业务指导书',getInput)!=-1){
  373. var json={value:data.rows[index]["national"],name:'业务指导书'};
  374. seriesJson[j]=json;
  375. j++;
  376. }
  377. if($.inArray('管理办法',getInput)!=-1){
  378. var json={value:data.rows[index]["occupation"],name:'管理办法'};
  379. seriesJson[j]=json;
  380. j++;
  381. }
  382. if($.inArray('管理细则',getInput)!=-1){
  383. var json={value:data.rows[index]["provincial"],name:'管理细则'};
  384. seriesJson[j]=json;
  385. j++;
  386. }
  387. if($.inArray('管理实施细则',getInput)!=-1){
  388. var json={value:data.rows[index]["international"],name:'管理实施细则'};
  389. seriesJson[j]=json;
  390. j++;
  391. }
  392. option2.series[0].data=seriesJson;
  393. }
  394. function changePieOption2(data){
  395. /*************************************************** 初始化解析饼图数据 start**********************************************************/
  396. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  397. var index=data.rows.length-1;
  398. var seriesJson=[];
  399. var j=0;
  400. if(data.rows[index]["national"]!=undefined){
  401. var json={value:data.rows[index]["national"],name:'业务指导书'};
  402. seriesJson[j]=json;
  403. j++;
  404. }
  405. if(data.rows[index]["occupation"]!=undefined){
  406. var json={value:data.rows[index]["occupation"],name:'管理办法'};
  407. seriesJson[j]=json;
  408. j++;
  409. }
  410. if(data.rows[index]["provincial"]!=undefined){
  411. var json={value:data.rows[index]["provincial"],name:'管理细则'};
  412. seriesJson[j]=json;
  413. j++;
  414. }
  415. if(data.rows[index]["international"]!=undefined){
  416. var json={value:data.rows[index]["international"],name:'管理实施细则'};
  417. seriesJson[j]=json;
  418. j++;
  419. }
  420. option2.series[0].data=seriesJson;
  421. /*************************************************** 初始化解析饼图数据 end **********************************************************/
  422. }
  423. //初始化方法
  424. $(function(){
  425. deptName = (window.location.href).split('?')[1];
  426. $.post($.pathname()+ "/ws/bylawPOLL/BylawService/getBylaw",{id : deptName},function (data){
  427. json = data;
  428. //给表格数据赋值
  429. loadData= data;
  430. //初始化表格
  431. initCompletes(json);
  432. changeBarOption(data);
  433. changeLineOption(data);
  434. changePieOption2(data);
  435. var myChart1 = echarts.init(document.getElementById('main1'));
  436. myChart1.setOption(option);
  437. $(".basicTab").bind('actived',function(e,i){
  438. if(i==0){
  439. /***************************************** 加载柱状图 *********************************************************/
  440. var myChart1 = echarts.init(document.getElementById('main1'));
  441. myChart1.setOption(option);
  442. // initmyGraphic(data);
  443. }else if(i == 1){
  444. /***************************************** 加载折线图 *********************************************************/
  445. var myChart5 = echarts.init(document.getElementById('main2'));
  446. myChart5.setOption(option1);
  447. }else if(i==2){
  448. /***************************************** 加载饼图 *********************************************************/
  449. var myChart2 = echarts.init(document.getElementById('main3'));
  450. myChart2.setOption(option2);
  451. }
  452. });
  453. },"json" );
  454. });
  455. function initCompletes(json){
  456. g = $("#maingrid").quiGrid({
  457. columns: columns,
  458. data:json,
  459. rownumbers : true,
  460. usePager : false
  461. });
  462. //重设高度
  463. $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  464. $(top.document.body).find("iframe").height($(window.document.body).height()+30);
  465. /*重新绑定父页面事件方法*/
  466. //绑定点击时样式变化事件
  467. $(parent.document.body).find(".leftnav").live("click",parent.checkedCurrent);
  468. //定期报送组点击事件
  469. $(parent.document.body).find(".baosong").live("click",parent.changebaosong);
  470. //定期维护组点击事件
  471. $(parent.document.body).find(".weihu").live("click",parent.changeweihu);
  472. $(parent.document.body).find(".weihu1").live("click",parent.changeweihu1);
  473. /*重新绑定父页面事件方法*/
  474. }
  475. function addStatus(rowdata, rowindex, value, column){
  476. if("总计"==rowdata.name || deptName==rowdata.dept_id){
  477. return value;
  478. }else{
  479. var comp_id='"'+rowdata.dept_id+'"';
  480. var name = '"'+value+'"';
  481. return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
  482. }
  483. }
  484. function newHtml(comp_id,name){
  485. if(name=="总计"){
  486. return;
  487. }else if(deptName==comp_id){
  488. return;
  489. }else{
  490. // window.open("/nwyj/page/business/am/fileManager/standard/standard_poll1.jsp?"+comp_id);
  491. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/bylaw/bylaw_poll1.jsp?"+comp_id);
  492. }
  493. }