liftOption.js 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. /**
  2. *
  3. */
  4. Ext.Loader.setConfig({
  5. enabled: true
  6. });
  7. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  8. Ext.require([
  9. 'Ext.grid.*',
  10. 'Ext.data.*',
  11. 'Ext.ux.RowExpander',
  12. 'Ext.selection.CheckboxModel'
  13. ]);
  14. var StatusStore;
  15. var baseUrl;
  16. var centerLng;
  17. var centerLat;
  18. var company_code;
  19. var theme;
  20. var ConfirmStore
  21. var pieWidth;
  22. var showAlarm=null;
  23. var pieMask;
  24. var V_LOGINNAME='',V_PASSWORD='';
  25. var maxHeight = 10000;
  26. var maxWidth = 10000;
  27. var companyName = null;
  28. var sm = Ext.create('Ext.selection.CheckboxModel');
  29. Ext.define('VFireOption',{
  30. extend: 'Ext.data.Model',
  31. fields: [
  32. { name:'id', type:'int'},
  33. { name:'orderIdx', type:'int'},
  34. { name:'device_code', type:'string' },
  35. { name:'company_code', type:'string' },
  36. { name:'company_name', type:'string' },
  37. { name:'fullname', type:'string' },
  38. { name:'time', type:'string' },
  39. { name:'name', type:'string' },
  40. { name:'status', type:'string' },
  41. { name:'data', type:'string' },
  42. { name:'clzt', type:'string' },
  43. { name:'clr_name', type:'string' },
  44. { name:'clsj', type:'string' },
  45. { name:'clnr', type:'string'},
  46. { name:'ncmd', type:'string'},
  47. { name:'clwb', type:'string'}
  48. ]
  49. });
  50. Ext.define('CompanyComboStore',{
  51. extend:'Ext.data.Model',
  52. fields: [
  53. {name:'owner_name', type:'string'},
  54. {name:'owner_id',type:'string'}
  55. ]
  56. });
  57. var drawDevices = function(){
  58. // alert('get device info');
  59. if(StatusStore.length>0){
  60. var current_device_id='';
  61. var device_count=0;
  62. var fire_device_count=0;
  63. var water_device_count=0;
  64. var rtu_device_count=0;
  65. var other_device_count=0;
  66. var fire_device_out=0;
  67. var water_device_out=0;
  68. var rtu_device_out=0;
  69. var other_device_out=0;
  70. var fire_device_alarm=0;
  71. var water_device_alarm=0;
  72. var rtu_device_alarm=0;
  73. var other_device_alarm=0;
  74. var fire_device_normal=0;
  75. var water_device_normal=0;
  76. var rtu_device_normal=0;
  77. var other_device_normal=0;
  78. //电梯
  79. var lift_device_count=0;
  80. var lift_device_out=0;
  81. var lift_device_alarm=0;
  82. var lift_device_normal=0;
  83. var total_normal=0;
  84. var mark_array = new Array();
  85. for(var i=0;i<StatusStore.length;i++){
  86. if((StatusStore[i].point_list!=null)
  87. &&(StatusStore[i].point_list!=undefined)
  88. &&(StatusStore[i].point_list.length>0)){
  89. for(var j=0;j<StatusStore[i].point_list.length;j++){
  90. if(StatusStore[i].point_list[j].device_id!=current_device_id){
  91. current_device_id=StatusStore[i].point_list[j].device_id;
  92. device_count++;
  93. if((StatusStore[i].point_list[j].dwtype=='1')
  94. ||(StatusStore[i].point_list[j].dwtype==1))
  95. fire_device_count++;
  96. else if((StatusStore[i].point_list[j].dwtype=='2')
  97. ||(StatusStore[i].point_list[j].dwtype==2))
  98. water_device_count++;
  99. else if((StatusStore[i].point_list[j].dwtype=='3')
  100. ||(StatusStore[i].point_list[j].dwtype==3))
  101. other_device_count++;
  102. else if((StatusStore[i].point_list[j].dwtype=='4')
  103. ||(StatusStore[i].point_list[j].dwtype==4))
  104. water_device_count++;
  105. else if((StatusStore[i].point_list[j].dwtype=='5')
  106. ||(StatusStore[i].point_list[j].dwtype==5))
  107. water_device_count++;
  108. else if((StatusStore[i].point_list[j].dwtype=='6')
  109. ||(StatusStore[i].point_list[j].dwtype==6))
  110. rtu_device_count++;
  111. else
  112. other_device_count++;
  113. }
  114. if((StatusStore[i].point_list[j].point_code=='0')
  115. ||(StatusStore[i].point_list[j].point_code==0)){
  116. if((StatusStore[i].point_list[j].point_data!='0')
  117. &&(StatusStore[i].point_list[j].point_data!=0)){
  118. if((StatusStore[i].point_list[j].dwtype=='1')
  119. ||(StatusStore[i].point_list[j].dwtype==1))
  120. fire_device_alarm++;
  121. else if((StatusStore[i].point_list[j].dwtype=='2')
  122. ||(StatusStore[i].point_list[j].dwtype==2)){
  123. if((StatusStore[i].point_list[j].point_data=='4')
  124. ||(StatusStore[i].point_list[j].point_data==4))
  125. water_device_out++;
  126. else
  127. water_device_alarm++;
  128. }
  129. else if((StatusStore[i].point_list[j].dwtype=='3')
  130. ||(StatusStore[i].point_list[j].dwtype==3))
  131. other_device_out++;
  132. else if((StatusStore[i].point_list[j].dwtype=='4')
  133. ||(StatusStore[i].point_list[j].dwtype==4))
  134. if((StatusStore[i].point_list[j].point_data=='4')
  135. ||(StatusStore[i].point_list[j].point_data==4))
  136. water_device_out++;
  137. else
  138. water_device_alarm++;
  139. else if((StatusStore[i].point_list[j].dwtype=='5')
  140. ||(StatusStore[i].point_list[j].dwtype==5))
  141. if((StatusStore[i].point_list[j].point_data=='4')
  142. ||(StatusStore[i].point_list[j].point_data==4))
  143. water_device_out++;
  144. else
  145. water_device_alarm++;
  146. else if((StatusStore[i].point_list[j].dwtype=='6')
  147. ||(StatusStore[i].point_list[j].dwtype==6))
  148. rtu_device_out++;
  149. else
  150. other_device_out++;
  151. }
  152. }
  153. }
  154. }
  155. }
  156. fire_device_normal = fire_device_count-fire_device_out-fire_device_alarm;
  157. water_device_normal = water_device_count-water_device_out-water_device_alarm;
  158. rtu_device_normal = rtu_device_count-rtu_device_out-rtu_device_alarm;
  159. other_device_normal = other_device_count-other_device_out-other_device_alarm;
  160. total_normal = fire_device_normal+water_device_normal+rtu_device_normal+other_device_normal;
  161. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  162. draw_cycle_icon('firePie1','设备在线<br/> <br/>监控总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_count+'</span><br/>在线总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(fire_device_count-fire_device_out)+'</span><br/>离线线总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_out+'<br/>在线率:',fire_device_count,(fire_device_count-fire_device_out),themecolor);
  163. draw_cycle_icon('firePie2','状态正常<br/> <br/>在线总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(fire_device_count-fire_device_out)+'</span><br/>正常总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_normal+'</span><br/>告警总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_alarm+'<br/>正常率:',(fire_device_count-fire_device_out),fire_device_normal,themecolor);
  164. }
  165. }
  166. var draw_confirm = function(){
  167. if(companyName!=null)
  168. $("#LiftPiePanel_title_string").html(companyName+'.电梯报告列表');
  169. else
  170. $("#LiftPiePanel_title_string").html('电梯报告列表');
  171. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  172. for(var i=0;i<ConfirmStore.length;i++){
  173. if(ConfirmStore[i].id=='lift_alarm'){
  174. var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  175. var percent = 100;
  176. if(ConfirmStore[i].count>0)
  177. percent = Number(((ConfirmStore[i].sum*100)/ConfirmStore[i].count).toString().match(/^\d+(?:\.\d{0,2})?/));
  178. if(percent<60)
  179. mColor = '#f66167';
  180. else if(percent<80)
  181. mColor = '#DDDF0D';
  182. $("#operation_num_1").html(ConfirmStore[i].count);
  183. $("#operation_num_2").html(ConfirmStore[i].sum);
  184. $("#operation_num_3").html(ConfirmStore[i].count-ConfirmStore[i].sum);
  185. $("#operation_num_4").html(percent);
  186. // draw_cycle_icon('firePie3','告警处理情况<br/>告警总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].count+'</span><br/>已处理:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].sum+'</span><br/>未处理:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'</span><br/>处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor);
  187. Highcharts.getOptions().colors = Highcharts.map(['#DDDF0D',mColor], function (color) {
  188. return {
  189. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  190. stops: [
  191. [0, color],
  192. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  193. ]
  194. };
  195. });
  196. Highcharts.chart('operation_pie',{
  197. chart: {
  198. type: 'solidgauge',
  199. height: '100%',
  200. backgroundColor: 'rgba(0,0,0,0)',
  201. animation: false
  202. },
  203. title:{
  204. text:percent+'%',
  205. floating:true,
  206. y:90,
  207. style:{fontSize:'16px',color:themecolor,fontWeight:'bold'}
  208. },
  209. exporting: {
  210. enabled: false
  211. },
  212. credits: {
  213. enabled: false
  214. },
  215. tooltip: {
  216. enabled: false
  217. },
  218. pane: {
  219. startAngle: 0,
  220. background: [{
  221. outerRadius: '110%',
  222. innerRadius: '55%',
  223. backgroundColor: 'rgba(0,0,0,0)',
  224. borderWidth: 0
  225. }]
  226. },
  227. yAxis: {
  228. min: 0,
  229. max: 100,
  230. lineWidth: 0,
  231. tickPositions: []
  232. },
  233. plotOptions: {
  234. solidgauge: {
  235. dataLabels: {
  236. enabled: false
  237. },
  238. linecap: 'square',
  239. stickyTracking: false,
  240. rounded: false,
  241. warp: false
  242. },
  243. series:{
  244. animation: false
  245. }
  246. },
  247. series:[{
  248. name:name,
  249. data:[{
  250. color: 'rgba(0,0,0,0.3)',
  251. radius: '110%',
  252. innerRadius: '60%',
  253. y: 100
  254. },{
  255. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  256. radius: '110%',
  257. innerRadius: '60%',
  258. y: percent
  259. }]
  260. }]
  261. });
  262. Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5'], function (color) {
  263. return {
  264. linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
  265. stops: [
  266. [0, color],
  267. [1, Highcharts.Color(color).setOpacity(0).get('rgb')] // darken
  268. ]
  269. };
  270. });
  271. Highcharts.chart('operation_area',{
  272. chart:{
  273. type:'area',
  274. // zoomType: 'x',
  275. backgroundColor: 'rgba(0,0,0,0)'
  276. },
  277. color:['#f66167', '#34abf5'],
  278. title:{
  279. text:(companyName!=null)?companyName+'.电梯监控告警处理情况跟踪':'电梯监控告警处理情况跟踪',
  280. float:true,
  281. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  282. enabled:false
  283. },
  284. legend:{
  285. // enabled:false,
  286. floating:true,
  287. x:410,
  288. y:-210,
  289. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  290. },
  291. // colors:['#f66167', '#34abf5'],
  292. exporting: {
  293. enabled: false
  294. },
  295. credits: {
  296. enabled: false
  297. },
  298. xAxis:{
  299. categories:ConfirmStore[i].day_list,
  300. tickmarkPlacement:'on',
  301. gridLineWidth:0,
  302. labels:{
  303. enabled:false,
  304. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  305. },
  306. title:{
  307. enabled:false
  308. }
  309. },
  310. yAxis:{
  311. title:{
  312. enabled:false,
  313. text:'次',
  314. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  315. },
  316. gridLineWidth:1,
  317. gridLineColor:'rgba(0,0,0,0.2)',
  318. labels:{
  319. // enabled:false,
  320. formatter:this.value,
  321. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  322. }
  323. },
  324. plotOptions:{
  325. area:{
  326. stackiung:'normal',
  327. // fillOpacity:0.1,
  328. // lineColor:'#666666',
  329. // lineWidth:1,
  330. marker:{
  331. lineWidth:0,
  332. enabled:false,
  333. radius:0
  334. // lineColor:'#666666'
  335. }
  336. }
  337. },
  338. series:[
  339. {
  340. name:'告警次数',
  341. data:ConfirmStore[i].count_list,
  342. lineWidth:1,
  343. lineColor:'#f66167',
  344. fillColor: {
  345. linearGradient: {
  346. x1: 0,
  347. y1: 0,
  348. x2: 0,
  349. y2: 1
  350. },
  351. stops: [
  352. [0, '#f66167'],
  353. [1, Highcharts.Color('#f66167').setOpacity(0.3).get('rgba')]
  354. ]
  355. }
  356. },{
  357. name:'处理次数',
  358. data:ConfirmStore[i].sum_list,
  359. lineWidth:1,
  360. lineColor:'#34abf5',
  361. fillColor: {
  362. linearGradient: {
  363. x1: 0,
  364. y1: 0,
  365. x2: 0,
  366. y2: 1
  367. },
  368. stops: [
  369. [0, '#34abf5'],
  370. [1, Highcharts.Color('#34abf5').setOpacity(0.3).get('rgba')]
  371. ]
  372. },
  373. }
  374. ]
  375. });
  376. }
  377. }
  378. }
  379. var draw_cycle_icon = function(icon_id,name, total, num, themecolor){
  380. var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  381. var percent = 100;
  382. if(total>0)
  383. percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
  384. if(percent<60)
  385. mColor = '#f66167';
  386. else if(percent<80)
  387. mColor = '#DDDF0D';
  388. $("#"+icon_id+"Title").html('<br/><br/>'+name+percent+'%');
  389. Highcharts.getOptions().colors = Highcharts.map([ '#000000',mColor, mColor], function (color) {
  390. return {
  391. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  392. stops: [
  393. [0, color],
  394. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  395. ]
  396. };
  397. });
  398. Highcharts.chart(icon_id,{
  399. chart: {
  400. type: 'solidgauge',
  401. height: '85%',
  402. backgroundColor: 'rgba(0,0,0,0)',
  403. reflow:true,
  404. marginTop:0
  405. },
  406. title:{
  407. text:percent+'%',
  408. floating:true,
  409. y:(pieWidth*2/5),
  410. style:{fontSize:'21px',color:themecolor,fontWeight:'bold'}
  411. },
  412. exporting: {
  413. enabled: false
  414. },
  415. credits: {
  416. enabled: false
  417. },
  418. tooltip: {
  419. enabled: false
  420. },
  421. pane: {
  422. startAngle: -90,
  423. endAngle: 270,
  424. background: [{
  425. outerRadius: '90%',
  426. innerRadius: '60%',
  427. backgroundColor: 'rgba(0,0,0,0)',
  428. borderWidth: 0
  429. }]
  430. },
  431. yAxis: {
  432. min: 0,
  433. max: 100,
  434. lineWidth: 0,
  435. tickPositions: []
  436. },
  437. plotOptions: {
  438. solidgauge: {
  439. dataLabels: {
  440. enabled: false
  441. },
  442. linecap: 'square',
  443. stickyTracking: false,
  444. rounded: false,
  445. warp: false
  446. }
  447. },
  448. series:[{
  449. name:'',
  450. data:[{
  451. color: Highcharts.Color(mColor)
  452. .setOpacity(0.2)
  453. .get(),
  454. radius: '110%',
  455. innerRadius: '80%',
  456. y: 100
  457. },{
  458. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) ,
  459. radius: '110%',
  460. innerRadius: '80%',
  461. y: percent
  462. },{
  463. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) ,
  464. radius: '60%',
  465. innerRadius: '0%',
  466. y: 100
  467. }]
  468. }]
  469. });
  470. if((theme=='access')||(theme=='')){
  471. $('#'+icon_id).addClass('shadow_black');
  472. }else{
  473. $('#'+icon_id).addClass('shadow_white');
  474. }
  475. }
  476. var getCurrentData = function(){
  477. var query = new Object();
  478. // query.V_LOGINNAME = V_LOGINNAME;
  479. // query.V_PASSWORD = V_PASSWORD;
  480. query.dwtype='17';
  481. query.COMMSTATUS = 'NO';
  482. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  483. query.company_code = company_code;
  484. pieMask.show();
  485. $.ajax({
  486. type:'POST',
  487. url: baseUrl+"iot/alarm/view/getConfirmStatusByDays",
  488. data: {
  489. queryJson : Ext.JSON.encode(query)
  490. },
  491. success: function(result){
  492. var json = eval('(' + result + ')');
  493. if(json.action=='getConfirmStatusByDays'){
  494. if(json.check=='true'){
  495. ConfirmStore = json.RESULT;
  496. if(json.company_name!=null)
  497. companyName = json.company_name;
  498. else
  499. companyName = null;
  500. draw_confirm();
  501. }else{
  502. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  503. window.parent.frames.return_login();
  504. });
  505. }
  506. }
  507. pieMask.hide();
  508. }
  509. });
  510. }
  511. //电梯 liftAlarmPanel
  512. var body_resize = function(){
  513. maxHeight = document.documentElement.clientHeight;
  514. maxWidth = document.documentElement.clientWidth;
  515. Ext.getCmp('RtuAlarmPanel').setHeight(maxHeight);
  516. Ext.getCmp('RtuAlarmPanel').setWidth(maxWidth);
  517. }
  518. function exportbtn_click(){
  519. V_LOGINNAME = $("#V_LOGINNAME").val();
  520. company_code = document.getElementById('company_code').value;
  521. clzt = document.getElementById('clzt').value;
  522. time_start = document.getElementById('time_start').value;
  523. time_end = document.getElementById('time_end').value;
  524. var fields = '';
  525. var array = ['id','company_name','device_code','name','data4','clr','clnr','clwb','clzt','time','clsj'];
  526. var name = ['编号','公司名称','设备编号','设备名称','报警类型','处理人','处理内容','是否误报','处理状态','报警时间','处理时间'];
  527. for(var i=0;i<11;i++){
  528. if(i>0)
  529. fields += ',';
  530. fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
  531. }
  532. var query = new Object();
  533. // query.V_LOGINNAME = V_LOGINNAME;
  534. query.company_code = company_code;
  535. query.clzt = clzt;
  536. query.time_start = time_start;
  537. query.time_end = time_end;
  538. query.COMMSTATUS = 'NO';
  539. query.EXPORT_FILE = '电梯系统告警数据列表';
  540. query.fields = '['+fields+']';
  541. $.ajax({
  542. type:'POST',
  543. url: baseUrl+"iot/excel/view/liftAlarmExcel",
  544. data: {
  545. queryJson : Ext.JSON.encode(query)
  546. },
  547. success: function(result){
  548. var json = eval('(' + result + ')');
  549. if(json.action=='dormExport'){
  550. ConfirmStore = json.RESULT;
  551. var elemIF = document.createElement("iframe");
  552. elemIF.src = baseUrl+json.filename;
  553. elemIF.style.display = "none";
  554. document.body.appendChild(elemIF);
  555. }
  556. }
  557. });
  558. }
  559. Ext.onReady(function(){
  560. baseUrl = document.getElementById('basePath').value;
  561. theme = document.getElementById('theme').value;
  562. company_code = document.getElementById('company_code').value;
  563. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  564. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  565. V_LOGINNAME = $("#V_LOGINNAME").val();
  566. V_PASSWORD = $("#V_PASSWORD").val();
  567. var currentWidth = document.documentElement.clientWidth;
  568. pieWidth = currentWidth/7;
  569. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  570. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  571. var countPerPage = 20;
  572. var chkBoolean = function(flag) {
  573. if(flag)
  574. return chkIcon;
  575. return unchkIcon;
  576. }
  577. var queryJson = new Object();
  578. // queryJson.V_LOGINNAME = V_LOGINNAME;
  579. // queryJson.V_PASSWORD = V_PASSWORD;
  580. queryJson.COMMSTATUS = 'NO';
  581. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  582. queryJson.company_code = company_code;
  583. var myStore = Ext.create('Ext.data.Store', {
  584. model: 'VFireOption',
  585. pageSize: countPerPage,
  586. proxy: {
  587. type: 'ajax',
  588. actionMethods: {
  589. create : 'POST',
  590. read : 'POST', // by default GET
  591. update : 'POST',
  592. destroy: 'POST'
  593. },
  594. url: baseUrl+'iot/alarm/view/getLiftList',
  595. reader: {
  596. type: 'json',
  597. root: 'RESULT',
  598. totalProperty: 'totalCount'
  599. },
  600. extraParams:{
  601. queryJson:Ext.JSON.encode(queryJson)
  602. }
  603. },
  604. sorters:[{
  605. property:'time',
  606. direction:'DESC'
  607. }],
  608. remoteSort: true
  609. });
  610. myStore.on("load",function(myStore){
  611. getCurrentData();
  612. // alert(myStore.find('RESULT'));
  613. //do something
  614. });
  615. myStore.each(function(record){
  616. alert(record.get('RESULT'))
  617. });
  618. var CompanyStory = Ext.create('Ext.data.Store',{
  619. model: 'CompanyComboStore',
  620. proxy: {
  621. type: 'ajax',
  622. actionMethods: {
  623. create : 'POST',
  624. read : 'POST', // by default GET
  625. update : 'POST',
  626. destroy: 'POST'
  627. },
  628. url: baseUrl+'iot/company/view/getNameList',
  629. reader: {
  630. type: 'json',
  631. root: 'RESULT',
  632. totalProperty: 'totalCount'
  633. },
  634. extraParams:{
  635. queryJson:Ext.JSON.encode(queryJson)
  636. }
  637. }
  638. });
  639. var ClztStory = Ext.create('Ext.data.Store',{
  640. fields:['abbr','name'],
  641. data:[
  642. {'abbr':'0','name':'未处理'},
  643. {'abbr':'1','name':'已处理'}
  644. ]
  645. });
  646. var FilterForm = Ext.create('Ext.form.Panel', {
  647. id: 'VFireOptionFilterForm',
  648. labelWidth: 55,
  649. defaultType: 'textfield',
  650. bodyPadding: 15,
  651. items: [{
  652. xtype:'combo',
  653. fieldLabel:'单位名称',
  654. id: 'ff_company_code',
  655. name:'ff_company_code',
  656. displayField : 'owner_name',
  657. valueField : 'owner_id',
  658. editable : false,
  659. width:330,
  660. store:CompanyStory
  661. },{
  662. xtype:'datefield',
  663. fieldLabel:"开始日期",
  664. minValue:'07/07/2017',
  665. minText:"当前日期选择应大于当天日期",
  666. format:"Y-m-d",
  667. columnWidth:0.5,
  668. id: 'ff_start_data',
  669. name:"ff_start_data",
  670. editable:false,//只读约束
  671. width:330
  672. },{
  673. xtype:'datefield',
  674. fieldLabel:"结束日期",
  675. minValue:'07/07/2017',
  676. minText:"当前日期选择应大于当天日期",
  677. format:"Y-m-d",
  678. columnWidth:0.5,
  679. id: 'ff_end_data',
  680. name:"ff_end_data",
  681. editable:false,//只读约束
  682. width:330
  683. },{
  684. xtype:'combo',
  685. fieldLabel:'处理状态',
  686. id: 'ff_clzt',
  687. name: 'ff_clzt',
  688. displayField : 'name',
  689. valueField : 'abbr',
  690. editable : false,
  691. width:330,
  692. store:ClztStory
  693. }],
  694. buttons: [{
  695. text: '筛选',
  696. iconCls:'ok_btn',
  697. handler: function() {
  698. var form = this.up('form').getForm();
  699. if (form.isValid()) {
  700. var query = new Object();
  701. // var tmp = Ext.getCmp('ff_company_code');
  702. if(Ext.getCmp('ff_company_code').getValue()){
  703. query.company_code = Ext.getCmp('ff_company_code').getValue();
  704. $("#company_code").val(query.company_code);
  705. company_code = query.company_code;
  706. $("#LiftPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.电梯报告列表');
  707. }else{
  708. $("#company_code").val('');
  709. $("#LiftPiePanel_title_string").html('电梯报告列表');
  710. company_code = null;
  711. }
  712. if(Ext.getCmp('ff_clzt').getValue()){
  713. query.clzt = Ext.getCmp('ff_clzt').getValue();
  714. $("#clzt").val(query.clzt);
  715. }else{
  716. $("#clzt").val('');
  717. }
  718. if(Ext.getCmp('ff_start_data').getValue()){
  719. query.time_start = Ext.getCmp('ff_start_data').getValue();
  720. var datetime=query.time_start.getFullYear() + '-' + (query.time_start.getMonth() + 1) + '-' + query.time_start.getDate() + ' ' + query.time_start.getHours() + ':' + query.time_start.getMinutes() + ':' + query.time_start.getSeconds();
  721. $("#time_start").val(datetime);
  722. }else{
  723. $("#time_start").val('');
  724. }
  725. if(Ext.getCmp('ff_end_data').getValue()){
  726. query.time_end = Ext.getCmp('ff_end_data').getValue();
  727. var datetime1=query.time_end.getFullYear() + '-' + (query.time_end.getMonth() + 1) + '-' + query.time_end.getDate() + ' ' + query.time_end.getHours() + ':' + query.time_end.getMinutes() + ':' + query.time_end.getSeconds();
  728. $("#time_end").val(datetime1);
  729. }else{
  730. $("#time_end").val('');
  731. }
  732. // query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue();
  733. // query.time_start = Ext.getCmp('ff_start_data').getValue()==null?"":Ext.getCmp('ff_start_data').getValue();
  734. // query.time_end = Ext.getCmp('ff_end_data').getValue()==null?"":Ext.getCmp('ff_end_data').getValue();
  735. // query.V_LOGINNAME = V_LOGINNAME;
  736. // query.V_PASSWORD = V_PASSWORD;
  737. query.COMMSTATUS = 'NO';
  738. var jsonstr = Ext.JSON.encode(query);
  739. myStore.getProxy().extraParams = {
  740. queryJson : jsonstr
  741. };
  742. Ext.getCmp('VFireOptionListPageToolbar').moveFirst();
  743. Ext.getCmp('ff_company_code').setValue('');
  744. Ext.getCmp('ff_clzt').setValue('');
  745. Ext.getCmp('VFireOptionFilterWin').hide();
  746. // getCurrentData();
  747. }
  748. }
  749. },{
  750. text: '关闭',
  751. iconCls: 'cancel_btn',
  752. handler: function() {
  753. Ext.getCmp('VFireOptionFilterWin').hide();
  754. }
  755. }]
  756. });
  757. var filterwin = function() {
  758. Ext.create('Ext.window.Window',{
  759. id: 'VFireOptionFilterWin',
  760. title: '电梯报告筛选',
  761. height: 210,
  762. width: 400,
  763. layout: 'fit',
  764. items: FilterForm,
  765. closable:false,
  766. modal:true,
  767. closeAction: 'hide'
  768. }).show();
  769. CompanyStory.reload();
  770. }
  771. var radiogroup = new Ext.create('Ext.form.RadioGroup',{
  772. fieldLabel:'误报',
  773. id:'uf_r_clwb',
  774. width:300,
  775. items:[{
  776. name:'uf_r_clwb',
  777. inputValue:'1',
  778. boxLabel:'是'
  779. },{
  780. name:'uf_r_clwb',
  781. inputValue:'0',
  782. boxLabel:'否',
  783. checked:true
  784. }]
  785. });
  786. var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{
  787. fieldLabel:'处理范围',
  788. id:'uf_r_clfw',
  789. width:300,
  790. items:[{
  791. name:'uf_r_clfw',
  792. inputValue:'1',
  793. boxLabel:'批量'
  794. },{
  795. name:'uf_r_clfw',
  796. inputValue:'0',
  797. boxLabel:'单一',
  798. checked:true
  799. }]
  800. });
  801. var clear_modify_form = function(){
  802. Ext.getCmp('uf_company_name').setValue('');
  803. Ext.getCmp('uf_name').setValue('');
  804. Ext.getCmp('uf_device_code').setValue('');
  805. Ext.getCmp('uf_id').setValue('');
  806. Ext.getCmp('uf_status').setValue('');
  807. Ext.getCmp('uf_fullname').setValue('');
  808. Ext.getCmp('uf_data2').setValue('');
  809. Ext.getCmp('uf_data4').setValue('');
  810. Ext.getCmp('uf_clwb').setValue('');
  811. Ext.getCmp('uf_clr').setValue('');
  812. Ext.getCmp('uf_clsj').setValue('');
  813. Ext.getCmp('uf_clnr').setValue('');
  814. Ext.getCmp('uf_ncmd').setValue('');
  815. }
  816. var fireInfoForm = Ext.create('Ext.form.Panel', {
  817. id: 'fireInfoForm',
  818. labelWidth: 55,
  819. url: baseUrl+'iot/alarm/view/updateLift',
  820. defaultType: 'textfield',
  821. bodyPadding: 15,
  822. items: [{
  823. fieldLabel:'单位名称',
  824. id: 'uf_company_name',
  825. name: 'uf_company_name',
  826. anchor:'90%'
  827. },{
  828. fieldLabel:'监控设备',
  829. id:'uf_name',
  830. name:'uf_name',
  831. anchor:'100%'
  832. },{
  833. fieldLabel:'设备编号',
  834. id:'uf_device_code',
  835. name:'uf_device_code',
  836. hidden: true
  837. },{
  838. fieldLabel:'记录编号',
  839. id:'uf_id',
  840. name:'uf_id',
  841. hidden: true
  842. },{
  843. fieldLabel:'设备编号',
  844. id:'uf_status',
  845. name:'uf_status',
  846. hidden: true
  847. },
  848. //设备状态
  849. {
  850. fieldLabel:'设备状态',
  851. id:'uf_ncmd',
  852. name:'uf_ncmd',
  853. hidden: true
  854. },{
  855. fieldLabel:'设备信息',
  856. id:'uf_data4',
  857. name:'uf_data4',
  858. hidden: true
  859. },{
  860. fieldLabel:'故障信息',
  861. id:'uf_data2',
  862. name:'uf_data2',
  863. hidden: true
  864. },{
  865. fieldLabel:'报告信息',
  866. id: 'uf_fullname',
  867. name:'uf_fullname',
  868. xtype: 'textareafield',
  869. maxLength: 250,
  870. cols:4,
  871. anchor:'100%'
  872. },{
  873. fieldLabel:'误报',
  874. id: 'uf_clwb',
  875. name:'uf_clwb',
  876. maxLength: 200,
  877. anchor:'65%'
  878. },radiogroup,radiogroup2,{
  879. fieldLabel:'处理人',
  880. id: 'uf_clr',
  881. name:'uf_clr',
  882. maxLength: 120,
  883. anchor:'65%'
  884. },{
  885. fieldLabel:'处理时间',
  886. id: 'uf_clsj',
  887. name:'uf_clsj',
  888. maxLength: 200,
  889. anchor:'80%'
  890. },{
  891. fieldLabel:'处理内容',
  892. id: 'uf_clnr',
  893. name:'uf_clnr',
  894. xtype: 'textareafield',
  895. maxLength: 250,
  896. cols:4,
  897. anchor:'100%'
  898. },{
  899. id:'fm_queryJson',
  900. name:'queryJson',
  901. hidden:true
  902. }],
  903. buttons: [{
  904. text: '处理',
  905. id:'confirmBtn',
  906. iconCls:'ok_btn',
  907. handler: function() {
  908. var form = this.up('form').getForm();
  909. if (form.isValid()) {
  910. var queryJson = new Object();
  911. // queryJson.V_LOGINNAME = V_LOGINNAME;
  912. // queryJson.V_PASSWORD = V_PASSWORD;
  913. queryJson.id = Ext.getCmp('uf_id').getValue();
  914. queryJson.status = Ext.getCmp('uf_status').getValue();
  915. queryJson.name = Ext.getCmp('uf_name').getValue();
  916. queryJson.data4 = Ext.getCmp('uf_data4').getValue();
  917. queryJson.data2 = Ext.getCmp('uf_data2').getValue();
  918. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  919. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  920. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  921. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  922. queryJson.ncmd = Ext.getCmp('uf_ncmd').getValue();
  923. var jsonstr = Ext.JSON.encode(queryJson);
  924. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  925. form.submit({
  926. method:'post',
  927. success: function(form, action) {
  928. Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  929. clear_modify_form();
  930. myStore.reload();
  931. // getCurrentData();
  932. });
  933. },
  934. failure: function(form, action) {
  935. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  936. clear_modify_form();
  937. myStore.reload();
  938. // getCurrentData();
  939. });
  940. }
  941. });
  942. this.up('window').close();
  943. }
  944. }
  945. },{
  946. text: '关闭',
  947. iconCls: 'cancel_btn',
  948. handler: function() {
  949. this.up('window').close();
  950. }
  951. }]
  952. });
  953. var vFileInfoWin = Ext.create('Ext.window.Window',{
  954. id:'VFileInfoWin',
  955. title:'详细信息: <span id="VInfoWin_Title"></span>',
  956. width:400,
  957. layout:'fit',
  958. closable:false,
  959. modal:true,
  960. closeAction:'hide',
  961. items:fireInfoForm
  962. });
  963. var showFireInfoWin = function(record){
  964. vFileInfoWin.show();
  965. $("#VInfoWin_Title").html(record.get('data'));
  966. Ext.getCmp('uf_company_name').setValue(record.get('company_name'));
  967. Ext.getCmp('uf_name').setValue(record.get('name'));
  968. Ext.getCmp('uf_device_code').setValue(record.get('device_code'));
  969. Ext.getCmp('uf_fullname').setValue(record.get('fullname'));
  970. Ext.getCmp('uf_clr').setValue(record.get('clr_name'));
  971. Ext.getCmp('uf_clsj').setValue(record.get('clsj'));
  972. Ext.getCmp('uf_clnr').setValue(record.get('clnr'));
  973. Ext.getCmp('uf_id').setValue(record.get('id'));
  974. Ext.getCmp('uf_clwb').setValue(record.get('clwb')=='1'?'误报':'告警');
  975. Ext.getCmp('uf_status').setValue(record.get('status'));
  976. Ext.getCmp('uf_data4').setValue(record.get('data4'));
  977. Ext.getCmp('uf_data2').setValue(record.get('data2'));
  978. Ext.getCmp('uf_ncmd').setValue(record.get('ncmd'));
  979. if(record.get('clzt')=='已处理'){
  980. Ext.getCmp('uf_clwb').setVisible(true);
  981. Ext.getCmp('uf_r_clwb').setVisible(false);
  982. Ext.getCmp('uf_r_clfw').setVisible(false);
  983. Ext.getCmp('confirmBtn').setVisible(false);
  984. Ext.getCmp('uf_clr').setVisible(true);
  985. Ext.getCmp('uf_clsj').setVisible(true);
  986. }else{
  987. Ext.getCmp('uf_clwb').setVisible(false);
  988. Ext.getCmp('uf_r_clwb').setVisible(true);
  989. Ext.getCmp('uf_r_clfw').setVisible(true);
  990. Ext.getCmp('confirmBtn').setVisible(true);
  991. Ext.getCmp('uf_clr').setVisible(false);
  992. Ext.getCmp('uf_clsj').setVisible(false);
  993. }
  994. }
  995. var FireOptionPanel = Ext.create('Ext.grid.Panel', {
  996. // title: '电梯报告列表',
  997. header :{
  998. height:0,
  999. border:'0px solid #000000'
  1000. },
  1001. titleCollapse:true,
  1002. id: 'VFireOptionListPanel',
  1003. region:'center',
  1004. store: myStore,
  1005. // selModel: sm,
  1006. columns: [
  1007. { header: 'id', dataIndex:'id',hidden:true, menuDisabled:true},
  1008. { header: '序号', dataIndex: 'orderIdx',width:50, menuDisabled:true },
  1009. { header: '单位名称', dataIndex: 'company_name',width:240, menuDisabled:true },
  1010. { header: '报告时间', dataIndex: 'time', width:160, menuDisabled:true },
  1011. { header: '报告数据', dataIndex: 'data', width:140, menuDisabled:true },
  1012. { header: '报告内容', dataIndex: 'fullname', width:900,minWidth:400, maxWidth:1600,menuDisabled:true },
  1013. { header: '处理状态', dataIndex: 'clzt', width:100, menuDisabled:true },
  1014. { header: '处理人', dataIndex: 'clr_name',width:150, menuDisabled:true },
  1015. { header: '处理时间', dataIndex: 'clsj', width:160, menuDisabled:true }
  1016. ],
  1017. columnLines: true,
  1018. height: maxHeight,
  1019. width: '100%',
  1020. tbar: new Ext.create('Ext.toolbar.Toolbar',{
  1021. items:[{
  1022. html:'<span id="LiftPiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">电梯报告列表</span>'
  1023. },'->',{
  1024. xtype: 'button',
  1025. iconCls:'back_btn',
  1026. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
  1027. listeners: {
  1028. click: function(){
  1029. location.href=baseUrl+'view/frontpage/map.jsp?&theme='+theme+'&company_code='+company_code;
  1030. }
  1031. }
  1032. },'-',
  1033. {
  1034. xtype: 'button',
  1035. iconCls:'filter_btn',
  1036. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
  1037. listeners: {
  1038. click: filterwin
  1039. }
  1040. },'-',
  1041. {
  1042. xtype: 'button',
  1043. iconCls:'filter_btn',
  1044. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">导出</span>',
  1045. listeners: {
  1046. click: exportbtn_click
  1047. }
  1048. },'-']
  1049. }),
  1050. bbar: new Ext.PagingToolbar({
  1051. store: myStore,
  1052. id:'VFireOptionListPageToolbar',
  1053. displayInfo: true,
  1054. pageSize: countPerPage,
  1055. prependButtons: true,
  1056. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  1057. emptyMsg : "没有记录",
  1058. firstText: '第一页',
  1059. prevText: '前一页',
  1060. nextText: '后一页',
  1061. lastText: '最后一页',
  1062. refreshText: '刷新'
  1063. }),
  1064. frame: true,
  1065. border:false,
  1066. iconCls: 'icon-grid',
  1067. listeners:{
  1068. 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){
  1069. showFireInfoWin(record);
  1070. }
  1071. }
  1072. });
  1073. var piebar = Ext.create('Ext.panel.Panel',{
  1074. id:'FirePiePanel',
  1075. width:'100%',
  1076. height:498,
  1077. region:'north',
  1078. layout:'border',
  1079. defaults:{
  1080. border:false
  1081. },
  1082. html:'<div id="operation_body" class="operation_body"><div id="operation_dock_l" class="operation_dock_l"></div><div id="operation_dock_r" class="operation_dock_r"></div><img id="operation_title_icon" class="operation_title_icon" width="48" height="48" src="../../res/img/icons/5.png"/><div id="operation_title_text" class="operation_title_text">电梯监控告警处理情况</div><div id="operation_label_1" class="operation_label_1">总数</div><div id="operation_label_2" class="operation_label_2">已处理</div><div id="operation_label_3" class="operation_label_3">未处理</div><div id="operation_label_4" class="operation_label_4">处置率</div><div id="operation_num_1" class="operation_num_1"></div><div id="operation_num_2" class="operation_num_2"></div><div id="operation_num_3" class="operation_num_3"></div><div id="operation_num_4" class="operation_num_4"></div><div id="operation_pie_bg" class="operation_pie_bg"></div><div id="operation_pie" class="operation_pie"></div><div id="operation_pie_title" class="operation_pie_title">处置率</div><div id="operation_area_bg" class="operation_area_bg"></div><div id="operation_area" class="operation_area"></div></div>'
  1083. });
  1084. pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  1085. new Ext.create('Ext.panel.Panel',{
  1086. width:'100%',
  1087. id: 'RtuAlarmPanel',
  1088. layout:'border',
  1089. items:[
  1090. piebar,FireOptionPanel
  1091. ],
  1092. renderTo: Ext.getBody()
  1093. });
  1094. myStore.reload();
  1095. $(window).resize(function(){
  1096. body_resize();
  1097. });
  1098. body_resize();
  1099. });