466bdb22abe62ca4c642d0c376195f1b3d8258bc.svn-base 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  1. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. //数据表格
  3. var g;
  4. var myCols1 = [{
  5. display: '一次', name: 'sub_one', width: 50, align: 'center' ,render:showMsg
  6. },{
  7. display: '二次', name: 'sub_two', width: 50, align: 'center' ,render:showMsg
  8. }];
  9. var myCols2 = [{
  10. display: '中压', name: 'voltage_low', width: 50, align: 'center' ,render:showMsg
  11. },{
  12. display: '低压', name: 'voltage_mv', width: 50, align: 'center' ,render:showMsg
  13. }];
  14. var columns =[
  15. { display: '所属单位',
  16. "name" : 'name',
  17. id : 'name',
  18. width : 100,
  19. dept_id:'dept_id',
  20. align : 'center',
  21. render: addStatus,
  22. frozen: true
  23. },
  24. { display: '专家人数(人)', name: 'num', width: 100, align: 'center' },
  25. { display: '输电(人)', name: 'tran', width: 100, align: 'center' ,render:showMsg},
  26. { display: '变电(人)',columns: myCols1, width: 100, align: 'center' },
  27. { display: '通信(人)', name: 'signal', width: 100, align: 'center' ,render:showMsg},
  28. { display: '配电(人)',columns: myCols2, width: 100, align: 'center' },
  29. { display: '土建(人)', name: 'civil', width: 100, align: 'center' ,render:showMsg},
  30. { display: '机械(人)', name: 'mechanics', width: 100, align: 'center' ,render:showMsg},
  31. { display: '水工(人)', name: 'hydraulic', width: 100, align: 'center' ,render:showMsg},
  32. { display: '后勤(人)', name: 'logistics', width: 100, align: 'center' ,render:showMsg},
  33. { display: '医疗(人)', name: 'medical', width: 100, align: 'center' ,render:showMsg},
  34. { display: '其他(人)', name: 'other', width: 100, align: 'center',render:showMsg}
  35. ];
  36. var json ="";
  37. var loadData;
  38. //柱状图
  39. var option = {
  40. title : {
  41. text: '应急专家统计图',
  42. subtext: '/人'
  43. },
  44. tooltip : {
  45. trigger: 'axis'
  46. },
  47. legend: {
  48. y : 'bottom',
  49. data:['输电','变电','通信','配电','土建','机械','水工','后勤','医疗','其他']
  50. },
  51. toolbox: {
  52. show : true,
  53. feature : {
  54. mark : {show: true},
  55. dataView : {show: true, readOnly: false},
  56. magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
  57. restore : {show: true},
  58. saveAsImage : {show: true}
  59. }
  60. },
  61. calculable : true,
  62. xAxis : [
  63. {
  64. type : 'category',
  65. data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
  66. }
  67. ],
  68. yAxis : [
  69. {
  70. type : 'value'
  71. }
  72. ],
  73. series : [
  74. {
  75. name:'输电',
  76. type:'bar',
  77. 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]
  78. },
  79. {
  80. name:'变电',
  81. type:'bar',
  82. 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]
  83. },
  84. {
  85. name:'通信',
  86. type:'bar',
  87. 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]
  88. },
  89. {
  90. name:'配电',
  91. type:'bar',
  92. 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]
  93. },
  94. {
  95. name:'土建',
  96. type:'bar',
  97. 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]
  98. },
  99. {
  100. name:'机械',
  101. type:'bar',
  102. 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]
  103. },
  104. {
  105. name:'水工',
  106. type:'bar',
  107. 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]
  108. },
  109. {
  110. name:'后勤',
  111. type:'bar',
  112. 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]
  113. },
  114. {
  115. name:'医疗',
  116. type:'bar',
  117. 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]
  118. },
  119. {
  120. name:'其他',
  121. type:'bar',
  122. 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]
  123. }
  124. ]
  125. };
  126. function changeBarOption(data){
  127. var legendData=[];
  128. var seriesData=[];
  129. var data1=[];
  130. var data2=[];
  131. var data3=[];
  132. var data4=[];
  133. var data5=[];
  134. var data6=[];
  135. var data7=[];
  136. var data8=[];
  137. var data9=[];
  138. var data10=[];
  139. for(var i=0;i<data.rows.length-1;i++){
  140. //alert(data.rows[i].name);
  141. legendData[i]=data.rows[i].name;
  142. data1[i]=data.rows[i].tran;
  143. data2[i]=parseInt(data.rows[i].sub_one)+parseInt(data.rows[i].sub_two);
  144. data3[i]=data.rows[i].signal;
  145. data4[i]=parseInt(data.rows[i].voltage_low)+parseInt(data.rows[i].voltage_mv);;
  146. data5[i]=data.rows[i].civil;
  147. data6[i]=data.rows[i].mechanics;
  148. data7[i]=data.rows[i].hydraulic;
  149. data8[i]=data.rows[i].logistics;
  150. data9[i]=data.rows[i].medical;
  151. data10[i]=data.rows[i].other;
  152. }
  153. var series1={ name:'输电',
  154. type:'bar',
  155. data:data1
  156. };
  157. var series2={ name:'变电',
  158. type:'bar',
  159. data:data2
  160. };
  161. var series3={ name:'通信',
  162. type:'bar',
  163. data:data3
  164. };
  165. var series4={ name:'配电',
  166. type:'bar',
  167. data:data4
  168. };
  169. var series5={ name:'土建',
  170. type:'bar',
  171. data:data5
  172. };
  173. var series6={ name:'机械',
  174. type:'bar',
  175. data:data6
  176. };
  177. var series7={ name:'水工',
  178. type:'bar',
  179. data:data7
  180. };
  181. var series8={ name:'后勤',
  182. type:'bar',
  183. data:data8
  184. };
  185. var series9={ name:'医疗',
  186. type:'bar',
  187. data:data9
  188. };
  189. var series10={ name:'其他',
  190. type:'bar',
  191. data:data10
  192. };
  193. seriesData=[series1,series2,series3,series4,series5,series6,series7,series8,series9,series10];
  194. option.xAxis[0].data=legendData;
  195. option.series=seriesData;
  196. }
  197. function changeBarOption2(data){
  198. var legendData=[];
  199. var seriesData=[];
  200. var data1=[];
  201. var data2=[];
  202. var data3=[];
  203. var data4=[];
  204. var data5=[];
  205. var data6=[];
  206. var data7=[];
  207. var data8=[];
  208. var data9=[];
  209. var data10=[];
  210. for(var i=0;i<data.rows.length-1;i++){
  211. //alert(data.rows[i].name);
  212. legendData[i]=data.rows[i].name;
  213. data1[i]=data.rows[i].tran;
  214. data2[i]=parseInt(data.rows[i].sub_one)+parseInt(data.rows[i].sub_two);
  215. data3[i]=data.rows[i].signal;
  216. data4[i]=parseInt(data.rows[i].voltage_low)+parseInt(data.rows[i].voltage_mv);;
  217. data5[i]=data.rows[i].civil;
  218. data6[i]=data.rows[i].mechanics;
  219. data7[i]=data.rows[i].hydraulic;
  220. data8[i]=data.rows[i].logistics;
  221. data9[i]=data.rows[i].medical;
  222. data10[i]=data.rows[i].other;
  223. }
  224. var series1={ name:'输电',
  225. type:'bar',
  226. data:data1
  227. };
  228. var series2={ name:'变电',
  229. type:'bar',
  230. data:data2
  231. };
  232. var series3={ name:'通信',
  233. type:'bar',
  234. data:data3
  235. };
  236. var series4={ name:'配电',
  237. type:'bar',
  238. data:data4
  239. };
  240. var series5={ name:'土建',
  241. type:'bar',
  242. data:data5
  243. };
  244. var series6={ name:'机械',
  245. type:'bar',
  246. data:data6
  247. };
  248. var series7={ name:'水工',
  249. type:'bar',
  250. data:data7
  251. };
  252. var series8={ name:'后勤',
  253. type:'bar',
  254. data:data8
  255. };
  256. var series9={ name:'医疗',
  257. type:'bar',
  258. data:data9
  259. };
  260. var series10={ name:'其他',
  261. type:'bar',
  262. data:data10
  263. };
  264. //seriesData=[series1,series2,series3,series4,series5];
  265. option.legend.data=$("#EXPERT_SPECIALTY_260").attr("relText").split(",");
  266. var getInput=$("#EXPERT_SPECIALTY_260").attr("relText").split(",");
  267. var j=0;
  268. if($.inArray('输电',getInput)!=-1){
  269. seriesData[j]=series1;
  270. j++;
  271. }
  272. if($.inArray('变电',getInput)!=-1){
  273. seriesData[j]=series2;
  274. j++;
  275. }
  276. if($.inArray('通信',getInput)!=-1){
  277. seriesData[j]=series3;
  278. j++;
  279. }
  280. if($.inArray('配电',getInput)!=-1){
  281. seriesData[j]=series4;
  282. j++;
  283. }
  284. if($.inArray('土建',getInput)!=-1){
  285. seriesData[j]=series5;
  286. j++;
  287. }
  288. if($.inArray('机械',getInput)!=-1){
  289. seriesData[j]=series6;
  290. j++;
  291. }
  292. if($.inArray('水工',getInput)!=-1){
  293. seriesData[j]=series7;
  294. j++;
  295. }
  296. if($.inArray('后勤',getInput)!=-1){
  297. seriesData[j]=series8;
  298. j++;
  299. }
  300. if($.inArray('医疗',getInput)!=-1){
  301. seriesData[j]=series9;
  302. j++;
  303. }
  304. if($.inArray('其他',getInput)!=-1){
  305. seriesData[j]=series10;
  306. j++;
  307. }
  308. option.xAxis[0].data=legendData;
  309. option.series=seriesData;
  310. }
  311. //折线图option1
  312. var option1 = {
  313. title : {
  314. text: '应急专家统计图',
  315. subtext: '/人'
  316. },
  317. tooltip : {
  318. trigger: 'axis'
  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 : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
  330. restore : {show: true},
  331. saveAsImage : {show: true}
  332. }
  333. },
  334. calculable : true,
  335. xAxis : [
  336. {
  337. type : 'category',
  338. boundaryGap : false,
  339. data : ['总体预案','专项预案','现场处置方案','部门预案']
  340. }
  341. ],
  342. yAxis : [
  343. {
  344. type : 'value'
  345. }
  346. ],
  347. series : [
  348. {
  349. name:'输电',
  350. type:'line',
  351. data:[20, 30, 50,40]
  352. },
  353. {
  354. name:'变电',
  355. type:'line',
  356. data:[10, 18, 19, 24]
  357. },
  358. {
  359. name:'通信',
  360. type:'line',
  361. data:[15, 22, 20, 15]
  362. },
  363. {
  364. name:'配电',
  365. type:'line',
  366. data:[20, 30, 50,40]
  367. },
  368. {
  369. name:'土建',
  370. type:'line',
  371. data:[10, 18, 19, 24]
  372. },
  373. {
  374. name:'机械',
  375. type:'line',
  376. data:[15, 22, 20, 15]
  377. },
  378. {
  379. name:'水工',
  380. type:'line',
  381. data:[20, 30, 50,40]
  382. },
  383. {
  384. name:'后勤',
  385. type:'line',
  386. data:[10, 18, 19, 24]
  387. },
  388. {
  389. name:'医疗',
  390. type:'line',
  391. data:[15, 22, 20, 15]
  392. },
  393. {
  394. name:'其他',
  395. type:'line',
  396. data:[20, 30, 50,40]
  397. }
  398. ]
  399. };
  400. function changeLineOption(data){
  401. var legendData=[];
  402. var seriesData=[];
  403. var data1=[];
  404. var data2=[];
  405. var data3=[];
  406. var data4=[];
  407. var data5=[];
  408. var data6=[];
  409. var data7=[];
  410. var data8=[];
  411. var data9=[];
  412. var data10=[];
  413. for(var i=0;i<data.rows.length-1;i++){
  414. //alert(data.rows[i].name);
  415. legendData[i]=data.rows[i].name;
  416. data1[i]=data.rows[i].tran;
  417. data2[i]=parseInt(data.rows[i].sub_one)+parseInt(data.rows[i].sub_two);
  418. data3[i]=data.rows[i].signal;
  419. data4[i]=parseInt(data.rows[i].voltage_low)+parseInt(data.rows[i].voltage_mv);;
  420. data5[i]=data.rows[i].civil;
  421. data6[i]=data.rows[i].mechanics;
  422. data7[i]=data.rows[i].hydraulic;
  423. data8[i]=data.rows[i].logistics;
  424. data9[i]=data.rows[i].medical;
  425. data10[i]=data.rows[i].other;
  426. }
  427. var series1={ name:'输电',
  428. type:'line',
  429. data:data1
  430. };
  431. var series2={ name:'变电',
  432. type:'line',
  433. data:data2
  434. };
  435. var series3={ name:'通信',
  436. type:'line',
  437. data:data3
  438. };
  439. var series4={ name:'配电',
  440. type:'line',
  441. data:data4
  442. };
  443. var series5={ name:'土建',
  444. type:'line',
  445. data:data5
  446. };
  447. var series6={ name:'机械',
  448. type:'line',
  449. data:data6
  450. };
  451. var series7={ name:'水工',
  452. type:'line',
  453. data:data7
  454. };
  455. var series8={ name:'后勤',
  456. type:'line',
  457. data:data8
  458. };
  459. var series9={ name:'医疗',
  460. type:'line',
  461. data:data9
  462. };
  463. var series10={ name:'其他',
  464. type:'line',
  465. data:data10
  466. };
  467. seriesData=[series1,series2,series3,series4,series5,series6,series7,series8,series9,series10];
  468. option1.xAxis[0].data=legendData;
  469. option1.series=seriesData;
  470. }
  471. function changeLineOption2(data){
  472. var legendData=[];
  473. var seriesData=[];
  474. var data1=[];
  475. var data2=[];
  476. var data3=[];
  477. var data4=[];
  478. var data5=[];
  479. var data6=[];
  480. var data7=[];
  481. var data8=[];
  482. var data9=[];
  483. var data10=[];
  484. for(var i=0;i<data.rows.length-1;i++){
  485. //alert(data.rows[i].name);
  486. legendData[i]=data.rows[i].name;
  487. data1[i]=data.rows[i].tran;
  488. data2[i]=parseInt(data.rows[i].sub_one)+parseInt(data.rows[i].sub_two);
  489. data3[i]=data.rows[i].signal;
  490. data4[i]=parseInt(data.rows[i].voltage_low)+parseInt(data.rows[i].voltage_mv);;
  491. data5[i]=data.rows[i].civil;
  492. data6[i]=data.rows[i].mechanics;
  493. data7[i]=data.rows[i].hydraulic;
  494. data8[i]=data.rows[i].logistics;
  495. data9[i]=data.rows[i].medical;
  496. data10[i]=data.rows[i].other;
  497. }
  498. var series1={ name:'输电',
  499. type:'line',
  500. data:data1
  501. };
  502. var series2={ name:'变电',
  503. type:'line',
  504. data:data2
  505. };
  506. var series3={ name:'通信',
  507. type:'line',
  508. data:data3
  509. };
  510. var series4={ name:'配电',
  511. type:'line',
  512. data:data4
  513. };
  514. var series5={ name:'土建',
  515. type:'line',
  516. data:data5
  517. };
  518. var series6={ name:'机械',
  519. type:'line',
  520. data:data6
  521. };
  522. var series7={ name:'水工',
  523. type:'line',
  524. data:data7
  525. };
  526. var series8={ name:'后勤',
  527. type:'line',
  528. data:data8
  529. };
  530. var series9={ name:'医疗',
  531. type:'line',
  532. data:data9
  533. };
  534. var series10={ name:'其他',
  535. type:'line',
  536. data:data10
  537. };
  538. option1.legend.data=$("#EXPERT_SPECIALTY_260").attr("relText").split(",");
  539. var getInput=$("#EXPERT_SPECIALTY_260").attr("relText").split(",");
  540. var j=0;
  541. if($.inArray('输电',getInput)!=-1){
  542. seriesData[j]=series1;
  543. j++;
  544. }
  545. if($.inArray('变电',getInput)!=-1){
  546. seriesData[j]=series2;
  547. j++;
  548. }
  549. if($.inArray('通信',getInput)!=-1){
  550. seriesData[j]=series3;
  551. j++;
  552. }
  553. if($.inArray('配电',getInput)!=-1){
  554. seriesData[j]=series4;
  555. j++;
  556. }
  557. if($.inArray('土建',getInput)!=-1){
  558. seriesData[j]=series5;
  559. j++;
  560. }
  561. if($.inArray('机械',getInput)!=-1){
  562. seriesData[j]=series6;
  563. j++;
  564. }
  565. if($.inArray('水工',getInput)!=-1){
  566. seriesData[j]=series7;
  567. j++;
  568. }
  569. if($.inArray('后勤',getInput)!=-1){
  570. seriesData[j]=series8;
  571. j++;
  572. }
  573. if($.inArray('医疗',getInput)!=-1){
  574. seriesData[j]=series9;
  575. j++;
  576. }
  577. if($.inArray('其他',getInput)!=-1){
  578. seriesData[j]=series10;
  579. j++;
  580. }
  581. //seriesData=[series1,series2,series3,series4,series5];
  582. option1.xAxis[0].data=legendData;
  583. option1.series=seriesData;
  584. }
  585. //饼图option2
  586. var option2 = {
  587. title : {
  588. text: '应急专家统计图',
  589. subtext: '/人'
  590. },
  591. tooltip : {
  592. trigger: 'item',
  593. formatter: "{a} <br/>{b} : {c} ({d}%)"
  594. },
  595. legend: {
  596. y : 'bottom',
  597. data:['输电','变电','通信','配电','土建','机械','水工','后勤','医疗','其他']
  598. },
  599. toolbox: {
  600. show : true,
  601. feature : {
  602. mark : {show: true},
  603. dataView : {show: false, readOnly: false},
  604. magicType : {
  605. show: false,
  606. type: ['pie', 'funnel'],
  607. option: {
  608. funnel: {
  609. x: '25%',
  610. width: '50%',
  611. funnelAlign: 'left',
  612. max: 1548
  613. }
  614. }
  615. },
  616. restore : {show: true},
  617. saveAsImage : {show: true}
  618. }
  619. },
  620. calculable : true,
  621. series : [
  622. {
  623. name:'应急专家信息',
  624. type:'pie',
  625. radius : '55%',
  626. center: ['50%', '55%'],
  627. data:[
  628. {value:335, name:'输电'},
  629. {value:310, name:'变电'},
  630. {value:234, name:'通信'},
  631. {value:335, name:'配电'},
  632. {value:310, name:'土建'},
  633. {value:234, name:'机械'},
  634. {value:335, name:'水工'},
  635. {value:310, name:'后勤'},
  636. {value:234, name:'医疗'},
  637. {value:335, name:'其他'}
  638. ]
  639. }
  640. ]
  641. };
  642. function changePieOption3(data){
  643. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  644. option2.legend.data=$("#EXPERT_SPECIALTY_260").attr("relText").split(",");
  645. var getInput=$("#EXPERT_SPECIALTY_260").attr("relText").split(",");
  646. var index=data.rows.length-1;
  647. var seriesJson=[];
  648. var j=0;
  649. if($.inArray('输电',getInput)!=-1){
  650. var json={value:data.rows[index]["tran"],name:'输电'};
  651. seriesJson[j]=json;
  652. j++;
  653. }
  654. if($.inArray('变电',getInput)!=-1){
  655. var json={value:parseInt(data.rows[i].sub_one)+parseInt(data.rows[i].sub_two),name:'变电'};
  656. seriesJson[j]=json;
  657. j++;
  658. }
  659. if($.inArray('通信',getInput)!=-1){
  660. var json={value:data.rows[index]["signal"],name:'通信'};
  661. seriesJson[j]=json;
  662. j++;
  663. }
  664. if($.inArray('配电',getInput)!=-1){
  665. var json={value:parseInt(data.rows[i].voltage_low)+parseInt(data.rows[i].voltage_mv),name:'配电'};
  666. seriesJson[j]=json;
  667. j++;
  668. }
  669. if($.inArray('土建',getInput)!=-1){
  670. var json={value:data.rows[index]["civil"],name:'土建'};
  671. seriesJson[j]=json;
  672. j++;
  673. }
  674. if($.inArray('机械',getInput)!=-1){
  675. var json={value:data.rows[index]["mechanics"],name:'机械'};
  676. seriesJson[j]=json;
  677. j++;
  678. }
  679. if($.inArray('水工',getInput)!=-1){
  680. var json={value:data.rows[index]["hydraulic"],name:'水工'};
  681. seriesJson[j]=json;
  682. j++;
  683. }
  684. if($.inArray('后勤',getInput)!=-1){
  685. var json={value:data.rows[index]["logistics"],name:'后勤'};
  686. seriesJson[j]=json;
  687. j++;
  688. }
  689. if($.inArray('医疗',getInput)!=-1){
  690. var json={value:data.rows[index]["medical"],name:'医疗'};
  691. seriesJson[j]=json;
  692. j++;
  693. }
  694. if($.inArray('其他',getInput)!=-1){
  695. var json={value:data.rows[index]["other"],name:'其他'};
  696. seriesJson[j]=json;
  697. j++;
  698. }
  699. option2.series[0].data=seriesJson;
  700. }
  701. function changePieOption2(data){
  702. /*************************************************** 初始化解析饼图数据 start**********************************************************/
  703. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  704. var index=data.rows.length-1;
  705. var seriesJson=[];
  706. var j=0;
  707. if(data.rows[index]["tran"]!=undefined){
  708. var json={value:data.rows[index]["tran"],name:'输电'};
  709. seriesJson[j]=json;
  710. j++;
  711. }
  712. if(data.rows[index]["sub_one"]!=undefined){
  713. var json={value:parseInt(data.rows[index]["sub_one"])+parseInt(data.rows[index]["sub_two"]),name:'变电'};
  714. seriesJson[j]=json;
  715. j++;
  716. }
  717. if(data.rows[index]["signal"]!=undefined){
  718. var json={value:data.rows[index]["signal"],name:'通信'};
  719. seriesJson[j]=json;
  720. j++;
  721. }
  722. if(data.rows[index]["voltage_low"]!=undefined){
  723. var json={value:parseInt(data.rows[index]["voltage_low"])+parseInt(data.rows[index]["voltage_mv"]),name:'配电'};
  724. seriesJson[j]=json;
  725. j++;
  726. }
  727. if(data.rows[index]["civil"]!=undefined){
  728. var json={value:data.rows[index]["civil"],name:'土建'};
  729. seriesJson[j]=json;
  730. j++;
  731. }
  732. if(data.rows[index]["mechanics"]!=undefined){
  733. var json={value:data.rows[index]["mechanics"],name:'机械'};
  734. seriesJson[j]=json;
  735. j++;
  736. }
  737. if(data.rows[index]["hydraulic"]!=undefined){
  738. var json={value:data.rows[index]["hydraulic"],name:'水工'};
  739. seriesJson[j]=json;
  740. j++;
  741. }
  742. if(data.rows[index]["logistics"]!=undefined){
  743. var json={value:data.rows[index]["logistics"],name:'后勤'};
  744. seriesJson[j]=json;
  745. j++;
  746. }
  747. if(data.rows[index]["medical"]!=undefined){
  748. var json={value:data.rows[index]["medical"],name:'医疗'};
  749. seriesJson[j]=json;
  750. j++;
  751. }
  752. if(data.rows[index]["other"]!=undefined){
  753. var json={value:data.rows[index]["other"],name:'其他'};
  754. seriesJson[j]=json;
  755. j++;
  756. }
  757. option2.series[0].data=seriesJson;
  758. /*************************************************** 初始化解析饼图数据 end **********************************************************/
  759. }
  760. //初始化方法
  761. $(function(){
  762. $("body").eq(0).showLoading();
  763. $.post($.pathname()+ "/ws/EXPERT/ExpertService/getExpertInfo",{id : deptName},function (data){
  764. json = data;
  765. //给表格数据赋值
  766. loadData= data;
  767. //初始化表格
  768. initCompletes(json);
  769. $("body").eq(0).hideLoading();
  770. changeBarOption(data);
  771. changeLineOption(data);
  772. changePieOption2(data);
  773. var myChart1 = echarts.init(document.getElementById('main1'));
  774. myChart1.setOption(option);
  775. $(".basicTab").bind('actived',function(e,i){
  776. if(i==0){
  777. /***************************************** 加载柱状图 *********************************************************/
  778. var myChart1 = echarts.init(document.getElementById('main1'));
  779. myChart1.setOption(option);
  780. // initmyGraphic(data);
  781. }else if(i == 1){
  782. /***************************************** 加载折线图 *********************************************************/
  783. var myChart5 = echarts.init(document.getElementById('main2'));
  784. myChart5.setOption(option1);
  785. }else if(i==2){
  786. /***************************************** 加载饼图 *********************************************************/
  787. var myChart2 = echarts.init(document.getElementById('main3'));
  788. myChart2.setOption(option2);
  789. }
  790. });
  791. },"json" );
  792. });
  793. //重新加载表格
  794. function initCompletes(json){
  795. g = $("#maingrid").quiGrid({
  796. columns: columns,
  797. data:json,
  798. rownumbers : true,
  799. usePager : false
  800. });
  801. //重设高度
  802. $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  803. $(top.document.body).find("iframe").height($(window.document.body).height()+30);
  804. /*重新绑定父页面事件方法*/
  805. //绑定点击时样式变化事件
  806. $(parent.document.body).find(".leftnav").live("click",parent.checkedCurrent);
  807. //定期报送组点击事件
  808. $(parent.document.body).find(".baosong").live("click",parent.changebaosong);
  809. //定期维护组点击事件
  810. $(parent.document.body).find(".weihu").live("click",parent.changeweihu);
  811. $(parent.document.body).find(".weihu1").live("click",parent.changeweihu1);
  812. /*重新绑定父页面事件方法*/
  813. }
  814. function addStatus(rowdata, rowindex, value, column){
  815. var comp_id='"'+rowdata.dept_id+'"';
  816. var name = '"'+value+'"';
  817. if("总计"==rowdata.name){
  818. return value;
  819. }else{
  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/expert/expert-poll1.jsp?"+comp_id);
  830. $.indexOpenNextWindow("/nwyj/page/business/am/resource/expert/expert-poll1.jsp?"+comp_id);
  831. }
  832. }
  833. //返回
  834. function goBack() {
  835. window.location.href="expert-maintenance.jsp";
  836. }
  837. //发送请求,从后台获取数据
  838. function getNewValue(){
  839. //是否南网员工
  840. var level = $('#IS_SNSTAFF_260').attr("relValue");
  841. //专业特长
  842. var chunengType = $('#EXPERT_SPECIALTY_260').attr("relValue");
  843. //取所属单位
  844. var units = $('#EXPERT_UNIT_260').val();
  845. //是否南网员工
  846. var tempLevel = null;
  847. if(level.length>0){
  848. var temp = level.split(",");
  849. var tempLevel1="";
  850. for(var i=0; i<temp.length; i++){
  851. tempLevel1 +="'"+ temp[i] + "',";
  852. }
  853. tempLevel = tempLevel1.substring(0,tempLevel1.length-1);
  854. }
  855. //专业特长
  856. var temp1 = chunengType.split(",");
  857. var tempChunengType = "";
  858. for(var i=0; i<temp1.length; i++){
  859. tempChunengType+=temp1[i] + ",";
  860. }
  861. //专业特长转换
  862. var temp2 = tempChunengType.split(",");
  863. var valueType1 = "";
  864. for(var i=0; i<temp2.length; i++){
  865. if(temp2[i]=="tran"){
  866. valueType1+= "'" + "1" +"'" +",";
  867. }
  868. if(temp2[i]=="sub_one"){
  869. valueType1+= "'" + "2" +"'" +",";
  870. }
  871. if(temp2[i]=="sub_two"){
  872. valueType1+= "'" + "3" +"'" +",";
  873. }
  874. if(temp2[i]=="signal"){
  875. valueType1+= "'" + "4" +"'" +",";
  876. }
  877. if(temp2[i]=="voltage_low"){
  878. valueType1+= "'" + "5" +"'" +",";
  879. }
  880. if(temp2[i]=="voltage_mv"){
  881. valueType1+= "'" + "6" +"'" +",";
  882. }
  883. if(temp2[i]=="civil"){
  884. valueType1+= "'" + "7" +"'" +",";
  885. }
  886. if(temp2[i]=="mechanics"){
  887. valueType1+= "'" + "8" +"'" +",";
  888. }
  889. if(temp2[i]=="hydraulic"){
  890. valueType1+= "'" + "9" +"'" +",";
  891. }
  892. if(temp2[i]=="logistics"){
  893. valueType1+= "'" + "10" +"'" +",";
  894. }
  895. if(temp2[i]=="medical"){
  896. valueType1+= "'" + "11" +"'" +",";
  897. }
  898. if(temp2[i]=="other"){
  899. valueType1+= "'" + "12" +"'" +",";
  900. }
  901. }
  902. var valueType = null;
  903. if(chunengType.length>0){
  904. valueType = valueType1.substring(0,valueType1.length-1);
  905. }
  906. //单位整理
  907. var leng = units.length;
  908. var deptId = null;
  909. if(leng>0){
  910. var deptIdsTemp = units.split(",");
  911. var arrFF = "";
  912. for(var i=0; i<deptIdsTemp.length; i++){
  913. arrFF+="'"+deptIdsTemp[i]+"'"+",";
  914. }
  915. deptId = arrFF.substring(0,arrFF.length-1);
  916. }
  917. /*alert("是否:" + tempLevel);
  918. alert("专业:" + valueType);
  919. alert("单位:"+deptId);*/
  920. $.post($.pathname()+ "/ws/EXPERT/ExpertService/getExpertInfo",
  921. {id : deptName,isNwyj:tempLevel,zhuanye:valueType,deptId:deptId},
  922. function (data){
  923. json = data;
  924. //给表格数据赋值
  925. loadData= data;
  926. //初始化表格
  927. initCompletes(json);
  928. changeBarOption(data);
  929. changeLineOption(data);
  930. changePieOption2(data);
  931. var myChart1 = echarts.init(document.getElementById('main1'));
  932. myChart1.setOption(option);
  933. $(".basicTab").bind('actived',function(e,i){
  934. if(i==0){
  935. /***************************************** 加载柱状图 *********************************************************/
  936. var myChart1 = echarts.init(document.getElementById('main1'));
  937. myChart1.setOption(option);
  938. // initmyGraphic(data);
  939. }else if(i == 1){
  940. /***************************************** 加载折线图 *********************************************************/
  941. var myChart5 = echarts.init(document.getElementById('main2'));
  942. myChart5.setOption(option1);
  943. }else if(i==2){
  944. /***************************************** 加载饼图 *********************************************************/
  945. var myChart2 = echarts.init(document.getElementById('main3'));
  946. myChart2.setOption(option2);
  947. }
  948. });
  949. $(".basicTab").render();
  950. },"json" );
  951. }
  952. //点击统计按钮触发的事件
  953. function getCount(){
  954. getNewValue();
  955. //是否南网员工
  956. var isNwyj = $('#IS_SNSTAFF_260').attr("relValue");
  957. //专业特长
  958. var zhuanye = $('#EXPERT_SPECIALTY_260').attr("relValue");
  959. //取所属单位
  960. var units = $('#EXPERT_UNIT_260').val();
  961. var column = isNwyj + "," + zhuanye + "," + units + "," ;
  962. /*var temp = column.split(",");
  963. var column1 = "";
  964. for(var i=0; i<temp.length; i++){
  965. column1+=temp[i]+ ",";
  966. }
  967. */
  968. zhuanye = zhuanye + ",";
  969. //所属单位
  970. var url=$.pathname()+ "/ws/Amyjyan/AmyjyanCount/getEditColumns";
  971. $.ajax({
  972. url : url,
  973. type : 'post',
  974. timeout : 15000,
  975. async : false,
  976. data : {
  977. name : "EMC_AM_EMERGENCY_EXPERT",column:zhuanye
  978. },
  979. dataType : 'text',
  980. success : function(data) {
  981. columns=eval('('+ data+')');
  982. //给表格数据赋值
  983. loadData= eval('('+ data+')');
  984. //初始化表格
  985. initCompletes(json);
  986. },
  987. error : function(e) {
  988. $.messager.alert('查询表头失败!', '访问服务失败!', 'error');
  989. }
  990. });
  991. }
  992. function showMsg(rowdata ,rowindex,value,column){
  993. if("总计"==rowdata.name){
  994. return value;
  995. }else{
  996. return '<a href="javascript:void(0)" '
  997. + 'onclick=showDetail("'
  998. + rowdata.dept_id
  999. + '",'+'"'+column.name+ '",'+'"'+value+'")>'+value+'</a>';
  1000. }
  1001. }
  1002. function showDetail(index,name,val){
  1003. if(index=="11111"){
  1004. return;
  1005. }
  1006. var teamtype = "";
  1007. if(name=="tran"){
  1008. teamtype = "1";
  1009. }else if(name=="sub_one"){
  1010. teamtype = "2";
  1011. }else if(name=="sub_two"){
  1012. teamtype = "3";
  1013. }else if(name=="signal"){
  1014. teamtype = "4";
  1015. }else if(name=="voltage_low"){
  1016. teamtype = "5";
  1017. }else if(name=="voltage_mv"){
  1018. teamtype = "6";
  1019. }else if(name=="civil"){
  1020. teamtype = "7";
  1021. }else if(name=="mechanics"){
  1022. teamtype = "8";
  1023. }else if(name=="hydraulic"){
  1024. teamtype = "9";
  1025. }else if(name=="logistics"){
  1026. teamtype = "10";
  1027. }else if(name=="medical"){
  1028. teamtype = "11";
  1029. }else if(name=="other"){
  1030. teamtype = "12";
  1031. }
  1032. return parent.Dialog.open({URL:"/nwyj/page/business/am/resource/expert/windowexpert.jsp?"+index+"?"+teamtype,ID:"window1",Title:"应急专家",ShowMaxButton:true,ShowMinButton:true,Width:1100,Height:700});
  1033. }
  1034. //重置
  1035. function resetSearch(){
  1036. document.location.reload();
  1037. }
  1038. function export_report() {
  1039. var sql = {
  1040. "report_type" : "zhuangjia",
  1041. "json" : JSON.stringify(g.getData())
  1042. };
  1043. excelExport(undefined, sql, "应急专家信息统计", ['dept_id', 'isParent', 'open'], "应急专家信息统计", 'rcpoll');
  1044. }
  1045. $.messager=top.Dialog;