32bff41681e483a28f6f0dc173641e480052c139.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. //数据表格
  3. var g;
  4. var myCols = [{
  5. display: '国家', name: 'netclass', width: "15%", align: 'center'
  6. },{
  7. display: '地方政府', name: 'provincial', width: "15%", align: 'center'
  8. },{
  9. display: '南网系统单位', name: 'municipal', width: "15%", align: 'center'
  10. },{
  11. display: '分子公司', name: 'subcorps', width: "15%", align: 'center'
  12. },{
  13. display: '地市局', name: 'dishiju', width: "15%", align: 'center'
  14. },{
  15. display: '行政规章', name: 'administrative', width: "15%", align: 'center'
  16. }];
  17. var columns = [{display : '所属单位',"name" : 'name',id : 'name',width : "10%",dept_id:'dept_id',align : 'center',render: addStatus},
  18. {display: '文件分类', columns: myCols, width: "80%"},
  19. {display: '合计', name: 'num', width: "10%", align: 'center'}
  20. ];
  21. var json ="";
  22. var loadData;
  23. //柱状图
  24. var option = {
  25. title : {
  26. text: '保供电制度文件统计图',
  27. subtext: '/个'
  28. },
  29. tooltip : {
  30. trigger: 'axis'
  31. },
  32. legend: {
  33. y : 'bottom',
  34. data:['国家','地方政府','南网系统单位','分子公司','地市局','行政规章']
  35. },
  36. toolbox: {
  37. show : true,
  38. feature : {
  39. mark : {show: true},
  40. dataView : {show: false, readOnly: false},
  41. magicType : {show: false, type: ['line', 'bar']},
  42. restore : {show: true},
  43. saveAsImage : {show: true}
  44. }
  45. },
  46. calculable : true,
  47. xAxis : [
  48. {
  49. type : 'category',
  50. data : []
  51. }
  52. ],
  53. yAxis : [
  54. {
  55. type : 'value'
  56. }
  57. ],
  58. series : [
  59. {
  60. name:'国家',
  61. type:'bar',
  62. data:[]
  63. },
  64. {
  65. name:'地方政府',
  66. type:'bar',
  67. data:[]
  68. },
  69. {
  70. name:'南网系统单位',
  71. type:'bar',
  72. data:[]
  73. },
  74. {
  75. name:'分子公司',
  76. type:'bar',
  77. data:[]
  78. },
  79. {
  80. name:'地市局',
  81. type:'bar',
  82. data:[]
  83. },
  84. {
  85. name:'行政规章',
  86. type:'bar',
  87. data:[]
  88. }
  89. ]
  90. };
  91. /**
  92. * 切换为柱状图
  93. * 更换柱状图数据
  94. * @param data
  95. */
  96. function changeBarOption(data){
  97. var legendData=[];
  98. var seriesData=[];
  99. var data1=[];
  100. var data2=[];
  101. var data3=[];
  102. var data4=[];
  103. var data5=[];
  104. var data6=[];
  105. for(var i=0;i<data.rows.length-1;i++){
  106. legendData[i]=data.rows[i].name;
  107. data1[i]=data.rows[i].netclass;
  108. data2[i]=data.rows[i].provincial;
  109. data3[i]=data.rows[i].municipal;
  110. data4[i]=data.rows[i].subcorps;
  111. data5[i]=data.rows[i].dishiju;
  112. data6[i]=data.rows[i].administrative;
  113. }
  114. var series1={ name:'国家',
  115. type:'bar',
  116. data:data1
  117. };
  118. var series2={ name:'地方政府',
  119. type:'bar',
  120. data:data2
  121. };
  122. var series3={ name:'南网系统单位',
  123. type:'bar',
  124. data:data3
  125. };
  126. var series4={ name:'分子公司',
  127. type:'bar',
  128. data:data4
  129. };
  130. var series5={ name:'地市局',
  131. type:'bar',
  132. data:data5
  133. };
  134. var series6={ name:'行政规章',
  135. type:'bar',
  136. data:data6
  137. };
  138. seriesData=[series1,series2,series3,series4,series5,series6];
  139. option.xAxis[0].data=legendData;
  140. option.series=seriesData;
  141. }
  142. //折线图option1
  143. var option1 = {
  144. title : {
  145. text: '保供电制度文件统计图',
  146. subtext: '/个'
  147. },
  148. tooltip : {
  149. trigger: 'axis'
  150. },
  151. legend: {
  152. y:'bottom',
  153. data:['国家','地方政府','南网系统单位','分子公司','地市局','行政规章']
  154. },
  155. toolbox: {
  156. show : true,
  157. feature : {
  158. mark : {show: true},
  159. dataView : {show: false, readOnly: false},
  160. magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
  161. restore : {show: true},
  162. saveAsImage : {show: true}
  163. }
  164. },
  165. calculable : true,
  166. xAxis : [
  167. {
  168. type : 'category',
  169. boundaryGap : false,
  170. data : ['总体预案','专项预案','现场处置方案','部门预案']
  171. }
  172. ],
  173. yAxis : [
  174. {
  175. type : 'value'
  176. }
  177. ],
  178. series : [
  179. {
  180. name:'国家',
  181. type:'line',
  182. data:[]
  183. },
  184. {
  185. name:'地方政府',
  186. type:'line',
  187. data:[]
  188. },
  189. {
  190. name:'南网系统单位',
  191. type:'line',
  192. data:[]
  193. },
  194. {
  195. name:'分子公司',
  196. type:'line',
  197. data:[]
  198. },
  199. {
  200. name:'地市局',
  201. type:'line',
  202. data:[]
  203. },
  204. {
  205. name:'行政规章',
  206. type:'line',
  207. data:[]
  208. }
  209. ]
  210. };
  211. /**
  212. * 切换线图的数据
  213. * @param data
  214. */
  215. function changeLineOption(data){
  216. var legendData=[];
  217. var seriesData=[];
  218. var data1=[];
  219. var data2=[];
  220. var data3=[];
  221. var data4=[];
  222. var data5=[];
  223. var data6=[];
  224. for(var i=0;i<data.rows.length-1;i++){
  225. legendData[i]=data.rows[i].name;
  226. data1[i]=data.rows[i].netclass;
  227. data2[i]=data.rows[i].provincial;
  228. data3[i]=data.rows[i].municipal;
  229. data4[i]=data.rows[i].subcorps;
  230. data5[i]=data.rows[i].dishiju;
  231. data6[i]=data.rows[i].administrative;
  232. }
  233. var series1={ name:'国家',
  234. type:'line',
  235. data:data1
  236. };
  237. var series2={ name:'地方政府',
  238. type:'line',
  239. data:data2
  240. };
  241. var series3={ name:'南网系统单位',
  242. type:'line',
  243. data:data3
  244. };
  245. var series4={ name:'分子公司',
  246. type:'line',
  247. data:data4
  248. };
  249. var series5={ name:'地市局',
  250. type:'line',
  251. data:data5
  252. };
  253. var series6={ name:'行政规章',
  254. type:'line',
  255. data:data6
  256. };
  257. seriesData=[series1,series2,series3,series4,series5,series6];
  258. option1.xAxis[0].data=legendData;
  259. option1.series=seriesData;
  260. }
  261. //饼图option2
  262. var option2 = {
  263. title : {
  264. text: '保供电制度文件统计图',
  265. subtext: '/条'
  266. },
  267. tooltip : {
  268. trigger: 'item',
  269. formatter: "{a} <br/>{b} : {c} ({d}%)"
  270. },
  271. legend: {
  272. y : 'bottom',
  273. data:['国家','地方政府','南网系统单位','分子公司','地市局','行政规章']
  274. },
  275. toolbox: {
  276. show : true,
  277. feature : {
  278. mark : {show: true},
  279. dataView : {show: false, readOnly: false},
  280. magicType : {
  281. show: false,
  282. type: ['pie', 'funnel'],
  283. option: {
  284. funnel: {
  285. x: '25%',
  286. width: '50%',
  287. funnelAlign: 'left',
  288. max: 1548
  289. }
  290. }
  291. },
  292. restore : {show: true},
  293. saveAsImage : {show: true}
  294. }
  295. },
  296. calculable : true,
  297. series : [
  298. {
  299. name:'文件分类',
  300. type:'pie',
  301. radius : '55%',
  302. center: ['50%', '55%'],
  303. data:[
  304. {value:335, name:'国家'},
  305. {value:310, name:'地方政府'},
  306. {value:234, name:'南网系统单位'},
  307. {value:135, name:'分子公司'},
  308. {value:234, name:'地市局'},
  309. {value:135, name:'行政规章'}
  310. ]
  311. }
  312. ]
  313. };
  314. function changePieOption2(data){
  315. /*************************************************** 初始化解析饼图数据 start**********************************************************/
  316. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  317. var index=data.rows.length-1;
  318. var seriesJson=[];
  319. var j=0;
  320. if(data.rows[index]["netclass"]!=undefined){
  321. var json={value:data.rows[index]["netclass"],name:'国家'};
  322. seriesJson[j]=json;
  323. j++;
  324. }
  325. if(data.rows[index]["provincial"]!=undefined){
  326. var json={value:data.rows[index]["provincial"],name:'地方政府'};
  327. seriesJson[j]=json;
  328. j++;
  329. }
  330. if(data.rows[index]["municipal"]!=undefined){
  331. var json={value:data.rows[index]["municipal"],name:'南网系统单位'};
  332. seriesJson[j]=json;
  333. j++;
  334. }
  335. if(data.rows[index]["administrative"]!=undefined){
  336. var json={value:data.rows[index]["administrative"],name:'行政规章'};
  337. seriesJson[j]=json;
  338. j++;
  339. }
  340. if(data.rows[index]["subcorps"]!=undefined){
  341. var json={value:data.rows[index]["subcorps"],name:'分子公司'};
  342. seriesJson[j]=json;
  343. j++;
  344. }
  345. if(data.rows[index]["dishiju"]!=undefined){
  346. var json={value:data.rows[index]["dishiju"],name:'地市局'};
  347. seriesJson[j]=json;
  348. j++;
  349. }
  350. option2.series[0].data=seriesJson;
  351. /*************************************************** 初始化解析饼图数据 end **********************************************************/
  352. }
  353. //初始化方法
  354. $(function(){
  355. $.post($.pathname() + "/ws/FILEPOLL/FileAMService/getFileEMInfo",{id : deptName},function (data){
  356. json = data;
  357. //给表格数据赋值
  358. loadData= data;
  359. //初始化表格
  360. initCompletes(json);
  361. /**
  362. * 切换数据块 start
  363. */
  364. changeBarOption(data);
  365. changeLineOption(data);
  366. changePieOption2(data);
  367. var myChart1 = echarts.init(document.getElementById('main1'));
  368. myChart1.setOption(option);
  369. /**
  370. * 切换数据源 end
  371. */
  372. $(".basicTab").bind('actived',function(e,i){
  373. if(i==0){
  374. /***************************************** 加载柱状图 *********************************************************/
  375. var myChart1 = echarts.init(document.getElementById('main1'));
  376. myChart1.setOption(option);
  377. // initmyGraphic(data);
  378. }else if(i == 1){
  379. /***************************************** 加载折线图 *********************************************************/
  380. var myChart5 = echarts.init(document.getElementById('main2'));
  381. myChart5.setOption(option1);
  382. }else if(i==2){
  383. /***************************************** 加载饼图 *********************************************************/
  384. var myChart2 = echarts.init(document.getElementById('main3'));
  385. myChart2.setOption(option2);
  386. }
  387. });
  388. /***************************************** 加载图表 End *********************************************************/
  389. },"json" );
  390. });
  391. //发送请求,从后台获取数据
  392. function getNewValue(){
  393. //发文日期
  394. var pushStartTime = $('#beginTime1').val();
  395. var pushEndTime = $('#endTime1').val();
  396. //文件分类
  397. var chunengType = $('#FILE_CLASSIFY_231').attr("relValue");
  398. //取所属单位
  399. var units = $('#PUBLISH_COMP_ID_231').val();
  400. //分类
  401. var temp1 = chunengType.split(",");
  402. var tempChunengType = "";
  403. for(var i=0; i<temp1.length; i++){
  404. tempChunengType+=temp1[i] + ",";
  405. }
  406. //分类转换
  407. var temp2 = tempChunengType.split(",");
  408. var valueType1 = "";
  409. for(var i=0; i<temp2.length; i++){
  410. if(temp2[i]=="netclass"){
  411. valueType1+= "'" + "1" +"'" +",";
  412. }
  413. if(temp2[i]=="provincial"){
  414. valueType1+= "'" + "2" +"'" +",";
  415. }
  416. if(temp2[i]=="municipal"){
  417. valueType1+= "'" + "3" +"'" +",";
  418. }
  419. if(temp2[i]=="subcorps"){
  420. valueType1+= "'" + "4" +"'" +",";
  421. }
  422. if(temp2[i]=="dishiju"){
  423. valueType1+= "'" + "5" +"'" +",";
  424. }
  425. if(temp2[i]=="administrative"){
  426. valueType1+= "'" + "6" +"'" +",";
  427. }
  428. }
  429. var valueType = null;
  430. if(chunengType.length>0){
  431. valueType = valueType1.substring(0,valueType1.length-1);
  432. }
  433. //单位整理
  434. var leng = units.length;
  435. var deptId = null;
  436. if(leng>0){
  437. var deptIdsTemp = units.split(",");
  438. var arrFF = "";
  439. for(var i=0; i<deptIdsTemp.length; i++){
  440. arrFF+="'"+deptIdsTemp[i]+"'"+",";
  441. }
  442. deptId = arrFF.substring(0,arrFF.length-1);
  443. }
  444. /*alert("发布时间:"+pushStartTime+"~"+pushEndTime);
  445. alert("实施时间:"+pushStartTime1+"~"+pushEndTime1);
  446. alert("状态:" + tempLevel);
  447. alert("分类:" + valueType);
  448. alert("单位:"+deptId);*/
  449. $.post($.pathname() + "/ws/FILEPOLL/FileAMService/getFileEMInfo",
  450. {id : deptName,StartTime:pushStartTime,EndTime:pushEndTime,valueType:valueType,deptId:deptId},
  451. function (data){
  452. json = data;
  453. //给表格数据赋值
  454. loadData= data;
  455. //初始化表格
  456. initCompletes(json);
  457. changeBarOption(data);
  458. changeLineOption(data);
  459. changePieOption2(data);
  460. var myChart1 = echarts.init(document.getElementById('main1'));
  461. myChart1.setOption(option);
  462. $(".basicTab").bind('actived',function(e,i){
  463. if(i==0){
  464. /***************************************** 加载柱状图 *********************************************************/
  465. var myChart1 = echarts.init(document.getElementById('main1'));
  466. myChart1.setOption(option);
  467. // initmyGraphic(data);
  468. }else if(i == 1){
  469. /***************************************** 加载折线图 *********************************************************/
  470. var myChart5 = echarts.init(document.getElementById('main2'));
  471. myChart5.setOption(option1);
  472. }else if(i==2){
  473. /***************************************** 加载饼图 *********************************************************/
  474. var myChart2 = echarts.init(document.getElementById('main3'));
  475. myChart2.setOption(option2);
  476. }
  477. });
  478. $(".basicTab").render();
  479. },"json" );
  480. }
  481. //点击统计按钮触发的事件
  482. function getCount(){
  483. getNewValue();
  484. //文件分类
  485. var chunengType = $('#FILE_CLASSIFY_231').attr("relValue");
  486. //取所属单位
  487. var units = $('#PUBLISH_COMP_ID_231').val();
  488. var column = chunengType + "," + units;
  489. /*var temp = column.split(",");
  490. var column1 = "";
  491. for(var i=0; i<temp.length; i++){
  492. column1+=temp[i]+ ",";
  493. }
  494. */
  495. if(chunengType==""){
  496. chunengType =",";
  497. }
  498. //所属单位
  499. var url=$.pathname()+ "/ws/Amyjyan/AmyjyanCount/getEditColumns";
  500. $.ajax({
  501. url : url,
  502. type : 'post',
  503. timeout : 15000,
  504. async : false,
  505. data : {
  506. name : "ECM_AM_PPS_FILE_MANAGEMANET",column:chunengType
  507. },
  508. dataType : 'json',
  509. success : function(data) {
  510. columns=data;
  511. //给表格数据赋值
  512. loadData= data;
  513. //初始化表格
  514. initCompletes(json);
  515. },
  516. error : function(e) {
  517. $.messager.alert('查询表头失败!', '访问服务失败!', 'error');
  518. }
  519. });
  520. }
  521. function initCompletes(json){
  522. g = $("#maingrid").quiGrid({
  523. columns: columns,
  524. data:json,
  525. rownumbers : true,
  526. usePager : false,
  527. onAfterShowData:function(){
  528. setHight();
  529. /* top.setHight();*/
  530. }
  531. });
  532. /* //重设高度
  533. $(parent.document.body).find("iframe").height(480);
  534. $(top.document.body).find("#frmright").height(480);*/
  535. /*重新绑定父页面事件方法*/
  536. //绑定点击时样式变化事件
  537. $(parent.document.body).find(".leftnav").live("click",parent.checkedCurrent);
  538. //定期报送组点击事件
  539. $(parent.document.body).find(".baosong").live("click",parent.changebaosong);
  540. //定期维护组点击事件
  541. $(parent.document.body).find(".weihu").live("click",parent.changeweihu);
  542. $(parent.document.body).find(".weihu1").live("click",parent.changeweihu1);
  543. /*重新绑定父页面事件方法*/
  544. }
  545. /***********************************公共操作********************************************/
  546. function addStatus(rowdata, rowindex, value, column){
  547. var comp_id='"'+rowdata.dept_id+'"';
  548. var name = '"'+value+'"';
  549. return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
  550. }
  551. function newHtml(comp_id,name){
  552. if(name=="总计"){
  553. return;
  554. }else if(deptName==comp_id){
  555. return;
  556. }else{
  557. window.open("/nwyj/page/business/am/PPSFile/FileEM-poll1.jsp?"+comp_id);
  558. // window.location.href = "/nwyj/page/business/am/resource/expert/expert-poll.jsp?"+comp_id;
  559. // alert(comp_id);
  560. }
  561. }
  562. //返回
  563. function goBack() {
  564. window.location.href="FileList_EM.jsp";
  565. }
  566. //打印
  567. function print(){
  568. //alert(1111);
  569. $("#maingrid").jqprint();
  570. }
  571. //重置
  572. function export_report(){
  573. document.location.reload();
  574. }
  575. $.messager=top.Dialog;