48cdcccde14037bce8b1aa09337a38c0d8332d3e.svn-base 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  1. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. // 数据表格
  3. var g;
  4. var gridData;
  5. var myCols1 = [{
  6. display : 'N≤250',
  7. "name" : 'content_min',
  8. width : 100,render:showMsg
  9. }, {
  10. display : '250<N≤500',
  11. "name" : 'content_mid',
  12. width : 100,render:showMsg
  13. }, {
  14. display : 'N>500',
  15. "name" : 'content_max',
  16. width : 100,render:showMsg
  17. }];
  18. var myCols2 = [{
  19. display : '380V',
  20. "name" : 'level_max',
  21. width : 100,render:showMsg
  22. }, {
  23. display : '10kV',
  24. "name" : 'level_min',
  25. width : 100,render:showMsg
  26. }];
  27. var myCols3 = [{
  28. display : '发电机',
  29. "name" : 'generator',
  30. width : 100,render:showMsg
  31. }, {
  32. display : 'UPS',
  33. "name" : 'ups',
  34. width : 100,render:showMsg
  35. }, {
  36. display : '磁飞轮',
  37. "name" : 'fly_circle',
  38. width : 100,render:showMsg
  39. }];
  40. var myCols4 = [{
  41. display : '可调拨',
  42. "name" : 'kused',
  43. width : 100,render:showMsg
  44. }, {
  45. display : '不可调拨',
  46. "name" : 'bused',
  47. width : 100,render:showMsg
  48. }];
  49. // 柱状图
  50. var option = {
  51. title : {
  52. text: '发电车'
  53. ,subtext: '/辆'
  54. },
  55. tooltip : {
  56. trigger: 'axis',
  57. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  58. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  59. },
  60. formatter: function (params){
  61. return params[0].name + '<br/>'
  62. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  63. + params[1].seriesName + ' : ' + params[1].value + '<br/>'
  64. + params[2].seriesName + ' : ' + params[2].value;
  65. }
  66. },
  67. legend: {
  68. y:'bottom',
  69. //selectedMode:false,
  70. data:['N≤250', '250<N≤500','N>500']
  71. },
  72. toolbox: {
  73. show : true,
  74. feature : {
  75. mark : {show: true},
  76. dataView : {show: false, readOnly: false},
  77. restore : {show: true},
  78. saveAsImage : {show: true}
  79. }
  80. },
  81. calculable : true,
  82. xAxis : [
  83. {
  84. type : 'category',
  85. data : ['广东电网公司','清远供电局','韶关供电局','中山供电局','东莞供电局','佛山供电局']
  86. }
  87. ],
  88. yAxis : [
  89. {
  90. type : 'value',
  91. boundaryGap: [0, 0.1]
  92. }
  93. ],
  94. series : [
  95. {
  96. name:'N≤250',
  97. type:'bar',
  98. stack: 'sum',
  99. barCategoryGap: '50%',
  100. itemStyle: {
  101. normal: {
  102. color: 'tomato',
  103. barBorderColor: 'tomato',
  104. barBorderWidth:0.2,
  105. barBorderRadius:0,
  106. label : {
  107. show: true, position: 'insideTop'
  108. }
  109. }
  110. },
  111. data:[100, 200, 220, 120, 100, 80]
  112. },{
  113. name:'250<N≤500',
  114. type:'bar',
  115. stack: 'sum',
  116. barCategoryGap: '50%',
  117. itemStyle: {
  118. normal: {
  119. color: 'yellow',
  120. barBorderColor: 'tomato',
  121. barBorderWidth:0.2,
  122. barBorderRadius:0,
  123. label : {
  124. show: true, position: 'insideTop',
  125. formatter: function (params) {
  126. for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
  127. if (option.xAxis[0].data[i] == params.name) {
  128. return option.series[0].data[i] + params.value;
  129. }
  130. }
  131. }
  132. }
  133. }
  134. },
  135. data:[200, 200, 220, 120, 100, 80]
  136. },
  137. {
  138. name:'N>500',
  139. type:'bar',
  140. stack: 'sum',
  141. itemStyle: {
  142. normal: {
  143. color: 'blue',
  144. barBorderColor: 'tomato',
  145. barBorderWidth:0.2,
  146. barBorderRadius:0,
  147. label : {
  148. show: true,
  149. position: 'top',
  150. formatter: function (params) {
  151. for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
  152. if (option.xAxis[0].data[i] == params.name) {
  153. return option.series[0].data[i] + option.series[1].data[i] + params.value;
  154. }
  155. }
  156. },
  157. textStyle: {
  158. color: 'tomato'
  159. }
  160. }
  161. }
  162. },
  163. data:[300, 80, 50, 80,80, 70]
  164. }
  165. ]
  166. };
  167. var series1={
  168. name:'N≤250',
  169. type:'bar',
  170. stack: 'sum',
  171. barCategoryGap: '50%',
  172. itemStyle: {
  173. normal: {
  174. color: 'tomato',
  175. barBorderColor: 'tomato',
  176. barBorderWidth:0.2,
  177. barBorderRadius:0,
  178. label : {
  179. show: true, position: 'insideTop'
  180. }
  181. }
  182. },
  183. data:[100, 200, 220, 120, 100, 80]
  184. };
  185. var series2={
  186. name:'250<N≤500',
  187. type:'bar',
  188. stack: 'sum',
  189. barCategoryGap: '50%',
  190. itemStyle: {
  191. normal: {
  192. color: 'yellow',
  193. barBorderColor: 'tomato',
  194. barBorderWidth:0.2,
  195. barBorderRadius:0,
  196. label : {
  197. show: true, position: 'insideTop',
  198. formatter: function (params) {
  199. for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
  200. if (option.xAxis[0].data[i] == params.name) {
  201. return parseInt(option.series[0].data[i]) + parseInt(params.value);
  202. }
  203. }
  204. }
  205. }
  206. }
  207. },
  208. data:[200, 200, 220, 120, 100, 80]
  209. };
  210. var series3={
  211. name:'N>500',
  212. type:'bar',
  213. stack: 'sum',
  214. itemStyle: {
  215. normal: {
  216. color: 'blue',
  217. barBorderColor: 'tomato',
  218. barBorderWidth:0.2,
  219. barBorderRadius:0,
  220. label : {
  221. show: true,
  222. position: 'top',
  223. formatter: function (params) {
  224. for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
  225. if (option.xAxis[0].data[i] == params.name) {
  226. return parseInt(option.series[0].data[i]) + parseInt(option.series[1].data[i]) + parseInt(params.value);
  227. }
  228. }
  229. },
  230. textStyle: {
  231. color: 'tomato'
  232. }
  233. }
  234. }
  235. },
  236. data:[300, 80, 50, 80,80, 70]
  237. };
  238. var series4={
  239. name:'N>500',
  240. type:'bar',
  241. stack: 'sum',
  242. itemStyle: {
  243. normal: {
  244. color: 'blue',
  245. barBorderColor: 'tomato',
  246. barBorderWidth:0.2,
  247. barBorderRadius:0,
  248. label : {
  249. show: true,
  250. position: 'top',
  251. formatter: function (params) {
  252. for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
  253. if (option.xAxis[0].data[i] == params.name) {
  254. return parseInt(option.series[0].data[i]) + parseInt(params.value);
  255. }
  256. }
  257. },
  258. textStyle: {
  259. color: 'tomato'
  260. }
  261. }
  262. }
  263. },
  264. data:[300, 80, 50, 80,80, 70]
  265. };
  266. //折线图option6
  267. var option6 = {
  268. title : {
  269. text: '发电车'
  270. ,subtext: '/辆'
  271. },
  272. tooltip : {
  273. trigger: 'axis'
  274. },
  275. legend: {
  276. y:'bottom',
  277. data:['发电车数量']
  278. },
  279. toolbox: {
  280. show : true,
  281. feature : {
  282. mark : {show: true},
  283. dataView : {show: false, readOnly: false},
  284. magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
  285. restore : {show: true},
  286. saveAsImage : {show: true}
  287. }
  288. },
  289. calculable : true,
  290. xAxis : [
  291. {
  292. type : 'category',
  293. boundaryGap : false,
  294. data : ['总体预案','专项预案','现场处置方案','部门预案']
  295. }
  296. ],
  297. yAxis : [
  298. {
  299. type : 'value'
  300. }
  301. ],
  302. series : [
  303. {
  304. name:'发电车数量',
  305. type:'line',
  306. data:[20, 30, 50,40]
  307. }
  308. ]
  309. };
  310. //饼图option2
  311. var option7 = {
  312. title : {
  313. text: '发电车'
  314. ,subtext: '/辆'
  315. },
  316. tooltip : {
  317. trigger: 'item',
  318. formatter: "{a} <br/>{b} : {c} ({d}%)"
  319. },
  320. legend: {
  321. y : 'bottom',
  322. data:['总体预案','专项预案','现场处置方案','部门预案']
  323. },
  324. toolbox: {
  325. show : true,
  326. feature : {
  327. mark : {show: true},
  328. dataView : {show: false, readOnly: false},
  329. magicType : {
  330. show: false,
  331. type: ['pie', 'funnel'],
  332. option: {
  333. funnel: {
  334. x: '25%',
  335. width: '50%',
  336. funnelAlign: 'left',
  337. max: 1548
  338. }
  339. }
  340. },
  341. restore : {show: true},
  342. saveAsImage : {show: true}
  343. }
  344. },
  345. calculable : true,
  346. series : [
  347. {
  348. name:'发电车数量',
  349. type:'pie',
  350. radius : '55%',
  351. center: ['50%', '55%'],
  352. data:[
  353. {value:335, name:'总体预案'},
  354. {value:310, name:'专项预案'},
  355. {value:234, name:'现场处置方案'},
  356. {value:135, name:'部门预案'}
  357. ]
  358. }
  359. ]
  360. };
  361. //柱状图
  362. function changeBarOption1(data){
  363. series1.name='N≤250';
  364. series2.name='250<N≤500';
  365. series3.name='N>500';
  366. var legendData=[];
  367. var data1=[];
  368. var data2=[];
  369. var data3=[];
  370. for(var i=0;i<data.rows.length-1;i++){
  371. legendData[i]=data.rows[i].name;
  372. data1[i]=data.rows[i].content_min;
  373. data2[i]=data.rows[i].content_mid;
  374. data3[i]=data.rows[i].content_max;
  375. }
  376. series1.data=data1;
  377. series2.data=data2;
  378. series3.data=data3;
  379. option.series[0]=series1;
  380. option.series[1]=series2;
  381. option.series[2]=series3;
  382. option.xAxis[0].data=legendData;
  383. option.legend.data=['N≤250', '250<N≤500','N>500'];
  384. option.tooltip.formatter=function (params){
  385. return params[0].name + '<br/>'
  386. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  387. + params[1].seriesName + ' : ' + params[1].value + '<br/>'
  388. + params[2].seriesName + ' : ' + params[2].value;
  389. };
  390. }
  391. function changeBarOption2(data){
  392. series1.name='380v';
  393. series4.name='10kv';
  394. var legendData=[];
  395. var data1=[];
  396. var data2=[];
  397. for(var i=0;i<data.rows.length-1;i++){
  398. legendData[i]=data.rows[i].name;
  399. data1[i]=data.rows[i].level_max;
  400. data2[i]=data.rows[i].level_min;
  401. }
  402. series1.data=data1;
  403. series4.data=data2;
  404. option.series[0]=series1;
  405. option.series[1]=series4;
  406. option.series[2]=[];
  407. option.xAxis[0].data=legendData;
  408. option.legend.data=['380v', '10kv'];
  409. option.tooltip.formatter=function (params){
  410. return params[0].name + '<br/>'
  411. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  412. + params[1].seriesName + ' : ' + params[1].value;
  413. };
  414. }
  415. function changeBarOption3(data){
  416. series1.name='发电机';
  417. series2.name='UPS';
  418. series3.name='磁飞轮';
  419. var legendData=[];
  420. var data1=[];
  421. var data2=[];
  422. var data3=[];
  423. for(var i=0;i<data.rows.length-1;i++){
  424. legendData[i]=data.rows[i].name;
  425. data1[i]=data.rows[i].generator;
  426. data2[i]=data.rows[i].ups;
  427. data3[i]=data.rows[i].fly_circle;
  428. }
  429. series1.data=data1;
  430. series2.data=data2;
  431. series3.data=data3;
  432. option.series[0]=series1;
  433. option.series[1]=series2;
  434. option.series[2]=series3;
  435. option.xAxis[0].data=legendData;
  436. option.legend.data=['发电机', 'UPS','磁飞轮'];
  437. option.tooltip.formatter=function (params){
  438. return params[0].name + '<br/>'
  439. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  440. + params[1].seriesName + ' : ' + params[1].value + '<br/>'
  441. + params[2].seriesName + ' : ' + params[2].value;
  442. };
  443. }
  444. function changeBarOption4(data){
  445. series1.name='可调拨';
  446. series4.name='不可调拨';
  447. var legendData=[];
  448. var data1=[];
  449. var data2=[];
  450. for(var i=0;i<data.rows.length-1;i++){
  451. legendData[i]=data.rows[i].name;
  452. data1[i]=data.rows[i].kused;
  453. data2[i]=data.rows[i].bused;
  454. }
  455. series1.data=data1;
  456. series4.data=data2;
  457. option.series[0]=series1;
  458. option.series[1]=series4;
  459. option.series[2]=[];
  460. option.xAxis[0].data=legendData;
  461. option.legend.data=['可调拨', '不可调拨'];
  462. option.tooltip.formatter=function (params){
  463. return params[0].name + '<br/>'
  464. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  465. + params[1].seriesName + ' : ' + params[1].value;
  466. };
  467. }
  468. //折线图
  469. function changeLineOption1(data){
  470. /*************************************************** 初始化解析折线图数据 start**********************************************************/
  471. var legendData=[];
  472. var seriesData=[];
  473. for(var i=0;i<data.rows.length-1;i++){
  474. //alert(data.rows[i].name);
  475. legendData[i]=data.rows[i].name;
  476. var d={};
  477. seriesData[i]=data.rows[i].num;
  478. }
  479. option6.xAxis[0].data=legendData;
  480. option6.series[0].data=seriesData;
  481. /*************************************************** 初始化解析折线图数据 end **********************************************************/
  482. }
  483. //饼图
  484. function changePieOption1(data){
  485. /*************************************************** 初始化解析饼图数据 start**********************************************************/
  486. var legendData=[];
  487. var seriesData=[];
  488. for(var i=0;i<data.rows.length-1;i++){
  489. //alert(data.rows[i].name);
  490. legendData[i]=data.rows[i].name;
  491. var d={value:data.rows[i].num,name:data.rows[i].name};
  492. seriesData[i]=d;
  493. }
  494. option7.legend.data=legendData;
  495. option7.series[0].data=seriesData;
  496. /*************************************************** 初始化解析饼图数据 end **********************************************************/
  497. }
  498. $(function(){
  499. $("body").eq(0).showLoading();
  500. if((window.location.href).split('?')[1]=="1"){
  501. $("#biaoti").html("");
  502. $("#biaoti").append('<a href="javascript:;"><img id="back" class="back" align="left" alt="返回" src="/nwyj/images/temp/back.png" onclick="goBack()"></img></a><font style="font-weight: bold;font-size: 20px;line-height: 45px;">公司应急发电车(总表)概况</font>');
  503. }
  504. $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : deptName},function (data){
  505. //初始化表格
  506. initCompletes(data);
  507. $("body").eq(0).hideLoading();
  508. gridData=data;
  509. changeBarOption1(data);
  510. changeLineOption1(data);
  511. changePieOption1(data);
  512. var myChart = echarts.init(document.getElementById('main1'));
  513. myChart.setOption(option);
  514. });
  515. //var myChart = echarts.init(document.getElementById('main1'));
  516. //myChart.setOption(option);
  517. $("input:radio[name=fadianji]").click(function(){
  518. var which=$("input:radio[name=fadianji]").filter("[checked]").val();
  519. if(which=='a'){
  520. changeBarOption1(gridData);
  521. var myChart = echarts.init(document.getElementById('main1'));
  522. myChart.setOption(option);
  523. }
  524. if(which=='b'){
  525. changeBarOption2(gridData);
  526. var myChart = echarts.init(document.getElementById('main1'));
  527. myChart.setOption(option);
  528. }
  529. if(which=='c'){
  530. changeBarOption3(gridData);
  531. var myChart = echarts.init(document.getElementById('main1'));
  532. myChart.setOption(option);
  533. }
  534. if(which=='d'){
  535. changeBarOption4(gridData);
  536. var myChart = echarts.init(document.getElementById('main1'));
  537. myChart.setOption(option);
  538. }
  539. });
  540. //alert($("input:radio[name=fadianji]").filter("[checked]").val());
  541. $(".basicTab").bind('actived',function(e,i){
  542. if(i==0){
  543. /***************************************** 加载柱状图 *********************************************************/
  544. var myChart = echarts.init(document.getElementById('main1'));
  545. myChart.setOption(option);
  546. }else if(i == 1){
  547. /***************************************** 加载折线图 *********************************************************/
  548. var myChart2 = echarts.init(document.getElementById('main2'));
  549. myChart2.setOption(option6);
  550. }else if(i==2){
  551. /***************************************** 加载饼图 *********************************************************/
  552. var myChart3 = echarts.init(document.getElementById('main3'));
  553. myChart3.setOption(option7);
  554. }
  555. });
  556. });
  557. var columns= [
  558. { display : '供电局',"name" : 'name',id : 'name',width : 150,dept_id:'dept_id',align : 'center',render : addStatus, frozen: true },
  559. { display : '按容量分类(辆/kVA)',columns : myCols1,width : 300,align : 'center' },
  560. { display : '按电压等级分类(辆)',columns : myCols2,width : 200,align : 'center' },
  561. { display : '按储能方式分类(辆)',columns : myCols3,width : 300,align : 'center' },
  562. { display : '按调拨分类(辆)',columns : myCols4,width : 200,align : 'center' },
  563. { display : '总数量(辆)',"name" : 'num',width : 100,align : 'center' },
  564. { display : '总容量(kVA)',"name" : 'sum',width : 100,align : 'center' }
  565. ];
  566. var json ="";
  567. var loadData;
  568. /*
  569. function initComplete() {
  570. g = $("#maingrid")
  571. .quiGrid(
  572. {
  573. columns : columns,
  574. url : $.pathname()
  575. + '/ws/generatorcar/GeneratorCarService/getCarInfo',
  576. params : {
  577. id : deptName
  578. },
  579. rownumbers : true,
  580. usePager : false
  581. });
  582. }*/
  583. /* //初始化方法
  584. $(function(){
  585. $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : deptName},function (data){
  586. json = data;
  587. //给表格数据赋值
  588. loadData= data;
  589. //初始化表格
  590. initCompletes(json);
  591. gridData=data;
  592. changeBarOption1(data);
  593. changeLineOption1(data);
  594. changePieOption1(data);
  595. var myChart = echarts.init(document.getElementById('main1'));
  596. myChart.setOption(option);
  597. },"json" );
  598. });
  599. */
  600. function initCompletes(json){
  601. g = $("#maingrid").quiGrid({
  602. columns: columns,
  603. data:json,
  604. rownumbers : true,
  605. usePager : false
  606. });
  607. //重设高度
  608. $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  609. $(top.document.body).find("iframe").height($(window.document.body).height()+30);
  610. /*重新绑定父页面事件方法*/
  611. //绑定点击时样式变化事件
  612. $(parent.document.body).find(".leftnav").live("click",parent.checkedCurrent);
  613. //定期报送组点击事件
  614. $(parent.document.body).find(".baosong").live("click",parent.changebaosong);
  615. //定期维护组点击事件
  616. $(parent.document.body).find(".weihu").live("click",parent.changeweihu);
  617. $(parent.document.body).find(".weihu1").live("click",parent.changeweihu1);
  618. /*重新绑定父页面事件方法*/
  619. }
  620. //发送请求,从后台获取数据
  621. function getNewValue(){
  622. //容量
  623. var content = $('#CAR_CONTENT_265').attr("relValue");
  624. var tempContent = content.split(",");
  625. var content1 = "";
  626. var content2 = "";
  627. if(content.length>0){
  628. for(var i =0; i<content.length; i++){
  629. if(tempContent[i]=="content_min"){
  630. content1+= "'"+"250" + "'" + ",";
  631. }
  632. if(tempContent[i]=="content_mid"){
  633. content1= "251" + ",";
  634. content2="500" ;
  635. }
  636. if(tempContent[i]=="content_max"){
  637. content1="501";
  638. content2="99999999999999";
  639. }
  640. }
  641. }
  642. //电压等级
  643. var level = $('#CAR_LEVEL_265').attr("relValue");
  644. //储能方式
  645. var storedtype = $('#STORED_ENERGY_TYPE_265').attr("relValue");
  646. //可否调用
  647. var isUsed = $('#IS_USED_265').attr("relValue");
  648. //取所属单位
  649. var units = $('#COMP_ID_265').val();
  650. //电压等级
  651. var templevel = level+",";
  652. var temp = templevel.split(",");
  653. var valueType1 = "";
  654. for(var i=0; i<temp.length; i++){
  655. if(temp[i]=="level_max"){
  656. valueType1+= "'" + "139" +"'" +",";
  657. }
  658. if(temp[i]=="level_min"){
  659. valueType1+= "'" + "138" +"'" +",";
  660. }
  661. }
  662. var valueType = null;
  663. if(level.length>0){
  664. valueType = valueType1.substring(0,valueType1.length-1);
  665. }
  666. //储能
  667. var energytype = storedtype+",";
  668. var temp1 = energytype.split(",");
  669. var energytype1 = "";
  670. for(var i=0; i<temp1.length; i++){
  671. if(temp1[i]=="generator"){
  672. energytype1+= "'" + "1" +"'" +",";
  673. }
  674. if(temp1[i]=="ups"){
  675. energytype1+= "'" + "2" +"'" +",";
  676. }
  677. if(temp1[i]=="fly_circle"){
  678. energytype1+= "'" + "3" +"'" +",";
  679. }
  680. }
  681. var valueType2 = null;
  682. if(storedtype.length>0){
  683. valueType2 = energytype1.substring(0,energytype1.length-1);
  684. }
  685. //调用
  686. var isused1 = isUsed + ",";
  687. var temp2 = isused1.split(",");
  688. var isused3 = "";
  689. for(var i=0; i<temp2.length; i++){
  690. if(temp2[i]=="kused"){
  691. isused3+= "'" + "1" +"'" +",";
  692. }
  693. if(temp2[i]=="bused"){
  694. isused3+= "'" + "2" +"'" +",";
  695. }
  696. }
  697. var valueType3 = null;
  698. if(isUsed.length>0){
  699. valueType3 = isused3.substring(0,isused3.length-1);
  700. }
  701. //单位
  702. var leng = units.length;
  703. if(leng>0){
  704. var deptIdsTemp = units.split(",");
  705. var arrFF = "";
  706. for(var i=0; i<deptIdsTemp.length; i++){
  707. arrFF+="'"+deptIdsTemp[i]+"'"+",";
  708. }
  709. var deptId = arrFF.substring(0,arrFF.length-1);
  710. }
  711. $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : deptName,content1:content1,content2:content2,valueType:valueType,valueType2:valueType2,valueType3:valueType3,deptId:deptId},function (data){
  712. json = data;
  713. //给表格数据赋值
  714. gridData= data;
  715. //初始化表格
  716. initCompletes(json);
  717. changeBarOption1(data);
  718. changeLineOption1(data);
  719. changePieOption1(data);
  720. var myChart = echarts.init(document.getElementById('main1'));
  721. myChart.setOption(option);
  722. });
  723. //var myChart = echarts.init(document.getElementById('main1'));
  724. //myChart.setOption(option);
  725. $("input:radio[name=fadianji]").click(function(){
  726. var which=$("input:radio[name=fadianji]").filter("[checked]").val();
  727. if(which=='a'){
  728. changeBarOption1(gridData);
  729. var myChart = echarts.init(document.getElementById('main1'));
  730. myChart.setOption(option);
  731. }
  732. if(which=='b'){
  733. changeBarOption2(gridData);
  734. var myChart = echarts.init(document.getElementById('main1'));
  735. myChart.setOption(option);
  736. }
  737. if(which=='c'){
  738. changeBarOption3(gridData);
  739. var myChart = echarts.init(document.getElementById('main1'));
  740. myChart.setOption(option);
  741. }
  742. if(which=='d'){
  743. changeBarOption4(gridData);
  744. var myChart = echarts.init(document.getElementById('main1'));
  745. myChart.setOption(option);
  746. }
  747. });
  748. //alert($("input:radio[name=fadianji]").filter("[checked]").val());
  749. $(".basicTab").bind('actived',function(e,i){
  750. if(i==0){
  751. /***************************************** 加载柱状图 *********************************************************/
  752. var myChart = echarts.init(document.getElementById('main1'));
  753. myChart.setOption(option);
  754. }else if(i == 1){
  755. /***************************************** 加载折线图 *********************************************************/
  756. var myChart2 = echarts.init(document.getElementById('main2'));
  757. myChart2.setOption(option6);
  758. }else if(i==2){
  759. /***************************************** 加载饼图 *********************************************************/
  760. var myChart3 = echarts.init(document.getElementById('main3'));
  761. myChart3.setOption(option7);
  762. }
  763. },"json" );
  764. }
  765. //点击统计按钮触发的事件
  766. function getCount(){
  767. getNewValue();
  768. //容量
  769. var content = $('#CAR_CONTENT_265').attr("relValue");
  770. //电压等级
  771. var level = $('#CAR_LEVEL_265').attr("relValue");
  772. //储能方式
  773. var chunengType = $('#STORED_ENERGY_TYPE_265').attr("relValue");
  774. //取队伍状态
  775. var isUsed = $('#IS_USED_265').attr("relValue");
  776. //取所属单位
  777. var units = $('#COMP_ID_265').val();
  778. var column = content + "," + level + "," + chunengType ;//+ "," + units;
  779. // var temp = column.split(",");
  780. // var column1 = "";
  781. // for(var i=0; i<temp.length; i++){
  782. // column1+=temp[i]+ ",";
  783. // }
  784. //所属单位
  785. var url=$.pathname()+ "/ws/Amyjyan/AmyjyanCount/getEditColumns";
  786. $.ajax({
  787. url : url,
  788. type : 'post',
  789. timeout : 15000,
  790. async : false,
  791. data : {
  792. name : "EMC_AM_GENERATOR_CAR",column:column
  793. },
  794. dataType : 'text',
  795. success : function(data) {
  796. columns=eval('('+ data+')');
  797. //给表格数据赋值
  798. loadData= eval('('+ data+')');
  799. // gridData=data;
  800. // changeBarOption1(data);
  801. // changeLineOption1(data);
  802. // changePieOption1(data);
  803. // var myChart = echarts.init(document.getElementById('main1'));
  804. // myChart.setOption(option);
  805. },
  806. error : function(e) {
  807. $.messager.alert('查询表头失败!', '访问服务失败!', 'error');
  808. }
  809. });
  810. }
  811. function goBack(){
  812. window.location.href="/nwyj/page/business/am/resource/ledger/generator-car.jsp";
  813. }
  814. function addStatus(rowdata, rowindex, value, column){
  815. if("总计"==rowdata.name){
  816. return value;
  817. }else{
  818. var comp_id='"'+rowdata.dept_id+'"';
  819. var name = '"'+value+'"';
  820. return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
  821. }
  822. }
  823. function newHtml(comp_id,name){
  824. if(name=="总计"){
  825. return;
  826. }else if(deptName==comp_id){
  827. return;
  828. }else{
  829. // window.open("/nwyj/page/business/am/resource/ledger/generator-car-poll1.jsp?"+comp_id);
  830. $.indexOpenNextWindow("/nwyj/page/business/am/resource/ledger/generator-car-poll1.jsp?"+comp_id);
  831. }
  832. }
  833. function showMsg(rowdata ,rowindex,value,column){
  834. if("总计"==rowdata.name){
  835. return value;
  836. }else{
  837. return '<a href="javascript:void(0)" '
  838. + 'onclick=showDetail("'
  839. + rowdata.dept_id
  840. + '",'+'"'+column.name+ '",'+'"'+value+'")>'+value+'</a>';
  841. }
  842. }
  843. function showDetail(index,name,val){
  844. if(index=="11111"){
  845. return;
  846. }
  847. return top.Dialog.open({URL:"/nwyj/page/business/am/resource/ledger/windowgenerator-car1.jsp?"+index+"?"+name,ID:"window1",Title:"发电车",ShowMaxButton:true,ShowMinButton:true,Width:1100,Height:500});
  848. }
  849. //重置
  850. function resetSearch(){
  851. document.location.reload();
  852. }
  853. function export_report() {
  854. var sql = {
  855. "report_type" : "fdchz",
  856. "json" : JSON.stringify(g.getData())
  857. };
  858. excelExport(undefined, sql, "公司应急发电车(总表)概况", ['dept_id', 'isParent', 'open'], "公司应急发电车(总表)概况", 'rcpoll');
  859. }
  860. $.messager=top.Dialog;