map.js 114 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257
  1. /**
  2. * map.js
  3. */
  4. Ext.Loader.setConfig({
  5. enabled: true
  6. });
  7. Ext.Loader.setPath('Ext.ux', 'http://10.108.34.2:80/fire/res/extjs/examples/ux');
  8. Ext.require([
  9. 'Ext.grid.*',
  10. 'Ext.data.*',
  11. 'Ext.ux.RowExpander',
  12. 'Ext.selection.CheckboxModel'
  13. ]);
  14. var sm = Ext.create('Ext.selection.CheckboxModel');
  15. var myMask;
  16. var baseUrl = "";
  17. var theme = "";
  18. var mapStyle = "";
  19. var map;
  20. var mapzoom = 11;
  21. var company_cur = 0;
  22. var StatusStore = null,
  23. AlarmStore = null;
  24. var firstDraw = true;
  25. var storeTime = 60000;
  26. var centerLng = 121.475644;
  27. var currentLng = 121.475644;
  28. var centerLat = 31.1857;
  29. var currentLat = 31.1857;
  30. var rotation = 0;
  31. var alarm_show_window = null;
  32. var show_alarm_list;
  33. var show_list_cur = 0
  34. var V_LOGINNAME = '',
  35. V_PASSWORD = '';
  36. var listSync = true;
  37. var synctime = 0;
  38. var company_code = '';
  39. var start = 0;
  40. var end = 360;
  41. var targetZoom = 20;
  42. var maxHeight = 10000;
  43. var maxWidth = 10000;
  44. var SearchList = null;
  45. var markers = [];
  46. var current_company_code = "";
  47. var LabelShow = false;
  48. var MapShow = false;
  49. var last_move;
  50. var wsUri = "wss://iot.usky.cn:55120";
  51. var websocket = null;
  52. var win1_config = {
  53. title: '<table border=0><tr><td style="width:100px;overflow:hidden">火灾监控</td><td id="win1-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-12" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-11"></span></td></tr></table>',
  54. titleColor: '#ffffff',
  55. titleIconColor: '#ffffff',
  56. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  57. backgroundColor: 'rgba(23,21,57,0.2)',
  58. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  59. border: '1px solid rgba(0,123,255,0.3)',
  60. borderRadius: '10px',
  61. position: 'absolute',
  62. width: 320,
  63. height: 120,
  64. top: 100,
  65. left: 50,
  66. zIndex: 200,
  67. bodyText: '<div id="win1" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_1" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_fireAlarm()"></td></tr><tr><td id="data_label_11" class="data_bar_total_label" style="width:80px;" onclick="show_all_fireAlarm()">报告总数</td><td id="data_number_11" class="data_bar_total_number" style="width:100px;" onclick="show_all_fireAlarm()"></td></tr><tr><td id="data_label_12" class="data_bar_alarm_label" onclick="show_all_fireAlarm()">待处理</td><td id="data_number_12" class="data_bar_alarm_number" onclick="show_all_fireAlarm()"></td></tr></table></div>'
  68. }
  69. var win2_config = {
  70. title: '<table border=0><tr><td style="width:100px;overflow:hidden">电气火灾监控</td><td id="win2-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-22" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-21"></span></td></tr></table>',
  71. titleColor: '#ffffff',
  72. titleIconColor: '#ffffff',
  73. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  74. backgroundColor: 'rgba(23,21,57,0.2)',
  75. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  76. border: '1px solid rgba(0,123,255,0.3)',
  77. borderRadius: '10px',
  78. position: 'absolute',
  79. width: 320,
  80. height: 120,
  81. top: 260,
  82. left: 50,
  83. zIndex: 260,
  84. bodyText: '<div id="win2" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_2" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_efireAlarm()"></td></tr><tr><td id="data_label_21" class="data_bar_total_label" style="width:80px;" onclick="show_all_efireAlarm()">报告总数</td><td id="data_number_21" class="data_bar_total_number" style="width:100px;" onclick="show_all_efireAlarm()"></td></tr><tr><td id="data_label_22" class="data_bar_alarm_label" onclick="show_all_efireAlarm()">待处理</td><td id="data_number_22" class="data_bar_alarm_number" onclick="show_all_efireAlarm()"></td></tr></table></div>'
  85. }
  86. var win3_config = {
  87. title: '<table border=0><tr><td style="width:100px;overflow:hidden">水系统监控</td><td id="win3-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-32" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-31"></span></td></tr></table>',
  88. titleColor: '#ffffff',
  89. titleIconColor: '#ffffff',
  90. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  91. backgroundColor: 'rgba(23,21,57,0.2)',
  92. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  93. border: '1px solid rgba(0,123,255,0.3)',
  94. borderRadius: '10px',
  95. position: 'absolute',
  96. width: 320,
  97. height: 120,
  98. top: 420,
  99. left: 50,
  100. zIndex: 260,
  101. bodyText: '<div id="win3" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_3" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_waterAlarm()"></td></tr><tr><td id="data_label_31" class="data_bar_total_label" style="width:80px;" onclick="show_all_waterAlarm()">报告总数</td><td id="data_number_31" class="data_bar_total_number" style="width:100px;" onclick="show_all_waterAlarm()"></td></tr><tr><td id="data_label_32" class="data_bar_alarm_label" onclick="show_all_waterAlarm()">待处理</td><td id="data_number_32" class="data_bar_alarm_number" onclick="show_all_waterAlarm()"></td></tr></table></div>'
  102. }
  103. var win4_config = {
  104. title: '<table border=0><tr><td style="width:100px;overflow:hidden">RTU监控</td><td id="win4-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-42" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-41"></span></td></tr></table>',
  105. titleColor: '#ffffff',
  106. titleIconColor: '#ffffff',
  107. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  108. backgroundColor: 'rgba(23,21,57,0.2)',
  109. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  110. border: '1px solid rgba(0,123,255,0.3)',
  111. borderRadius: '10px',
  112. position: 'absolute',
  113. width: 320,
  114. height: 120,
  115. top: 580,
  116. left: 50,
  117. zIndex: 260,
  118. bodyText: '<div id="win4" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_4" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_rtuAlarm()"></td></tr><tr><td id="data_label_41" class="data_bar_total_label" style="width:80px;" onclick="show_all_rtuAlarm()">报告总数</td><td id="data_number_41" class="data_bar_total_number" style="width:100px;" onclick="show_all_rtuAlarm()"></td></tr><tr><td id="data_label_42" class="data_bar_alarm_label" onclick="show_all_rtuAlarm()">待处理</td><td id="data_number_42" class="data_bar_alarm_number" onclick="show_all_rtuAlarm()"></td></tr></table></div>'
  119. }
  120. var dev1_config = {
  121. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">火灾监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev1_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev1-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev1-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  122. titleColor: '#ffffff',
  123. titleIconColor: '#ffffff',
  124. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  125. backgroundColor: 'rgba(23,21,57,0.2)',
  126. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  127. border: '1px solid rgba(0,123,255,0.3)',
  128. borderRadius: '10px',
  129. position: 'absolute',
  130. width: 320,
  131. height: 100,
  132. top: 219,
  133. left: 50,
  134. zIndex: 200,
  135. floding: 'true',
  136. bodyText: '<div id="dev1" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px"><tr><td>已处理:</td><td id="device_count_num_12" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_13" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_14" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_fireDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_14" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  137. }
  138. var dev2_config = {
  139. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">电气火灾监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev2_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev2-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev2-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  140. titleColor: '#ffffff',
  141. titleIconColor: '#ffffff',
  142. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  143. backgroundColor: 'rgba(23,21,57,0.2)',
  144. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  145. border: '1px solid rgba(0,123,255,0.3)',
  146. borderRadius: '10px',
  147. position: 'absolute',
  148. width: 320,
  149. height: 100,
  150. top: 379,
  151. left: 50,
  152. zIndex: 200,
  153. floding: 'true',
  154. bodyText: '<div id="dev2" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px"><tr><td>已处理:</td><td id="device_count_num_22" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_23" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_24" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_efireDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_24" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  155. }
  156. var dev3_config = {
  157. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">水系统监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev3_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev3-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev3-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  158. titleColor: '#ffffff',
  159. titleIconColor: '#ffffff',
  160. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  161. backgroundColor: 'rgba(23,21,57,0.2)',
  162. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  163. border: '1px solid rgba(0,123,255,0.3)',
  164. borderRadius: '10px',
  165. position: 'absolute',
  166. width: 320,
  167. height: 100,
  168. top: 539,
  169. left: 50,
  170. zIndex: 200,
  171. floding: 'true',
  172. bodyText: '<div id="dev3" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px"><tr><td>已处理:</td><td id="device_count_num_32" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_33" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_34" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_waterDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_34" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  173. }
  174. var dev4_config = {
  175. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">RTU监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev4_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev4-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev4-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  176. titleColor: '#ffffff',
  177. titleIconColor: '#ffffff',
  178. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  179. backgroundColor: 'rgba(23,21,57,0.2)',
  180. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  181. border: '1px solid rgba(0,123,255,0.3)',
  182. borderRadius: '10px',
  183. position: 'absolute',
  184. width: 320,
  185. height: 100,
  186. top: 699,
  187. left: 50,
  188. zIndex: 200,
  189. floding: 'true',
  190. bodyText: '<div id="dev4" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px;"><tr><td>已处理:</td><td id="device_count_num_42" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_43" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_44" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_rtuDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_44" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  191. }
  192. var alarm_alert_config = {
  193. title: '<table border=0 style="width:320px;"><tr><td id="rt_alarm_alert_icon" style="width:24px;height:24px;"></td><td><span id="rt_alarm_alert_title" style="text-align:right;margin-left:10px;font-widght:bold;color:#31e9ff;overflow:hidden;"></span></td><td style="width:32px;color:#ffffff;cursor:pointer;text-align:left;" onclick="close_alert()"><div style="width:16px;height:16px;background-image:url(../../res/img/common/close-tmp.gif)"></div></td></tr></table>',
  194. titleColor: '#ffffff',
  195. titleIconColor: '#ffffff',
  196. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  197. backgroundColor: 'rgba(23,21,57,0.2)',
  198. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  199. border: '1px solid #31e9ff',
  200. borderRadius: '10px',
  201. position: 'absolute',
  202. width: 320,
  203. height: 120,
  204. bottom: -100,
  205. right: 95,
  206. zIndex: 990,
  207. bodyText: '<div><table border="0" style="border:0px solid #31e9ff;margin:5px;font-size:9px;color:#ffffff"><tr><td colspan=2 style="height:20px;"><div id="alarm_time" style="margin-top:3px;"></div><div id="alarm_company" style="margin-top:3px;"></div><div id="alarm_device" style="margin-top:3px;"></div></td></tr></table></div>'
  208. }
  209. var winypxy1_config = {
  210. title: '<table border=0><tr><td style="width:100px;overflow:hidden">智能烟感监控</td><td id="win1-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-12" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-11"></span></td></tr></table>',
  211. titleColor: '#ffffff',
  212. titleIconColor: '#ffffff',
  213. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  214. backgroundColor: 'rgba(23,21,57,0.2)',
  215. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  216. border: '1px solid rgba(0,123,255,0.3)',
  217. borderRadius: '10px',
  218. position: 'absolute',
  219. width: 320,
  220. height: 120,
  221. top: 60,
  222. left: 50,
  223. zIndex: 200,
  224. bodyText: '<div id="win1" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_1" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_fireAlarm()"></td></tr><tr><td id="data_label_11" class="data_bar_total_label" style="width:80px;" onclick="show_all_fireAlarm()">报告总数</td><td id="data_number_11" class="data_bar_total_number" style="width:100px;" onclick="show_all_fireAlarm()"></td></tr><tr><td id="data_label_12" class="data_bar_alarm_label" onclick="show_all_fireAlarm()">待处理</td><td id="data_number_12" class="data_bar_alarm_number" onclick="show_all_fireAlarm()"></td></tr></table></div>'
  225. }
  226. var devypxy1_config = {
  227. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">智能烟感监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev1_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev1-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev1-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  228. titleColor: '#ffffff',
  229. titleIconColor: '#ffffff',
  230. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  231. backgroundColor: 'rgba(23,21,57,0.2)',
  232. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  233. border: '1px solid rgba(0,123,255,0.3)',
  234. borderRadius: '10px',
  235. position: 'absolute',
  236. width: 320,
  237. height: 100,
  238. top: 179,
  239. left: 50,
  240. zIndex: 200,
  241. floding: 'true',
  242. bodyText: '<div id="dev1" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px"><tr><td>已处理:</td><td id="device_count_num_12" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_13" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_14" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_fireDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_14" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  243. }
  244. var winypxy2_config = {
  245. title: '<table border=0><tr><td style="width:100px;overflow:hidden">电气火灾监控</td><td id="win2-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-22" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-21"></span></td></tr></table>',
  246. titleColor: '#ffffff',
  247. titleIconColor: '#ffffff',
  248. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  249. backgroundColor: 'rgba(23,21,57,0.2)',
  250. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  251. border: '1px solid rgba(0,123,255,0.3)',
  252. borderRadius: '10px',
  253. position: 'absolute',
  254. width: 320,
  255. height: 120,
  256. top: 220,
  257. left: 50,
  258. zIndex: 260,
  259. bodyText: '<div id="win2" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_2" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_efireAlarm()"></td></tr><tr><td id="data_label_21" class="data_bar_total_label" style="width:80px;" onclick="show_all_efireAlarm()">报告总数</td><td id="data_number_21" class="data_bar_total_number" style="width:100px;" onclick="show_all_efireAlarm()"></td></tr><tr><td id="data_label_22" class="data_bar_alarm_label" onclick="show_all_efireAlarm()">待处理</td><td id="data_number_22" class="data_bar_alarm_number" onclick="show_all_efireAlarm()"></td></tr></table></div>'
  260. }
  261. var winypxy3_config = {
  262. title: '<table border=0><tr><td style="width:100px;overflow:hidden">智能水表监控</td><td id="win3-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-32" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-31"></span></td></tr></table>',
  263. titleColor: '#ffffff',
  264. titleIconColor: '#ffffff',
  265. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  266. backgroundColor: 'rgba(23,21,57,0.2)',
  267. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  268. border: '1px solid rgba(0,123,255,0.3)',
  269. borderRadius: '10px',
  270. position: 'absolute',
  271. width: 320,
  272. height: 120,
  273. top: 380,
  274. left: 50,
  275. zIndex: 260,
  276. bodyText: '<div id="win3" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_3" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_waterAlarm()"></td></tr><tr><td id="data_label_31" class="data_bar_total_label" style="width:80px;" onclick="show_all_waterAlarm()">报告总数</td><td id="data_number_31" class="data_bar_total_number" style="width:100px;" onclick="show_all_waterAlarm()"></td></tr><tr><td id="data_label_32" class="data_bar_alarm_label" onclick="show_all_waterAlarm()">待处理</td><td id="data_number_32" class="data_bar_alarm_number" onclick="show_all_waterAlarm()"></td></tr></table></div>'
  277. }
  278. var winypxy4_config = {
  279. title: '<table border=0><tr><td style="width:140px;overflow:hidden">智能消火栓监控</td><td id="win4-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-42" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-41"></span></td></tr></table>',
  280. titleColor: '#ffffff',
  281. titleIconColor: '#ffffff',
  282. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  283. backgroundColor: 'rgba(23,21,57,0.2)',
  284. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  285. border: '1px solid rgba(0,123,255,0.3)',
  286. borderRadius: '10px',
  287. position: 'absolute',
  288. width: 320,
  289. height: 120,
  290. top: 540,
  291. left: 50,
  292. zIndex: 260,
  293. bodyText: '<div id="win4" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_4" rowspan=3 style="width:110px; height:110px; margin-top:-10px;" onclick="show_all_waterAlarm()"></td></tr><tr><td id="data_label_41" class="data_bar_total_label" style="width:80px;" onclick="show_all_waterAlarm()">报告总数</td><td id="data_number_41" class="data_bar_total_number" style="width:100px;" onclick="show_all_waterAlarm()"></td></tr><tr><td id="data_label_42" class="data_bar_alarm_label" onclick="show_all_waterAlarm()">待处理</td><td id="data_number_42" class="data_bar_alarm_number" onclick="show_all_waterAlarm()"></td></tr></table></div>'
  294. }
  295. var winypxy5_config = {
  296. title: '<table border=0><tr><td style="width:140px;overflow:hidden">智能井盖监控</td><td id="win5-title-hiden" style="display:none;font-size:9px;font-weight:normal;margin-top:3px;"><span style="width:40px;text-align:right;overflow:hidden;">总数:</span><span id="title-label-52" style="color:#31e9ff;display:inline-block;width:50px;text-align:left;"></span><span style="display:inline-block;width:50px;text-align:right;">处置率:</span><span id="title-label-51"></span></td></tr></table>',
  297. titleColor: '#ffffff',
  298. titleIconColor: '#ffffff',
  299. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  300. backgroundColor: 'rgba(23,21,57,0.2)',
  301. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  302. border: '1px solid rgba(0,123,255,0.3)',
  303. borderRadius: '10px',
  304. position: 'absolute',
  305. width: 320,
  306. height: 120,
  307. top: 700,
  308. left: 50,
  309. zIndex: 260,
  310. bodyText: '<div id="win5" style="margin-top:-20px;"><table border="0" style="border:0px solid #000;"><tr><td colspan=2 style="height:20px;"></td><td id="data_pie_5" rowspan=3 style="width:110px; height:110px; margin-top:-10px;"></td></tr><tr><td id="data_label_51" class="data_bar_total_label" style="width:80px;">报告总数</td><td id="data_number_51" class="data_bar_total_number" style="width:100px;"></td></tr><tr><td id="data_label_52" class="data_bar_alarm_label">待处理</td><td id="data_number_52" class="data_bar_alarm_number"></td></tr></table></div>'
  311. }
  312. var devypxy2_config = {
  313. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">电气火灾监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev2_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev2-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev2-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  314. titleColor: '#ffffff',
  315. titleIconColor: '#ffffff',
  316. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  317. backgroundColor: 'rgba(23,21,57,0.2)',
  318. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  319. border: '1px solid rgba(0,123,255,0.3)',
  320. borderRadius: '10px',
  321. position: 'absolute',
  322. width: 320,
  323. height: 100,
  324. top: 339,
  325. left: 50,
  326. zIndex: 200,
  327. floding: 'true',
  328. bodyText: '<div id="dev2" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px"><tr><td>已处理:</td><td id="device_count_num_22" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_23" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_24" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_efireDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_24" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  329. }
  330. var devypxy3_config = {
  331. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">智能水表监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev3_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev3-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev3-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  332. titleColor: '#ffffff',
  333. titleIconColor: '#ffffff',
  334. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  335. backgroundColor: 'rgba(23,21,57,0.2)',
  336. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  337. border: '1px solid rgba(0,123,255,0.3)',
  338. borderRadius: '10px',
  339. position: 'absolute',
  340. width: 320,
  341. height: 100,
  342. top: 499,
  343. left: 50,
  344. zIndex: 200,
  345. floding: 'true',
  346. bodyText: '<div id="dev3" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px"><tr><td>已处理:</td><td id="device_count_num_32" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_33" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_34" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_waterDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_34" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  347. }
  348. var devypxy4_config = {
  349. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">智能消火栓监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev4_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev4-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev4-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  350. titleColor: '#ffffff',
  351. titleIconColor: '#ffffff',
  352. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  353. backgroundColor: 'rgba(23,21,57,0.2)',
  354. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  355. border: '1px solid rgba(0,123,255,0.3)',
  356. borderRadius: '10px',
  357. position: 'absolute',
  358. width: 320,
  359. height: 100,
  360. top: 659,
  361. left: 50,
  362. zIndex: 200,
  363. floding: 'true',
  364. bodyText: '<div id="dev4" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px;"><tr><td>已处理:</td><td id="device_count_num_42" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_43" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_44" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;" onclick="show_all_waterDevice()"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_44" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  365. }
  366. var devypxy5_config = {
  367. title: '<table><tr><td style="width:145px;overflow:hidden;font-weight:bold;">智能井盖监控设备</td><td><table border=0 style="font-weight:normal;font-size:9px;margin-top:3px;"><tr><td><div style="width:45px;text-align:right;">设备数:</div></td><td><div id="dev5_count" style="color:#31e9ff;width:30px;"></div></td><td><div id="dev5-title-hiden" style="display:none;font-size:9px;text-align:right;">待处理:</div></td><td><div id="dev5-label-hidden" style="display:none;"></div></td></tr></table></td></tr></table>',
  368. titleColor: '#ffffff',
  369. titleIconColor: '#ffffff',
  370. titleBackgroundColor: 'rgba(0,0,0,0.1)',
  371. backgroundColor: 'rgba(23,21,57,0.2)',
  372. backgroundImage: 'radial-gradient(circle, rgba(23,21,57,0.2), rgba(9,9,27,0.8))',
  373. border: '1px solid rgba(0,123,255,0.3)',
  374. borderRadius: '10px',
  375. position: 'absolute',
  376. width: 320,
  377. height: 100,
  378. top: 819,
  379. left: 50,
  380. zIndex: 200,
  381. floding: 'true',
  382. bodyText: '<div id="dev5" style="font-size:9px;font-weight:normal;"><table border="0" style="border:0px solid #000;width:300px;"><tr><td>已处理:</td><td id="device_count_num_52" class="device_confirm_num1"></td><td>待处理:</td><td id="device_count_num_53" class="device_confirm_num2"></td><td>处置率:</td><td id="device_count_num_54" class="device_confirm_num3"></td></tr><tr><td colspan=6 style="height:28px;"><div style="border:0px solid #000;border-radius:3px;width:300px;height:6px;background-color:rgba(255,255,255,0.1);"><div id="device_confirm_54" style="border:0px solid #00a7d1;margin:0px;padding:0px;border-radius:3px;height:6px;width:300px;background-color:#00a7d1"></div></div></td></tr></table></div>'
  383. }
  384. var close_alert = function() {
  385. removeDIV("rt_alarm_alert");
  386. }
  387. var initWebSocket = function() {
  388. try {
  389. if (typeof MozWebSocket == 'function')
  390. WebSocket = MozWebSocket;
  391. if (websocket && websocket.readyState == 1)
  392. websocket.close();
  393. websocket = new WebSocket(wsUri);
  394. websocket.onopen = function(evt) {
  395. var json = {};
  396. json.agentid = $("#V_LOGINNAME").val();
  397. console.log("Connected.");
  398. (function() {})()
  399. websocket.send(JSON.stringify(json));
  400. };
  401. websocket.onclose = function(evt) {
  402. console.log("DisConnected.");
  403. (function() {})()
  404. initWebSocket();
  405. };
  406. websocket.onmessage = function(evt) {
  407. console.log("Received:", evt.data);
  408. var jData = eval('(' + evt.data + ')');
  409. if (jData.dwtype != undefined) {
  410. if (document.getElementById('rt_alarm_alert') != undefined)
  411. removeDIV('rt_alarm_alert');
  412. var alarm_alert = new UNote();
  413. alarm_alert.create("rt_alarm_alert", "container", alarm_alert_config);
  414. var Icon = document.createElement('img');
  415. Icon.width = '32';
  416. Icon.height = '32';
  417. Icon.src = "../../res/img/icons/alarm_tab_04.gif"
  418. if (jData.detype == 1) {
  419. Icon.src = "../../res/img/icons/alarm_tab_01.gif"
  420. } else if (jData.dwtype == 2) {
  421. Icon.src = "../../res/img/icons/alarm_tab_03.gif"
  422. } else if (jData.dwtype == 6) {
  423. Icon.src = "../../res/img/icons/alarm_tab_04.gif"
  424. } else if (jData.dwtype == 7) {
  425. Icon.src = "../../res/img/icons/alarm_tab_02.gif"
  426. } else if (jData.dwtype == 16) {
  427. Icon.src = "../../res/img/icons/alarm_tab_05.gif"
  428. }
  429. document.getElementById("rt_alarm_alert_icon").innerHTML = "";
  430. document.getElementById("rt_alarm_alert_icon").appendChild(Icon);
  431. document.getElementById("rt_alarm_alert_title").innerHTML = jData.evtname;
  432. document.getElementById("alarm_time").innerHTML = jData.time;
  433. document.getElementById("alarm_company").innerHTML = jData.company;
  434. document.getElementById("alarm_device").innerHTML = jData.devicename;
  435. alarm_alert.show();
  436. $("#rt_alarm_alert").animate({
  437. bottom: '0px'
  438. });
  439. }
  440. };
  441. websocket.onerror = function(evt) {
  442. console.log("Error:", evt.data);
  443. (function() {})()
  444. };
  445. } catch (exception) {
  446. console.log("Exception:", exception);
  447. (function() {})()
  448. }
  449. }
  450. var toDecimal = function(x) {
  451. var f = parseFloat(x);
  452. if (isNaN(f)) {
  453. return;
  454. }
  455. f = Math.round(x * 100) / 100;
  456. return f;
  457. }
  458. var bigger_mouseover = function() {
  459. $("#map_btn_bigger").removeClass('map_btn_bigger_off');
  460. $("#map_btn_bigger").addClass('map_btn_bigger_on');
  461. }
  462. var bigger_mouseout = function() {
  463. $("#map_btn_bigger").removeClass('map_btn_bigger_on');
  464. $("#map_btn_bigger").addClass('map_btn_bigger_off');
  465. }
  466. var bigger_click = function() {
  467. map.zoomIn();
  468. }
  469. var smaller_mouseover = function() {
  470. $("#map_btn_smaller").removeClass('map_btn_smaller_off');
  471. $("#map_btn_smaller").addClass('map_btn_smaller_on');
  472. }
  473. var smaller_mouseout = function() {
  474. $("#map_btn_smaller").removeClass('map_btn_smaller_on');
  475. $("#map_btn_smaller").addClass('map_btn_smaller_off');
  476. }
  477. var smaller_click = function() {
  478. map.zoomOut();
  479. }
  480. var shower_mouseover = function() {
  481. if (!LabelShow) {
  482. $("#map_btn_showlaebl").removeClass('map_btn_showlaebl_off');
  483. $("#map_btn_showlaebl").addClass('map_btn_showlaebl_on');
  484. }
  485. }
  486. var shower_mouseout = function() {
  487. if (!LabelShow) {
  488. $("#map_btn_showlaebl").removeClass('map_btn_showlaebl_on');
  489. $("#map_btn_showlaebl").addClass('map_btn_showlaebl_off');
  490. }
  491. }
  492. var shower_click = function() {
  493. LabelShow = !LabelShow;
  494. if (LabelShow) {
  495. $("#map_btn_showlaebl").removeClass('map_btn_showlaebl_on');
  496. $("#map_btn_showlaebl").addClass('map_btn_hidelabel');
  497. $(".info").removeClass('hiden');
  498. $(".info").addClass('shown');
  499. } else {
  500. $("#map_btn_showlaebl").removeClass('map_btn_hidelabel');
  501. $("#map_btn_showlaebl").addClass('map_btn_showlaebl_on');
  502. $(".info").removeClass('shown');
  503. $(".info").addClass('hiden');
  504. }
  505. }
  506. var left_mouseover = function() {
  507. $("#map_btn_left").removeClass('map_btn_left_off');
  508. $("#map_btn_left").addClass('map_btn_left_on');
  509. }
  510. var left_mouseout = function() {
  511. $("#map_btn_left").removeClass('map_btn_left_on');
  512. $("#map_btn_left").addClass('map_btn_left_off');
  513. }
  514. var left_click = function() {
  515. rotation = map.getRotation();
  516. rotation -= 5;
  517. if (rotation < 0)
  518. rotation = 360 + rotation;
  519. map.setRotation(rotation);
  520. draw_all();
  521. }
  522. var right_mouseover = function() {
  523. $("#map_btn_right").removeClass('map_btn_right_off');
  524. $("#map_btn_right").addClass('map_btn_right_on');
  525. }
  526. var right_mouseout = function() {
  527. $("#map_btn_right").removeClass('map_btn_right_on');
  528. $("#map_btn_right").addClass('map_btn_right_off');
  529. }
  530. var right_click = function() {
  531. rotation = map.getRotation();
  532. rotation += 5;
  533. if (rotation > 360)
  534. rotation = rotation - 360;
  535. map.setRotation(rotation);
  536. draw_all();
  537. }
  538. var higher_mouseover = function() {
  539. $("#map_btn_high").removeClass('map_btn_high_off');
  540. $("#map_btn_high").addClass('map_btn_high_on');
  541. }
  542. var higher_mouseout = function() {
  543. $("#map_btn_high").removeClass('map_btn_high_on');
  544. $("#map_btn_high").addClass('map_btn_high_off');
  545. }
  546. var higher_click = function() {
  547. var pitch = map.getPitch();
  548. pitch -= 5;
  549. if (pitch < 0)
  550. pitch = 0;
  551. map.setPitch(pitch);
  552. }
  553. var lower_mouseover = function() {
  554. $("#map_btn_low").removeClass('map_btn_low_off');
  555. $("#map_btn_low").addClass('map_btn_low_on');
  556. }
  557. var lower_mouseout = function() {
  558. $("#map_btn_low").removeClass('map_btn_low_on');
  559. $("#map_btn_low").addClass('map_btn_low_off');
  560. }
  561. var lower_click = function() {
  562. var pitch = map.getPitch();
  563. pitch += 5;
  564. if (pitch > 83)
  565. pitch = 83;
  566. map.setPitch(pitch);
  567. }
  568. var clear_search = function() {
  569. SearchList = null
  570. show_list_cur = 0;
  571. $("#fp_backbtn").css("display", "none");
  572. firstDraw = true;
  573. if ($("#search_company").val().length > 0) {
  574. $("#search_company").val('');
  575. $("#company_code").val('');
  576. $("#saerch_company_list").html('');
  577. }
  578. if ((!LabelShow) && (StatusStore.length > 0)) {
  579. for (var i = 0; i < StatusStore.length; i++) {
  580. $("#label_" + StatusStore[i].company_code).css('display', 'none');
  581. }
  582. }
  583. }
  584. var update_companyList = function() {
  585. $("#saerch_company_list").html('');
  586. SearchList = null
  587. show_list_cur = 0;
  588. if ($("#search_company").val().length > 0) {
  589. var query = new Object();
  590. // query.V_LOGINNAME = V_LOGINNAME;
  591. // query.V_PASSWORD = V_PASSWORD;
  592. query.V_COMPANY_NAME = $("#search_company").val();
  593. $.ajax({
  594. type: 'POST',
  595. url: baseUrl + "/iot/company/getList",
  596. data: {
  597. queryJson: Ext.JSON.encode(query),
  598. sort: "[{property:'V_COMPANY_NAME',direction:'ASC'}]"
  599. },
  600. success: function(result) {
  601. var json = eval('(' + result + ')');
  602. if (json.action == 'getCompanyList') {
  603. var list = json.RESULT;
  604. if (list.length > 0) {
  605. SearchList = list;
  606. var saerch_company_list = document.getElementById('saerch_company_list');
  607. var table = document.createElement('table');
  608. table.border = '0';
  609. table.style.width = '300px';
  610. table.style.border = '0px solid #000';
  611. saerch_company_list.appendChild(table);
  612. for (var i = 0; i < list.length; i++) {
  613. var tr = document.createElement('tr');
  614. tr.style.border = '0px solid #000';
  615. table.appendChild(tr);
  616. var td = document.createElement('td');
  617. td.id = 'company_code_list_' + list[i].V_COMPANY_CODE;
  618. td.company_code = list[i].V_COMPANY_CODE;
  619. td.style.border = '1px solid rgba(255,255,255,0.0)';
  620. td.style.background = 'rgba(255,255,255,0.3)';
  621. td.style.fontSize = '14px';
  622. td.style.cursor = "pointer";
  623. td.innerHTML = list[i].V_COMPANY_NAME;
  624. tr.appendChild(td);
  625. $("#company_code_list_" + list[i].V_COMPANY_CODE).mouseover(function() {
  626. $(this).css({ "border": "1px solid rgba(64,85,98,0.7)", "background": "rgba(64,85,98,0.7)", "color": "#ffff00", "cursor": "pointer", "font-size": "14px" });
  627. $("#label_" + this.company_code).css('display', 'block');
  628. show_list_cur = i + 1;
  629. });
  630. $("#company_code_list_" + list[i].V_COMPANY_CODE).mouseout(function() {
  631. $(this).css({ "border": "1px solid rgba(255,255,255,0.0)", "background": "rgba(255,255,255,0.3)", "color": "#ffffff", "cursor": "pointer", "font-size": "14px" });
  632. if (!LabelShow)
  633. $("#label_" + this.company_code).css('display', 'none');
  634. });
  635. $("#company_code_list_" + list[i].V_COMPANY_CODE).click(function(e) {
  636. showBuilding(this.company_code);
  637. });
  638. }
  639. }
  640. }
  641. }
  642. });
  643. }
  644. }
  645. var key_fun = function(event) {
  646. var x = (navigator.appname == "Netscape") ? event.which : window.event.keyCode;
  647. if (x == 38) {
  648. if (SearchList != null) {
  649. if ((show_list_cur > 0) && (show_list_cur <= SearchList.length)) {
  650. show_list_cur--;
  651. for (var i = 0; i < SearchList.length; i++) {
  652. $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(255,255,255,0.0)", "background": "rgba(255,255,255,0.3)", "color": "#ffffff", "cursor": "pointer", "font-size": "14px" });
  653. var div = document.getElementById("label_" + SearchList[i].V_COMPANY_CODE);
  654. if (!LabelShow) {
  655. if (div != undefined)
  656. div.style.display = 'none';
  657. }
  658. if (i == (show_list_cur - 1)) {
  659. $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(64,85,98,0.7)", "background": "rgba(64,85,98,0.7)", "color": "#ffff00", "cursor": "pointer", "font-size": "14px" });
  660. if (div != undefined)
  661. div.style.display = 'block';
  662. }
  663. }
  664. }
  665. }
  666. } else if (x == 40) {
  667. if (SearchList != null) {
  668. if ((show_list_cur >= 0) && (show_list_cur < SearchList.length)) {
  669. show_list_cur++;
  670. for (var i = 0; i < SearchList.length; i++) {
  671. $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(255,255,255,0.0)", "background": "rgba(255,255,255,0.3)", "color": "#ffffff", "cursor": "pointer", "font-size": "14px" });
  672. var div = document.getElementById("label_" + SearchList[i].V_COMPANY_CODE);
  673. if (!LabelShow) {
  674. if (div != undefined)
  675. div.style.display = 'none';
  676. }
  677. if (i == (show_list_cur - 1)) {
  678. $("#company_code_list_" + SearchList[i].V_COMPANY_CODE).css({ "border": "1px solid rgba(64,85,98,0.7)", "background": "rgba(64,85,98,0.7)", "color": "#ffff00", "cursor": "pointer", "font-size": "14px" });
  679. if (div != undefined)
  680. div.style.display = 'block';
  681. }
  682. }
  683. }
  684. }
  685. } else if (x == 13) {
  686. if (SearchList != null) {
  687. if ((show_list_cur >= 0) && (show_list_cur <= SearchList.length)) {
  688. showBuilding(SearchList[show_list_cur - 1].V_COMPANY_CODE);
  689. }
  690. }
  691. } else if (x == 27) {
  692. clear_search();
  693. }
  694. }
  695. var chk_lat = function(lat) {
  696. if (lat < 30)
  697. return false;
  698. if (lat > 32)
  699. return false;
  700. return true;
  701. }
  702. var chk_lng = function(lng) {
  703. if (lng < 110)
  704. return false;
  705. if (lng > 135)
  706. return false;
  707. return true;
  708. }
  709. var showBuilding = function(company_code) {
  710. if ((StatusStore != null) && (StatusStore.length > 0)) {
  711. for (var i = 0; i < StatusStore.length; i++) {
  712. if (StatusStore[i].company_code == company_code) {
  713. map.setCenter(new AMap.LngLat(StatusStore[i].lng, StatusStore[i].lat, true));
  714. map.setPitch(83);
  715. map.setZoom(18);
  716. $("#data_number_11").html(StatusStore[i].d1a);
  717. $("#data_number_12").html(StatusStore[i].d1a - StatusStore[i].d1ac);
  718. $("#data_number_21").html(StatusStore[i].d7a);
  719. $("#data_number_22").html(StatusStore[i].d7a - StatusStore[i].d7ac);
  720. $("#data_number_31").html(StatusStore[i].d2a);
  721. $("#data_number_32").html(StatusStore[i].d2a - StatusStore[i].d2ac);
  722. if (V_LOGINNAME == 'ypxy') {
  723. var query = new Object();
  724. // query.V_LOGINNAME = V_LOGINNAME;
  725. // query.V_PASSWORD = V_PASSWORD;
  726. query.dwtype = '2';
  727. query.COMMSTATUS = 'NO';
  728. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  729. query.company_code = company_code;
  730. $.ajax({
  731. type: 'POST',
  732. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  733. data: {
  734. queryJson: Ext.JSON.encode(query)
  735. },
  736. success: function(result) {
  737. var json = eval('(' + result + ')');
  738. if (json.action == 'getConfirmStatusByDays') {
  739. if (json.check == 'true') {
  740. ConfirmStore = json.RESULT;
  741. if (json.company_name != null)
  742. companyName = json.company_name;
  743. else
  744. companyName = null;
  745. for (var i = 0; i < ConfirmStore.length; i++) {
  746. if (ConfirmStore[i].id == 'water_alarm') {
  747. $("#data_number_41").html(ConfirmStore[i].count);
  748. $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  749. draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
  750. // $("#device_count_num_41").html(StatusStore[i].d6);
  751. $("#device_count_num_42").html(ConfirmStore[i].count);
  752. $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  753. if (ConfirmStore[i].count == 0)
  754. $("#device_count_num_44").html('100%');
  755. else
  756. $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
  757. if (ConfirmStore[i].count != 0)
  758. $("#device_confirm_44").css('width', (280 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
  759. else
  760. $("#device_confirm_44").css('width', '280px');
  761. $("#data_number_51").html(0);
  762. $("#data_number_52").html(0);
  763. draw_pie('data_pie_5', 0, 0);
  764. $("#device_count_num_52").html(0);
  765. $("#device_count_num_53").html(0);
  766. $("#device_count_num_54").html('100%');
  767. $("#device_confirm_54").css('width', '280px');
  768. }
  769. }
  770. } else {
  771. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  772. window.parent.document.location = baseUrl;
  773. });
  774. }
  775. }
  776. }
  777. });
  778. } else {
  779. $("#data_number_41").html(StatusStore[i].d6a);
  780. $("#data_number_42").html(StatusStore[i].d6a - StatusStore[i].d6ac);
  781. draw_pie('data_pie_4', StatusStore[i].d6a, StatusStore[i].d6ac);
  782. $("#device_count_num_41").html(StatusStore[i].d6);
  783. $("#device_count_num_42").html(StatusStore[i].d6oc);
  784. $("#device_count_num_43").html(StatusStore[i].d6o - StatusStore[i].d6oc);
  785. if (StatusStore[i].d6o == 0)
  786. $("#device_count_num_44").html('100%');
  787. else
  788. $("#device_count_num_44").html(toDecimal(StatusStore[i].d6oc * 100 / StatusStore[i].d6o) + '%');
  789. if (StatusStore[i].d6o != 0)
  790. $("#device_confirm_44").css('width', (280 * StatusStore[i].d6oc / StatusStore[i].d6o) + 'px');
  791. else
  792. $("#device_confirm_44").css('width', '280px');
  793. }
  794. draw_pie('data_pie_1', StatusStore[i].d1a, StatusStore[i].d1ac);
  795. draw_pie('data_pie_2', StatusStore[i].d7a, StatusStore[i].d7ac);
  796. draw_pie('data_pie_3', StatusStore[i].d2a, StatusStore[i].d2ac);
  797. $("#device_count_num_11").html(StatusStore[i].d1);
  798. $("#device_count_num_12").html(StatusStore[i].d1oc);
  799. $("#device_count_num_13").html(StatusStore[i].d1o - StatusStore[i].d1oc);
  800. if (StatusStore[i].d1o == 0)
  801. $("#device_count_num_14").html('100%');
  802. else
  803. $("#device_count_num_14").html(toDecimal(StatusStore[i].d1oc * 100 / StatusStore[i].d1o) + '%');
  804. $("#device_count_num_21").html(StatusStore[i].d7);
  805. $("#device_count_num_22").html(StatusStore[i].d7oc);
  806. $("#device_count_num_23").html(StatusStore[i].d7o - StatusStore[i].d7oc);
  807. if (StatusStore[i].d7o == 0)
  808. $("#device_count_num_24").html('100%');
  809. else
  810. $("#device_count_num_24").html(toDecimal(StatusStore[i].d7oc * 100 / StatusStore[i].d7o) + '%');
  811. $("#device_count_num_31").html(StatusStore[i].d2);
  812. $("#device_count_num_32").html(StatusStore[i].d2oc);
  813. $("#device_count_num_33").html(StatusStore[i].d2o - StatusStore[i].d2oc);
  814. if (StatusStore[i].d2o == 0)
  815. $("#device_count_num_34").html('100%');
  816. else
  817. $("#device_count_num_34").html(toDecimal(StatusStore[i].d2oc * 100 / StatusStore[i].d2o) + '%');
  818. if (StatusStore[i].d1o != 0) {
  819. $("#device_confirm_14").css('width', (280 * StatusStore[i].d1oc / StatusStore[i].d1o) + 'px');
  820. } else
  821. $("#device_confirm_14").css('width', '280px');
  822. if (StatusStore[i].d7o != 0)
  823. $("#device_confirm_24").css('width', (280 * StatusStore[i].d7oc / StatusStore[i].d7o) + 'px');
  824. else
  825. $("#device_confirm_24").css('width', '280px');
  826. if (StatusStore[i].d2o != 0)
  827. $("#device_confirm_34").css('width', (280 * StatusStore[i].d2oc / StatusStore[i].d2o) + 'px');
  828. else
  829. $("#device_confirm_34").css('width', '280px');
  830. $("#label_" + company_code).css('display', 'block');
  831. break;
  832. }
  833. }
  834. }
  835. }
  836. var clear_detail_info = function() {
  837. var d0 = 0,
  838. d0o = 0,
  839. d0oc = 0,
  840. d0a = 0,
  841. d0ac = 0;
  842. var d1 = 0,
  843. d1o = 0,
  844. d1oc = 0,
  845. d1a = 0,
  846. d1ac = 0;
  847. var d2 = 0,
  848. d2o = 0,
  849. d2oc = 0,
  850. d2a = 0,
  851. d2ac = 0;
  852. var d6 = 0,
  853. d6o = 0,
  854. d6oc = 0,
  855. d6a = 0,
  856. d6ac = 0;
  857. var d7 = 0,
  858. d7o = 0,
  859. d7oc = 0,
  860. d7a = 0,
  861. d7ac = 0;
  862. var detail_info = document.getElementById('detail_info');
  863. var parent = document.getElementById('container');
  864. if (detail_info != undefined) {
  865. parent.removeChild(detail_info);
  866. current_company_code = "";
  867. for (var i = 0; i < StatusStore.length; i++) {
  868. var obj = StatusStore[i];
  869. d1 += obj.d1;
  870. d1o += obj.d1o;
  871. d1a += obj.d1a;
  872. d1oc += obj.d1oc;
  873. d1ac += obj.d1ac;
  874. d2 += obj.d2;
  875. d2o += obj.d2o;
  876. d2a += obj.d2a;
  877. d2oc += obj.d2oc;
  878. d2ac += obj.d2ac;
  879. d6 += obj.d6;
  880. d6o += obj.d6o;
  881. d6a += obj.d6a;
  882. d6oc += obj.d6oc;
  883. d6ac += obj.d6ac;
  884. d7 += obj.d7;
  885. d7o += obj.d7o;
  886. d7a += obj.d7a;
  887. d7oc += obj.d7oc;
  888. d7ac += obj.d7ac;
  889. }
  890. $("#data_number_11").html(d1a);
  891. $("#data_number_12").html(d1a - d1ac);
  892. $("#data_number_21").html(d7a);
  893. $("#data_number_22").html(d7a - d7ac);
  894. $("#data_number_31").html(d2a);
  895. $("#data_number_32").html(d2a - d2ac);
  896. if (V_LOGINNAME == 'ypxy') {
  897. var query = new Object();
  898. // query.V_LOGINNAME = V_LOGINNAME;
  899. // query.V_PASSWORD = V_PASSWORD;
  900. query.dwtype = '2';
  901. query.COMMSTATUS = 'NO';
  902. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  903. query.company_code = company_code;
  904. $.ajax({
  905. type: 'POST',
  906. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  907. data: {
  908. queryJson: Ext.JSON.encode(query)
  909. },
  910. success: function(result) {
  911. var json = eval('(' + result + ')');
  912. if (json.action == 'getConfirmStatusByDays') {
  913. if (json.check == 'true') {
  914. ConfirmStore = json.RESULT;
  915. if (json.company_name != null)
  916. companyName = json.company_name;
  917. else
  918. companyName = null;
  919. for (var i = 0; i < ConfirmStore.length; i++) {
  920. if (ConfirmStore[i].id == 'water_alarm') {
  921. $("#data_number_41").html(ConfirmStore[i].count);
  922. $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  923. draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
  924. // $("#device_count_num_41").html(StatusStore[i].d6);
  925. $("#device_count_num_42").html(ConfirmStore[i].count);
  926. $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  927. if (ConfirmStore[i].count == 0)
  928. $("#device_count_num_44").html('100%');
  929. else
  930. $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
  931. if (ConfirmStore[i].count != 0)
  932. $("#device_confirm_44").css('width', (280 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
  933. else
  934. $("#device_confirm_44").css('width', '280px');
  935. $("#data_number_51").html(0);
  936. $("#data_number_52").html(0);
  937. draw_pie('data_pie_5', 0, 0);
  938. $("#device_count_num_52").html(0);
  939. $("#device_count_num_53").html(0);
  940. $("#device_count_num_54").html('100%');
  941. $("#device_confirm_54").css('width', '280px');
  942. }
  943. }
  944. } else {
  945. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  946. window.parent.document.location = baseUrl;
  947. });
  948. }
  949. }
  950. }
  951. });
  952. } else {
  953. $("#data_number_41").html(d6a);
  954. $("#data_number_42").html(d6a - d6ac);
  955. draw_pie('data_pie_4', d6a, d6ac);
  956. $("#device_count_num_41").html(d6);
  957. $("#device_count_num_42").html(d6oc);
  958. $("#device_count_num_43").html(d6o - d6oc);
  959. if (d6o == 0)
  960. $("#device_count_num_44").html('100%');
  961. else
  962. $("#device_count_num_44").html(toDecimal(d6oc * 100 / d6o) + '%');
  963. if (d6o != 0)
  964. $("#device_confirm_44").css('width', (280 * d6oc / d6o) + 'px');
  965. else
  966. $("#device_confirm_44").css('width', '280px');
  967. }
  968. draw_pie('data_pie_1', d1a, d1ac);
  969. draw_pie('data_pie_2', d7a, d7ac);
  970. draw_pie('data_pie_3', d2a, d2ac);
  971. $("#device_count_num_11").html(d1);
  972. $("#device_count_num_12").html(d1oc);
  973. $("#device_count_num_13").html(d1o - d1oc);
  974. if (d1o == 0)
  975. $("#device_count_num_14").html('100%');
  976. else
  977. $("#device_count_num_14").html(toDecimal(d1oc * 100 / d1o) + '%');
  978. $("#device_count_num_21").html(d7);
  979. $("#device_count_num_22").html(d7oc);
  980. $("#device_count_num_23").html(d7o - d7oc);
  981. if (d7o == 0)
  982. $("#device_count_num_24").html('100%');
  983. else
  984. $("#device_count_num_24").html(toDecimal(d7oc * 100 / d7o) + '%');
  985. $("#device_count_num_31").html(d2);
  986. $("#device_count_num_32").html(d2oc);
  987. $("#device_count_num_33").html(d2o - d2oc);
  988. if (d2o == 0)
  989. $("#device_count_num_34").html('100%');
  990. else
  991. $("#device_count_num_34").html(toDecimal(d2oc * 100 / d2o) + '%');
  992. if (d1o != 0) {
  993. $("#device_confirm_14").css('width', (280 * d1oc / d1o) + 'px');
  994. } else
  995. $("#device_confirm_14").css('width', '280px');
  996. if (d7o != 0)
  997. $("#device_confirm_24").css('width', (280 * d7oc / d7o) + 'px');
  998. else
  999. $("#device_confirm_24").css('width', '280px');
  1000. if (d2o != 0)
  1001. $("#device_confirm_34").css('width', (280 * d2oc / d2o) + 'px');
  1002. else
  1003. $("#device_confirm_34").css('width', '280px');
  1004. $(".alarm_tab_area").remove();
  1005. if ((AlarmStore != null) && (AlarmStore.length > 0)) {
  1006. var parent = document.getElementById('container');
  1007. AlarmStore.sort(alarmSortByTime);
  1008. var area = document.createElement('div');
  1009. area.id = 'alarm_tab_area';
  1010. area.setAttribute('class', 'alarm_tab_area');
  1011. parent.appendChild(area);
  1012. for (var i = 0; i < AlarmStore.length; i++) {
  1013. if (i >= 6)
  1014. break;
  1015. var tab = document.createElement('div');
  1016. tab.id = 'alarm_tab_' + (i + 1);
  1017. tab.setAttribute('class', 'alarm_tab');
  1018. tab.setAttribute('onclick', (AlarmStore[i].dwtype == 1) ? 'show_all_fireAlarm()' :
  1019. (AlarmStore[i].dwtype == 2) ? 'show_all_waterAlarm()' :
  1020. (AlarmStore[i].dwtype == 5) ? 'show_all_waterAlarm()' :
  1021. (AlarmStore[i].dwtype == 6) ? 'show_all_rtuAlarm()' :
  1022. (AlarmStore[i].dwtype == 7) ? 'show_all_efireAlarm()' : '#');
  1023. tab.style.top = (120 * i) + 'px';
  1024. if (($(document).innerHeight() - 205) > (120 * (i + 1)))
  1025. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1026. else
  1027. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1028. area.appendChild(tab);
  1029. var title = document.createElement('div');
  1030. title.id = 'alarm_tab_title_' + (i + 1);
  1031. title.setAttribute('class', 'alarm_tab_title');
  1032. title.innerHTML = (AlarmStore[i].dwtype == 1) ? '火警监测报告' :
  1033. (AlarmStore[i].dwtype == 2) ? '水系统监测报告' :
  1034. (AlarmStore[i].dwtype == 5) ? '水系统监测报告' :
  1035. (AlarmStore[i].dwtype == 6) ? 'RTU监测报告' :
  1036. (AlarmStore[i].dwtype == 7) ? '电气火灾监测报告' : '其他报告';
  1037. tab.appendChild(title);
  1038. var time_label = document.createElement('div');
  1039. time_label.id = 'alarm_tab_time_' + (i + 1);
  1040. time_label.setAttribute('class', 'alarm_tab_time');
  1041. time_label.innerHTML = AlarmStore[i].time;
  1042. tab.appendChild(time_label);
  1043. var data = document.createElement('div');
  1044. data.id = "alarm_tab_data_" + (i + 1);
  1045. data.setAttribute('class', 'alarm_tab_data');
  1046. data.innerHTML = AlarmStore[i].company_name + ' ' + AlarmStore[i].data;
  1047. tab.appendChild(data);
  1048. var icon = document.createElement('img');
  1049. icon.setAttribute('class', 'alarm_tab_icon');
  1050. icon.height = '66';
  1051. icon.width = '66';
  1052. icon.src = baseUrl + 'res/img/icons/' + ((AlarmStore[i].dwtype == 1) ? 'alarm_tab_01.gif' :
  1053. (AlarmStore[i].dwtype == 2) ? 'alarm_tab_03.gif' :
  1054. (AlarmStore[i].dwtype == 5) ? 'alarm_tab_03.gif' :
  1055. (AlarmStore[i].dwtype == 6) ? 'alarm_tab_04.gif' :
  1056. (AlarmStore[i].dwtype == 7) ? 'alarm_tab_02.gif' : 'alarm_tab_04.gif');
  1057. // var icon = document.createElement('div');
  1058. // icon.id = "alarm_tab_icon_"+(i+1);
  1059. // icon.setAttribute('class',(AlarmStore[i].dwtype==1)?'alarm_tab_icon alarm_icon_01':
  1060. // (AlarmStore[i].dwtype==2)?'alarm_tab_icon alarm_icon_03':
  1061. // (AlarmStore[i].dwtype==5)?'alarm_tab_icon alarm_icon_03':
  1062. // (AlarmStore[i].dwtype==6)?'alarm_tab_icon alarm_icon_04':
  1063. // (AlarmStore[i].dwtype==7)?'alarm_tab_icon alarm_icon_02':'alarm_tab_icon alarm_icon_04');
  1064. tab.appendChild(icon);
  1065. }
  1066. }
  1067. }
  1068. }
  1069. var showInfo = function(e) {
  1070. var pixel = e.pixel;
  1071. var company_code = e.target.getExtData().company_code;
  1072. var detail_info;
  1073. var parent = document.getElementById('container')
  1074. for (var i = 0; i < StatusStore.length; i++) {
  1075. if (StatusStore[i].company_code == company_code) {
  1076. if (current_company_code == company_code)
  1077. return;
  1078. clear_detail_info();
  1079. current_company_code = company_code;
  1080. var qobj = new Object();
  1081. qobj.V_LOGINNAME = $("#V_LOGINNAME").val();qobj.V_PASSWORD = $("#V_PASSWORD").val();
  1082. qobj.V_COMPANYID = company_code;
  1083. qobj.I_COMMAND = 4;
  1084. var qdata = "queryJson=" + JSON.stringify(qobj);
  1085. // var qurl = 'https://aiot.usky.cn:8443/YtIoT/cgi-bin/WebAction2.cgi';
  1086. var qurl = 'https://fire.usky.cn:8443/YtIoT/cgi-bin/WebAction.cgi';
  1087. $.ajax({
  1088. type: 'POST',
  1089. url: qurl,
  1090. data: qdata,
  1091. success: function(result) {
  1092. var json = eval('(' + result + ')');
  1093. if (json.action == 'getAlarmList') {
  1094. $(".alarm_tab_area").remove();
  1095. if ((json.ALARM == undefined) || (json.ALARM.length == 0))
  1096. return;
  1097. var parent = document.getElementById('container');
  1098. json.ALARM.sort(alarmSortByTime);
  1099. var area = document.createElement('div');
  1100. area.id = 'alarm_tab_area';
  1101. area.setAttribute('class', 'alarm_tab_area');
  1102. parent.appendChild(area);
  1103. for (var i = 0; i < json.ALARM.length; i++) {
  1104. if (i >= 6)
  1105. break;
  1106. var tab = document.createElement('div');
  1107. tab.id = 'alarm_tab_' + (i + 1);
  1108. tab.setAttribute('class', 'alarm_tab');
  1109. tab.setAttribute('onclick', (json.ALARM[i].dwtype == 1) ? 'show_all_fireAlarm()' :
  1110. (AlarmStore[i].dwtype == 2) ? 'show_all_waterAlarm()' :
  1111. (AlarmStore[i].dwtype == 5) ? 'show_all_waterAlarm()' :
  1112. (AlarmStore[i].dwtype == 6) ? 'show_all_rtuAlarm()' :
  1113. (AlarmStore[i].dwtype == 7) ? 'show_all_efireAlarm()' : '#');
  1114. tab.style.top = (120 * i) + 'px';
  1115. if (($(document).innerHeight() - 205) > (120 * (i + 1)))
  1116. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1117. else
  1118. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1119. area.appendChild(tab);
  1120. var title = document.createElement('div');
  1121. title.id = 'alarm_tab_title_' + (i + 1);
  1122. title.setAttribute('class', 'alarm_tab_title');
  1123. title.innerHTML = (json.ALARM[i].dwtype == 1) ? '火警监测报告' :
  1124. (json.ALARM[i].dwtype == 2) ? '水系统监测报告' :
  1125. (json.ALARM[i].dwtype == 5) ? '水系统监测报告' :
  1126. (json.ALARM[i].dwtype == 6) ? 'RTU监测报告' :
  1127. (json.ALARM[i].dwtype == 7) ? '电气火灾监测报告' : '其他报告';
  1128. tab.appendChild(title);
  1129. var time_label = document.createElement('div');
  1130. time_label.id = 'alarm_tab_time_' + (i + 1);
  1131. time_label.setAttribute('class', 'alarm_tab_time');
  1132. time_label.innerHTML = json.ALARM[i].time;
  1133. tab.appendChild(time_label);
  1134. var data = document.createElement('div');
  1135. data.id = "alarm_tab_data_" + (i + 1);
  1136. data.setAttribute('class', 'alarm_tab_data');
  1137. data.innerHTML = json.ALARM[i].company_name + ' ' + json.ALARM[i].data;
  1138. tab.appendChild(data);
  1139. var icon = document.createElement('img');
  1140. icon.setAttribute('class', 'alarm_tab_icon');
  1141. icon.height = '66';
  1142. icon.width = '66';
  1143. icon.src = baseUrl + 'res/img/icons/' + ((json.ALARM[i].dwtype == 1) ? 'alarm_tab_01.gif' :
  1144. (json.ALARM[i].dwtype == 2) ? 'alarm_tab_03.gif' :
  1145. (json.ALARM[i].dwtype == 5) ? 'alarm_tab_03.gif' :
  1146. (json.ALARM[i].dwtype == 6) ? 'alarm_tab_04.gif' :
  1147. (json.ALARM[i].dwtype == 7) ? 'alarm_tab_02.gif' : 'alarm_tab_04.gif');
  1148. tab.appendChild(icon);
  1149. }
  1150. }
  1151. }
  1152. });
  1153. detail_info = document.createElement('div');
  1154. detail_info.id = 'detail_info';
  1155. detail_info.style.position = 'absolute';
  1156. detail_info.style.top = (pixel.getY() - 270) + 'px';
  1157. detail_info.style.left = (pixel.getX() - 101) + 'px';
  1158. detail_info.style.width = '203px';
  1159. detail_info.style.height = '270px';
  1160. detail_info.style.backgroundImage = 'url(../../res/img/icons/detail_info.png)';
  1161. detail_info.style.zIndex = '500';
  1162. detail_info.onmouseleave = clear_detail_info;
  1163. parent.appendChild(detail_info);
  1164. var info_title = document.createElement('div');
  1165. info_title.id = 'info_title';
  1166. info_title.setAttribute('class', 'info_title');
  1167. info_title.innerHTML = '<div style="display:inline-block;vertical-align:middle;align-self:center;">' + StatusStore[i].company_name + '</div>';
  1168. detail_info.appendChild(info_title);
  1169. var info_body0 = document.createElement('div');
  1170. info_body0.id = 'info_body0';
  1171. info_body0.setAttribute('class', 'info_body0');
  1172. info_body0.innerHTML = '地址:' + StatusStore[i].address;
  1173. detail_info.appendChild(info_body0);
  1174. var info_body1 = document.createElement('div');
  1175. info_body1.id = 'info_body1';
  1176. info_body1.setAttribute('class', 'info_body1');
  1177. info_body1.innerHTML = '联系人:' + StatusStore[i].username;
  1178. detail_info.appendChild(info_body1);
  1179. var info_body2 = document.createElement('div');
  1180. info_body2.id = 'info_body2';
  1181. info_body2.setAttribute('class', 'info_body2');
  1182. info_body2.innerHTML = '联系电话:' + StatusStore[i].phone;
  1183. detail_info.appendChild(info_body2);
  1184. var info_btn = document.createElement('div');
  1185. info_btn.id = 'info_btn';
  1186. info_btn.setAttribute('class', 'info_btn');
  1187. info_btn.innerHTML = '查看详情';
  1188. info_btn.company_code = company_code;
  1189. info_btn.onclick = function(e) {
  1190. var event = e;
  1191. location.href = baseUrl + 'view/frontpage/company.jsp?company_code=' + event.currentTarget.company_code;
  1192. }
  1193. detail_info.appendChild(info_btn);
  1194. // var info_btn1 = document.createElement('div');
  1195. // info_btn1.id = 'info_btn1';
  1196. // info_btn1.setAttribute('class','info_btn');
  1197. // info_btn1.innerHTML='历史数据';
  1198. // info_btn1.company_code=company_code;
  1199. // info_btn1.onclick=function(e){
  1200. // var event = e;
  1201. // location.href = baseUrl+'view/frontpage/company.jsp?company_code='+event.currentTarget.company_code;
  1202. // }
  1203. // detail_info.appendChild(info_btn1);
  1204. $("#data_number_11").html(StatusStore[i].d1a);
  1205. $("#data_number_12").html(StatusStore[i].d1a - StatusStore[i].d1ac);
  1206. $("#data_number_21").html(StatusStore[i].d7a);
  1207. $("#data_number_22").html(StatusStore[i].d7a - StatusStore[i].d7ac);
  1208. $("#data_number_31").html(StatusStore[i].d2a);
  1209. $("#data_number_32").html(StatusStore[i].d2a - StatusStore[i].d2ac);
  1210. if (V_LOGINNAME == 'ypxy') {
  1211. var query = new Object();
  1212. // query.V_LOGINNAME = V_LOGINNAME;
  1213. // query.V_PASSWORD = V_PASSWORD;
  1214. query.dwtype = '2';
  1215. query.COMMSTATUS = 'NO';
  1216. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  1217. query.company_code = company_code;
  1218. $.ajax({
  1219. type: 'POST',
  1220. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  1221. data: {
  1222. queryJson: Ext.JSON.encode(query)
  1223. },
  1224. success: function(result) {
  1225. var json = eval('(' + result + ')');
  1226. if (json.action == 'getConfirmStatusByDays') {
  1227. if (json.check == 'true') {
  1228. ConfirmStore = json.RESULT;
  1229. if (json.company_name != null)
  1230. companyName = json.company_name;
  1231. else
  1232. companyName = null;
  1233. for (var i = 0; i < ConfirmStore.length; i++) {
  1234. if (ConfirmStore[i].id == 'water_alarm') {
  1235. $("#data_number_41").html(ConfirmStore[i].count);
  1236. $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1237. draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
  1238. $("#dev4_count").html(3);
  1239. $("#device_count_num_42").html(ConfirmStore[i].sum);
  1240. $("#dev4-label-hidden").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1241. $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1242. if (ConfirmStore[i].count == 0)
  1243. $("#device_count_num_44").html('100%');
  1244. else
  1245. $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
  1246. if (ConfirmStore[i].count != 0)
  1247. $("#device_confirm_44").css('width', (300 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
  1248. else
  1249. $("#device_confirm_44").css('width', '300px');
  1250. $("#data_number_51").html(0);
  1251. $("#data_number_52").html(0);
  1252. draw_pie('data_pie_5', 0, 0);
  1253. $("#dev5_count").html(3);
  1254. $("#device_count_num_52").html(0);
  1255. $("#dev5-label-hidden").html(0);
  1256. $("#device_count_num_53").html(0);
  1257. $("#device_count_num_54").html('100%');
  1258. $("#device_confirm_54").css('width', '300px');
  1259. }
  1260. }
  1261. } else {
  1262. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1263. window.parent.document.location = baseUrl;
  1264. });
  1265. }
  1266. }
  1267. }
  1268. });
  1269. } else {
  1270. $("#data_number_41").html(StatusStore[i].d6a);
  1271. $("#data_number_42").html(StatusStore[i].d6a - StatusStore[i].d6ac);
  1272. draw_pie('data_pie_4', StatusStore[i].d6a, StatusStore[i].d6ac);
  1273. $("#dev4_count").html(StatusStore[i].d6);
  1274. $("#device_count_num_42").html(StatusStore[i].d6oc);
  1275. $("#dev4-label-hidden").html(StatusStore[i].d6o - StatusStore[i].d6oc);
  1276. $("#device_count_num_43").html(StatusStore[i].d6o - StatusStore[i].d6oc);
  1277. if (StatusStore[i].d6o == 0)
  1278. $("#device_count_num_44").html('100%');
  1279. else
  1280. $("#device_count_num_44").html(toDecimal(StatusStore[i].d6oc * 100 / StatusStore[i].d6o) + '%');
  1281. if (StatusStore[i].d6o != 0)
  1282. $("#device_confirm_44").css('width', (300 * StatusStore[i].d6oc / StatusStore[i].d6o) + 'px');
  1283. else
  1284. $("#device_confirm_44").css('width', '300px');
  1285. }
  1286. draw_pie('data_pie_1', StatusStore[i].d1a, StatusStore[i].d1ac);
  1287. draw_pie('data_pie_2', StatusStore[i].d7a, StatusStore[i].d7ac);
  1288. draw_pie('data_pie_3', StatusStore[i].d2a, StatusStore[i].d2ac);
  1289. $("#dev1_count").html(StatusStore[i].d1);
  1290. $("#device_count_num_12").html(StatusStore[i].d1oc);
  1291. $("#dev1-label-hidden").html(StatusStore[i].d1o - StatusStore[i].d1oc);
  1292. $("#device_count_num_13").html(StatusStore[i].d1o - StatusStore[i].d1oc);
  1293. if (StatusStore[i].d1o == 0)
  1294. $("#device_count_num_14").html('100%');
  1295. else
  1296. $("#device_count_num_14").html(toDecimal(StatusStore[i].d1oc * 100 / StatusStore[i].d1o) + '%');
  1297. $("#dev2_count").html(StatusStore[i].d7);
  1298. $("#device_count_num_22").html(StatusStore[i].d7oc);
  1299. $("#dev2-label-hidden").html(StatusStore[i].d7o - StatusStore[i].d7oc);
  1300. $("#device_count_num_23").html(StatusStore[i].d7o - StatusStore[i].d7oc);
  1301. if (StatusStore[i].d7o == 0)
  1302. $("#device_count_num_24").html('100%');
  1303. else
  1304. $("#device_count_num_24").html(toDecimal(StatusStore[i].d7oc * 100 / StatusStore[i].d7o) + '%');
  1305. $("#dev3_count").html(StatusStore[i].d2);
  1306. $("#device_count_num_32").html(StatusStore[i].d2oc);
  1307. $("#dev3-label-hidden").html(StatusStore[i].d2o - StatusStore[i].d2oc);
  1308. $("#device_count_num_33").html(StatusStore[i].d2o - StatusStore[i].d2oc);
  1309. if (StatusStore[i].d2o == 0)
  1310. $("#device_count_num_34").html('100%');
  1311. else
  1312. $("#device_count_num_34").html(toDecimal(StatusStore[i].d2oc * 100 / StatusStore[i].d2o) + '%');
  1313. if (StatusStore[i].d1o != 0) {
  1314. $("#device_confirm_14").css('width', (300 * StatusStore[i].d1oc / StatusStore[i].d1o) + 'px');
  1315. } else
  1316. $("#device_confirm_14").css('width', '300px');
  1317. if (StatusStore[i].d7o != 0)
  1318. $("#device_confirm_24").css('width', (300 * StatusStore[i].d7oc / StatusStore[i].d7o) + 'px');
  1319. else
  1320. $("#device_confirm_24").css('width', '300px');
  1321. if (StatusStore[i].d2o != 0)
  1322. $("#device_confirm_34").css('width', (300 * StatusStore[i].d2oc / StatusStore[i].d2o) + 'px');
  1323. else
  1324. $("#device_confirm_34").css('width', '300px');
  1325. $(".alarm_tab_area").remove();
  1326. // if((AlarmStore!=null)&&(AlarmStore.length>0)){
  1327. // var parent = document.getElementById('container');
  1328. // AlarmStore.sort(alarmSortByTime);
  1329. // var area = document.createElement('div');
  1330. // area.id= 'alarm_tab_area';
  1331. // area.setAttribute('class','alarm_tab_area');
  1332. // parent.appendChild(area);
  1333. // for(var i=0;i<AlarmStore.length;i++){
  1334. // if(i>=6)
  1335. // break;
  1336. // var tab = document.createElement('div');
  1337. // tab.id = 'alarm_tab_'+(i+1);
  1338. // tab.setAttribute('class','alarm_tab');
  1339. // tab.setAttribute('onclick',(AlarmStore[i].dwtype==1)?'show_all_fireAlarm()':
  1340. // (AlarmStore[i].dwtype==2)?'show_all_waterAlarm()':
  1341. // (AlarmStore[i].dwtype==5)?'show_all_waterAlarm()':
  1342. // (AlarmStore[i].dwtype==6)?'show_all_rtuAlarm()':
  1343. // (AlarmStore[i].dwtype==7)?'show_all_efireAlarm()':'#');
  1344. // tab.style.top=(120*i)+'px';
  1345. // if(($(document).innerHeight()-205)>(120*(i+1)))
  1346. // $('#alarm_tab_area').css('height',($(document).innerHeight()-205)+'px');
  1347. // else
  1348. // $('#alarm_tab_area').css('height',($(document).innerHeight()-205)+'px');
  1349. // area.appendChild(tab);
  1350. // var title = document.createElement('div');
  1351. // title.id = 'alarm_tab_title_'+(i+1);
  1352. // title.setAttribute('class','alarm_tab_title');
  1353. // title.innerHTML=(AlarmStore[i].dwtype==1)?'火警监测报告':
  1354. // (AlarmStore[i].dwtype==2)?'水系统监测报告':
  1355. // (AlarmStore[i].dwtype==5)?'水系统监测报告':
  1356. // (AlarmStore[i].dwtype==6)?'RTU监测报告':
  1357. // (AlarmStore[i].dwtype==7)?'电气火灾监测报告':'其他报告';
  1358. // tab.appendChild(title);
  1359. // var time_label = document.createElement('div');
  1360. // time_label.id = 'alarm_tab_time_'+(i+1);
  1361. // time_label.setAttribute('class','alarm_tab_time');
  1362. // time_label.innerHTML=AlarmStore[i].time;
  1363. // tab.appendChild(time_label);
  1364. // var data = document.createElement('div');
  1365. // data.id = "alarm_tab_data_"+(i+1);
  1366. // data.setAttribute('class','alarm_tab_data');
  1367. // data.innerHTML=AlarmStore[i].company_name+' '+AlarmStore[i].data;
  1368. // tab.appendChild(data);
  1369. // var icon = document.createElement('img');
  1370. // icon.setAttribute('class','alarm_tab_icon');
  1371. // icon.height = '66';
  1372. // icon.width = '66';
  1373. // icon.src = baseUrl+'res/img/icons/'+((AlarmStore[i].dwtype==1)?'alarm_tab_01.gif'
  1374. // :(AlarmStore[i].dwtype==2)?'alarm_tab_03.gif'
  1375. // :(AlarmStore[i].dwtype==5)?'alarm_tab_03.gif'
  1376. // :(AlarmStore[i].dwtype==6)?'alarm_tab_04.gif'
  1377. // :(AlarmStore[i].dwtype==7)?'alarm_tab_02.gif':'alarm_tab_04.gif')+'?t='+(new Date());
  1378. // tab.appendChild(icon);
  1379. // }
  1380. // }
  1381. break;
  1382. }
  1383. }
  1384. }
  1385. var markerSortByRotation = function(a, b) {
  1386. if ((rotation <= 45) || (rotation >= 315))
  1387. return b.lat - a.lat;
  1388. else if ((rotation > 45) && (rotation <= 135))
  1389. return a.lng - b.lng;
  1390. else if ((rotation > 135) && (rotation <= 270))
  1391. return a.lat - b.lat;
  1392. else
  1393. return b.lng - a.lng;
  1394. }
  1395. var alarmSortByTime = function(a, b) {
  1396. var time_a = Date.parse(a.time);
  1397. var time_b = Date.parse(b.time);
  1398. return time_b - time_a;
  1399. }
  1400. var draw_pie = function(id, total, num) {
  1401. var mColor = '#34abf5';
  1402. var percent = 100;
  1403. if (total > 0)
  1404. percent = Number(((num * 100) / total).toString().match(/^\d+(?:\.\d{0,2})?/));
  1405. if (percent < 60)
  1406. mColor = '#f66167';
  1407. else if (percent < 80)
  1408. mColor = '#DDDF0D';
  1409. if (id == 'data_pie_1') {
  1410. $("#title-label-11").css({
  1411. color: mColor
  1412. }).html(percent + '%');
  1413. $("#title-label-12").html(total);
  1414. } else if (id == 'data_pie_2') {
  1415. $("#title-label-21").css({
  1416. color: mColor
  1417. }).html(percent + '%');
  1418. $("#title-label-22").html(total);
  1419. } else if (id == 'data_pie_3') {
  1420. $("#title-label-31").css({
  1421. color: mColor
  1422. }).html(percent + '%');
  1423. $("#title-label-32").html(total);
  1424. } else if (id == 'data_pie_4') {
  1425. $("#title-label-41").css({
  1426. color: mColor
  1427. }).html(percent + '%');
  1428. $("#title-label-42").html(total);
  1429. }
  1430. Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5', '#DDDF0D'], function(color) {
  1431. return {
  1432. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  1433. stops: [
  1434. [0, color],
  1435. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  1436. ]
  1437. };
  1438. });
  1439. Highcharts.chart(id, {
  1440. chart: {
  1441. type: 'pie',
  1442. backgroundColor: 'rgba(0,0,0,0)',
  1443. height: '100%',
  1444. options3d: {
  1445. enabled: true,
  1446. alpha: 45,
  1447. beta: 0
  1448. }
  1449. },
  1450. title: {
  1451. text: '处置率:' + percent + '%',
  1452. floating: true,
  1453. y: 85,
  1454. style: { fontSize: '12px', color: '#ffffff' }
  1455. },
  1456. exporting: {
  1457. enabled: false
  1458. },
  1459. credits: {
  1460. enabled: false
  1461. },
  1462. tooltip: {
  1463. // enabled: false
  1464. pointFormat: '{point.percentage:.2f}%'
  1465. },
  1466. plotOptions: {
  1467. pie: {
  1468. allowPointSelect: true,
  1469. cursor: 'pointer',
  1470. depth: 15,
  1471. dataLabels: {
  1472. enabled: false,
  1473. format: '{point.name}'
  1474. }
  1475. }
  1476. },
  1477. series: [{
  1478. type: 'pie',
  1479. name: '处置率',
  1480. startAngle: 90,
  1481. data: [{
  1482. name: '待处理',
  1483. y: 100 - percent,
  1484. sliced: true,
  1485. selected: true
  1486. },
  1487. ['已处理', percent]
  1488. ]
  1489. }]
  1490. });
  1491. }
  1492. var draw_all = function() {
  1493. if (company_cur > 0)
  1494. return;
  1495. var d0 = 0,
  1496. d0o = 0,
  1497. d0oc = 0,
  1498. d0a = 0,
  1499. d0ac = 0;
  1500. var d1 = 0,
  1501. d1o = 0,
  1502. d1oc = 0,
  1503. d1a = 0,
  1504. d1ac = 0;
  1505. var d2 = 0,
  1506. d2o = 0,
  1507. d2oc = 0,
  1508. d2a = 0,
  1509. d2ac = 0;
  1510. var d6 = 0,
  1511. d6o = 0,
  1512. d6oc = 0,
  1513. d6a = 0,
  1514. d6ac = 0;
  1515. var d7 = 0,
  1516. d7o = 0,
  1517. d7oc = 0,
  1518. d7a = 0,
  1519. d7ac = 0;
  1520. var totalLat = 0,
  1521. totalLng = 0,
  1522. latngCount = 0;
  1523. // map.clearMap();
  1524. clear_detail_info();
  1525. markers = [];
  1526. var zoom = map.getZoom();
  1527. var iconWidth = 28;
  1528. var iconHeight = 28;
  1529. if ((StatusStore != null) && (StatusStore.length > 0)) {
  1530. rotation = map.getRotation();
  1531. StatusStore.sort(markerSortByRotation);
  1532. for (var i = 0; i < StatusStore.length; i++) {
  1533. var obj = StatusStore[i];
  1534. var iconurl = baseUrl + 'res/img/icons/building.png';
  1535. if ((obj.d0a != obj.d0ac) ||
  1536. (obj.d0o != obj.d0oc) ||
  1537. (obj.d1a != obj.d1ac) ||
  1538. (obj.d1o != obj.d1oc) ||
  1539. (obj.d2a != obj.d2ac) ||
  1540. (obj.d2o != obj.d2oc) ||
  1541. (obj.d6a != obj.d6ac) ||
  1542. (obj.d6o != obj.d6oc) ||
  1543. (obj.d7a != obj.d7ac) ||
  1544. (obj.d7o != obj.d7oc))
  1545. iconurl = baseUrl + 'res/img/icons/building_alarm.png';
  1546. d1 += obj.d1;
  1547. d1o += obj.d1o;
  1548. d1a += obj.d1a;
  1549. d1oc += obj.d1oc;
  1550. d1ac += obj.d1ac;
  1551. d2 += obj.d2;
  1552. d2o += obj.d2o;
  1553. d2a += obj.d2a;
  1554. d2oc += obj.d2oc;
  1555. d2ac += obj.d2ac;
  1556. d6 += obj.d6;
  1557. d6o += obj.d6o;
  1558. d6a += obj.d6a;
  1559. d6oc += obj.d6oc;
  1560. d6ac += obj.d6ac;
  1561. d7 += obj.d7;
  1562. d7o += obj.d7o;
  1563. d7a += obj.d7a;
  1564. d7oc += obj.d7oc;
  1565. d7ac += obj.d7ac;
  1566. if ((obj.lat > 30) && (obj.lat < 33) && (obj.lng > 100) && (obj.lng < 125)) {
  1567. totalLng += obj.lng;
  1568. totalLat += obj.lat;
  1569. latngCount++;
  1570. var marker = new AMap.Marker({
  1571. icon: new AMap.Icon({
  1572. size: new AMap.Size(iconWidth, iconHeight),
  1573. image: iconurl,
  1574. imageSize: new AMap.Size(iconWidth, iconHeight)
  1575. }),
  1576. position: new AMap.LngLat(obj.lng, obj.lat),
  1577. extData: {
  1578. icontype: 'company',
  1579. company_code: obj.company_code
  1580. },
  1581. offset: new AMap.Pixel(-(iconWidth / 2), -(iconHeight / 2)),
  1582. draggable: false,
  1583. raiseOnDrag: false,
  1584. autoRotation: false,
  1585. label: {
  1586. offset: new AMap.Pixel(-iconWidth - 5, -(iconHeight / 2) - 10),
  1587. content: "<div id='label_" + obj.company_code + "' class='info " + (LabelShow ? 'shown' : 'hiden') + "'>" + obj.company_name + "</div>",
  1588. direction: 'right'
  1589. }
  1590. });
  1591. AMap.event.addListener(marker, 'click', showBuilding, this);
  1592. AMap.event.addListener(marker, 'mouseover', showInfo, this);
  1593. if (!MapShow) {
  1594. marker.setMap(map);
  1595. markers.push(marker);
  1596. }
  1597. }
  1598. }
  1599. var sts = [{
  1600. url: baseUrl + 'res/img/icons/icon_juhe_grade1.png',
  1601. size: new AMap.Size(40, 40),
  1602. offset: new AMap.Pixel(-16, -16)
  1603. }, {
  1604. url: baseUrl + 'res/img/icons/icon_juhe_grade2.png',
  1605. size: new AMap.Size(40, 40),
  1606. offset: new AMap.Pixel(-16, -16)
  1607. }, {
  1608. url: baseUrl + 'res/img/icons/icon_juhe_grade3.png',
  1609. size: new AMap.Size(40, 40),
  1610. offset: new AMap.Pixel(-18, -18)
  1611. }];
  1612. if (!MapShow) {
  1613. MapShow = true;
  1614. // map.plugin(["AMap.MarkerClusterer"],function(){
  1615. // cluster = new AMap.MarkerClusterer(map, markers, {
  1616. // styles: sts,
  1617. // gridSize: 80,
  1618. // maxZoom:14
  1619. //// minClusterSize:3
  1620. //// renderClusterMarker:_renderClusterMarker
  1621. // });
  1622. // });
  1623. }
  1624. if ((latngCount > 0) && (firstDraw)) {
  1625. map.setCenter(new AMap.LngLat(totalLng / latngCount, totalLat / latngCount, true));
  1626. map.setFitView();
  1627. firstDraw = false;
  1628. }
  1629. $("#data_number_11").html(d1a);
  1630. $("#data_number_12").html(d1a - d1ac);
  1631. $("#data_number_21").html(d7a);
  1632. $("#data_number_22").html(d7a - d7ac);
  1633. $("#data_number_31").html(d2a);
  1634. $("#data_number_32").html(d2a - d2ac);
  1635. $("#data_number_31").html(d2a);
  1636. $("#data_number_32").html(d2a - d2ac);
  1637. draw_pie('data_pie_1', d1a, d1ac);
  1638. draw_pie('data_pie_2', d7a, d7ac);
  1639. draw_pie('data_pie_3', d2a, d2ac);
  1640. if (V_LOGINNAME == 'ypxy') {
  1641. var query = new Object();
  1642. // query.V_LOGINNAME = V_LOGINNAME;
  1643. // query.V_PASSWORD = V_PASSWORD;
  1644. query.dwtype = '2';
  1645. query.COMMSTATUS = 'NO';
  1646. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  1647. query.company_code = company_code;
  1648. $.ajax({
  1649. type: 'POST',
  1650. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  1651. data: {
  1652. queryJson: Ext.JSON.encode(query)
  1653. },
  1654. success: function(result) {
  1655. var json = eval('(' + result + ')');
  1656. if (json.action == 'getConfirmStatusByDays') {
  1657. if (json.check == 'true') {
  1658. ConfirmStore = json.RESULT;
  1659. if (json.company_name != null)
  1660. companyName = json.company_name;
  1661. else
  1662. companyName = null;
  1663. for (var i = 0; i < ConfirmStore.length; i++) {
  1664. if (ConfirmStore[i].id == 'water_alarm') {
  1665. $("#data_number_41").html(ConfirmStore[i].count);
  1666. $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1667. draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
  1668. $("#dev4_count").html(6);
  1669. $("#device_count_num_42").html(ConfirmStore[i].sum);
  1670. $("#dev4-label-hidden").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1671. $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1672. if (ConfirmStore[i].count == 0)
  1673. $("#device_count_num_44").html('100%');
  1674. else
  1675. $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
  1676. if (ConfirmStore[i].count != 0)
  1677. $("#device_confirm_44").css('width', (300 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
  1678. else
  1679. $("#device_confirm_44").css('width', '300px');
  1680. $("#data_number_51").html(0);
  1681. $("#data_number_52").html(0);
  1682. draw_pie('data_pie_5', 0, 0);
  1683. $("#dev5_count").html(6);
  1684. $("#device_count_num_52").html(0);
  1685. $("#dev5-label-hidden").html(0);
  1686. $("#device_count_num_53").html(0);
  1687. $("#device_count_num_54").html('100%');
  1688. $("#device_confirm_54").css('width', '300px');
  1689. }
  1690. }
  1691. } else {
  1692. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1693. window.parent.document.location = baseUrl;
  1694. });
  1695. }
  1696. }
  1697. }
  1698. });
  1699. } else {
  1700. $("#data_number_41").html(d6a);
  1701. $("#data_number_42").html(d6a - d6ac);
  1702. draw_pie('data_pie_4', d6a, d6ac);
  1703. $("#dev4_count").html(d6);
  1704. $("#device_count_num_42").html(d6oc);
  1705. $("#dev4-label-hidden").html(d6o - d6oc);
  1706. $("#device_count_num_43").html(d6o - d6oc);
  1707. if (d6o == 0)
  1708. $("#device_count_num_44").html('100%');
  1709. else
  1710. $("#device_count_num_44").html(toDecimal(d6oc * 100 / d6o) + '%');
  1711. if (d6o != 0)
  1712. $("#device_confirm_44").css('width', (300 * d6oc / d6o) + 'px');
  1713. else
  1714. $("#device_confirm_44").css('width', '300px');
  1715. }
  1716. $("#dev1_count").html(d1);
  1717. $("#device_count_num_12").html(d1oc);
  1718. $("#dev1-label-hidden").html(d1o - d1oc);
  1719. $("#device_count_num_13").html(d1o - d1oc);
  1720. if (d1o == 0)
  1721. $("#device_count_num_14").html('100%');
  1722. else
  1723. $("#device_count_num_14").html(toDecimal(d1oc * 100 / d1o) + '%');
  1724. $("#dev2_count").html(d7);
  1725. $("#device_count_num_22").html(d7oc);
  1726. $("#dev2-label-hidden").html(d7o - d7oc);
  1727. $("#device_count_num_23").html(d7o - d7oc);
  1728. if (d7o == 0)
  1729. $("#device_count_num_24").html('100%');
  1730. else
  1731. $("#device_count_num_24").html(toDecimal(d7oc * 100 / d7o) + '%');
  1732. $("#dev3_count").html(d2);
  1733. $("#device_count_num_32").html(d2oc);
  1734. $("#dev3-label-hidden").html(d2o - d2oc);
  1735. $("#device_count_num_33").html(d2o - d2oc);
  1736. if (d2o == 0)
  1737. $("#device_count_num_34").html('100%');
  1738. else
  1739. $("#device_count_num_34").html(toDecimal(d2oc * 100 / d2o) + '%');
  1740. if (d1o != 0) {
  1741. $("#device_confirm_14").css('width', (300 * d1oc / d1o) + 'px');
  1742. } else
  1743. $("#device_confirm_14").css('width', '300px');
  1744. if (d7o != 0)
  1745. $("#device_confirm_24").css('width', (300 * d7oc / d7o) + 'px');
  1746. else
  1747. $("#device_confirm_24").css('width', '300px');
  1748. if (d2o != 0)
  1749. $("#device_confirm_34").css('width', (300 * d2oc / d2o) + 'px');
  1750. else
  1751. $("#device_confirm_34").css('width', '300px');
  1752. }
  1753. $(".alarm_tab_area").remove();
  1754. if ((AlarmStore != null) && (AlarmStore.length > 0)) {
  1755. var parent = document.getElementById('container');
  1756. AlarmStore.sort(alarmSortByTime);
  1757. var area = document.createElement('div');
  1758. area.id = 'alarm_tab_area';
  1759. area.setAttribute('class', 'alarm_tab_area');
  1760. parent.appendChild(area);
  1761. for (var i = 0; i < AlarmStore.length; i++) {
  1762. if (i >= 6)
  1763. break;
  1764. var tab = document.createElement('div');
  1765. tab.id = 'alarm_tab_' + (i + 1);
  1766. tab.setAttribute('class', 'alarm_tab');
  1767. tab.setAttribute('onclick', (AlarmStore[i].dwtype == 1) ? 'show_all_fireAlarm()' :
  1768. (AlarmStore[i].dwtype == 2) ? 'show_all_waterAlarm()' :
  1769. (AlarmStore[i].dwtype == 5) ? 'show_all_waterAlarm()' :
  1770. (AlarmStore[i].dwtype == 6) ? 'show_all_rtuAlarm()' :
  1771. (AlarmStore[i].dwtype == 7) ? 'show_all_efireAlarm()' : '#');
  1772. tab.style.top = (120 * i) + 'px';
  1773. if (($(document).innerHeight() - 205) > (120 * (i + 1)))
  1774. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1775. else
  1776. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1777. area.appendChild(tab);
  1778. var title = document.createElement('div');
  1779. title.id = 'alarm_tab_title_' + (i + 1);
  1780. title.setAttribute('class', 'alarm_tab_title');
  1781. title.innerHTML = (AlarmStore[i].dwtype == 1) ? '火警监测报告' :
  1782. (AlarmStore[i].dwtype == 2) ? '水系统监测报告' :
  1783. (AlarmStore[i].dwtype == 5) ? '水系统监测报告' :
  1784. (AlarmStore[i].dwtype == 6) ? 'RTU监测报告' :
  1785. (AlarmStore[i].dwtype == 7) ? '电气火灾监测报告' : '其他报告';
  1786. tab.appendChild(title);
  1787. var time_label = document.createElement('div');
  1788. time_label.id = 'alarm_tab_time_' + (i + 1);
  1789. time_label.setAttribute('class', 'alarm_tab_time');
  1790. time_label.innerHTML = AlarmStore[i].time;
  1791. tab.appendChild(time_label);
  1792. var data = document.createElement('div');
  1793. data.id = "alarm_tab_data_" + (i + 1);
  1794. data.setAttribute('class', 'alarm_tab_data');
  1795. data.innerHTML = AlarmStore[i].company_name + ' ' + AlarmStore[i].data;
  1796. tab.appendChild(data);
  1797. var icon = document.createElement('img');
  1798. icon.setAttribute('class', 'alarm_tab_icon');
  1799. icon.height = '66';
  1800. icon.width = '66';
  1801. icon.src = baseUrl + 'res/img/icons/' + ((AlarmStore[i].dwtype == 1) ? 'alarm_tab_01.gif' :
  1802. (AlarmStore[i].dwtype == 2) ? 'alarm_tab_03.gif' :
  1803. (AlarmStore[i].dwtype == 5) ? 'alarm_tab_03.gif' :
  1804. (AlarmStore[i].dwtype == 6) ? 'alarm_tab_04.gif' :
  1805. (AlarmStore[i].dwtype == 7) ? 'alarm_tab_02.gif' : 'alarm_tab_04.gif') + '?t=' + (new Date());
  1806. tab.appendChild(icon);
  1807. }
  1808. }
  1809. }
  1810. var getCurrentData = function() {
  1811. if (((new Date()).getTime() - synctime) < storeTime)
  1812. return;
  1813. $("#fp_backbtn").css("display", "none");
  1814. synctime = (new Date()).getTime();
  1815. var query = new Object();
  1816. query.V_LOGINNAME = V_LOGINNAME;
  1817. query.V_PASSWORD = V_PASSWORD;
  1818. query.V_COMMAND = 'FRONTPAGE';
  1819. query.COMMSTATUS = "NO";
  1820. if ($("#company_code").val().length > 0)
  1821. query.company_code = $("#company_code").val();
  1822. var qdata = JSON.stringify(query);
  1823. var qurl = baseUrl + '/cgi-bin/WebAction.cgi';
  1824. // if ((baseUrl.indexOf('localhost') >= 0) || (baseUrl.indexOf('127.0.0.1') >= 0))
  1825. qurl = 'https://fire.usky.cn:8443/YtIoT/cgi-bin/WebAction.cgi';
  1826. $.ajax({
  1827. type: 'POST',
  1828. url: qurl,
  1829. data: qdata,
  1830. success: function(result) {
  1831. if ((result == undefined) || (result.length == 0)) {
  1832. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1833. window.parent.document.location = baseUrl;
  1834. });
  1835. } else {
  1836. var json = eval('(' + result + ')');
  1837. if (json.check == 'false') {
  1838. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1839. window.parent.document.location = baseUrl;
  1840. });
  1841. }
  1842. if (json.action == 'getFrontpageQuery') {
  1843. if (json.check == 'true') {
  1844. if (json.LIST != undefined)
  1845. StatusStore = json.LIST;
  1846. if (json.ALARM != undefined)
  1847. AlarmStore = json.ALARM;
  1848. draw_all();
  1849. }
  1850. }
  1851. }
  1852. myMask.hide();
  1853. }
  1854. });
  1855. setTimeout(getCurrentData, storeTime);
  1856. }
  1857. var chk_company_cur = function(idx) {
  1858. var nrow = 0;
  1859. while (1) {
  1860. idx++;
  1861. if (idx >= StatusStore.length)
  1862. idx = 0;
  1863. var obj = StatusStore[idx];
  1864. if ((obj.lat > 30) && (obj.lat < 33) && (obj.lng > 100) && (obj.lng < 125))
  1865. return idx;
  1866. nrow++;
  1867. if (nrow >= StatusStore.length)
  1868. return -1;
  1869. }
  1870. }
  1871. var show_cur_comany = function() {
  1872. var current_t = Date.parse(new Date());
  1873. if ((current_t - last_move) > 30000) {
  1874. last_move = current_t;
  1875. if ((StatusStore != null) && (StatusStore.length > 0)) {
  1876. company_cur = chk_company_cur(company_cur);
  1877. if (company_cur >= 0) {
  1878. var obj = StatusStore[company_cur];
  1879. showBuilding(obj.company_code);
  1880. LabelShow = false;
  1881. shower_click();
  1882. }
  1883. }
  1884. }
  1885. setTimeout(show_cur_comany, 5000);
  1886. }
  1887. var body_resize = function() {
  1888. $("#mask_l").css('height', $(window).innerHeight() + 'px');
  1889. $("#mask_r").css('height', $(window).innerHeight() + 'px');
  1890. $("#mask_b").css('top', ($(window).innerHeight() - 100) + 'px');
  1891. $("#mask_b").css('width', $(window).innerWidth() + 'px');
  1892. $("#mask_t").css('width', $(window).innerWidth() + 'px');
  1893. $("#map_header").css('left', ($(window).innerWidth() - 740) / 2 + 'px');
  1894. $("#map_header").css('height', '82px');
  1895. $("#container").css('width', $(window).innerWidth() + 'px');
  1896. $("#container").css('height', $(window).innerHeight() + 'px');
  1897. var area_height = $(window).innerHeight() - 129;
  1898. $("#data_bar_area").css('height', area_height + 'px');
  1899. $("#alarm_tab_area").css('height', ($(window).innerHeight() - 205) + 'px');
  1900. draw_all();
  1901. }
  1902. var show_all_fireAlarm = function() {
  1903. if ($("#V_LOGINNAME").val() == 'guest')
  1904. return;
  1905. parent.window.keep_menu();
  1906. if ($("#company_code").val() != undefined)
  1907. location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1908. else
  1909. location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme=' + theme;
  1910. }
  1911. var show_all_waterAlarm = function() {
  1912. if ($("#V_LOGINNAME").val() == 'guest')
  1913. return;
  1914. parent.window.keep_menu();
  1915. if ($("#company_code").val() != undefined)
  1916. location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1917. else
  1918. location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme=' + theme;
  1919. }
  1920. var show_all_rtuAlarm = function() {
  1921. if ($("#V_LOGINNAME").val() == 'guest')
  1922. return;
  1923. parent.window.keep_menu();
  1924. if ($("#company_code").val() != undefined)
  1925. location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1926. else
  1927. location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme=' + theme;
  1928. }
  1929. var show_all_efireAlarm = function() {
  1930. if ($("#V_LOGINNAME").val() == 'guest')
  1931. return;
  1932. parent.window.keep_menu();
  1933. if ($("#company_code").val() != undefined)
  1934. location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1935. else
  1936. location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme=' + theme;
  1937. }
  1938. var show_all_fireDevice = function() {
  1939. if ($("#V_LOGINNAME").val() == 'guest')
  1940. return;
  1941. parent.window.keep_menu();
  1942. if ($("#company_code").val() != undefined)
  1943. location.href = baseUrl + 'view/fireAlarm/FireDeviceIndex.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1944. else
  1945. location.href = baseUrl + 'view/fireAlarm/FireDeviceIndex.jsp?theme=' + theme;
  1946. }
  1947. var show_all_efireDevice = function() {
  1948. if ($("#V_LOGINNAME").val() == 'guest')
  1949. return;
  1950. parent.window.keep_menu();
  1951. if ($("#company_code").val() != undefined)
  1952. location.href = baseUrl + 'view/efireAlarm/eFireDeviceIndex.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1953. else
  1954. location.href = baseUrl + 'view/efireAlarm/eFireDeviceIndex.jsp?theme=' + theme;
  1955. }
  1956. var show_all_waterDevice = function() {
  1957. if ($("#V_LOGINNAME").val() == 'guest')
  1958. return;
  1959. parent.window.keep_menu();
  1960. if ($("#company_code").val() != undefined)
  1961. location.href = baseUrl + 'view/waterAlarm/WaterDeviceIndex.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1962. else
  1963. location.href = baseUrl + 'view/waterAlarm/WaterDeviceIndex.jsp?theme=' + theme;
  1964. }
  1965. var show_all_rtuDevice = function() {
  1966. if ($("#V_LOGINNAME").val() == 'guest')
  1967. return;
  1968. parent.window.keep_menu();
  1969. if ($("#company_code").val() != undefined)
  1970. location.href = baseUrl + 'view/rtuAlarm/RtuDeviceIndex.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1971. else
  1972. location.href = baseUrl + 'view/rtuAlarm/RtuDeviceIndex.jsp?theme=' + theme;
  1973. }
  1974. Ext.onReady(function() {
  1975. parent.window.hiding_menu();
  1976. maxHeight = document.documentElement.clientHeight;
  1977. maxWidth = document.documentElement.clientWidth;
  1978. if (($("#V_LOGINNAME").val().length == 0) || ($("#V_LOGINNAME").val() == 'null') || ($("#V_LOGINNAME").val() == null))
  1979. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  1980. else
  1981. sessionStorage.setItem('V_LOGINNAME', $("#V_LOGINNAME").val());
  1982. if (($("#V_PASSWORD").val().length == 0) || ($("#V_PASSWORD").val() == 'null') || ($("#V_PASSWORD").val() == null))
  1983. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  1984. else
  1985. sessionStorage.setItem('V_PASSWORD', $("#V_PASSWORD").val());
  1986. baseUrl = $("#basePath").val();
  1987. theme = $("#theme").val();
  1988. V_LOGINNAME = $("#V_LOGINNAME").val();
  1989. V_PASSWORD = $("#V_PASSWORD").val();
  1990. viewAlarmType = $("#viewAlarmType").val();
  1991. pieAlarmType = $("#pieAlarmType").val();
  1992. statusType = $("#statusType").val();
  1993. company_code = $("#company_code").val();
  1994. mapStyle = (theme == 'default') ? 'normal' : (theme == 'gray') ? 'amap://styles/light' : 'amap://styles/659dc6c4753dc6e87c65c8a874c02133';
  1995. // mapStyle = (theme=='default')?'normal':(theme=='gray')?'amap://styles/light':'amap://styles/dark';
  1996. $("#alarm_wrapper_table").css('left', (($(document).innerWidth() - 800) / 2) + 'px');
  1997. if ((theme == 'access') || (theme == ''))
  1998. $('#alarm_wrapper').addClass('shadow_black');
  1999. else
  2000. $('#alarm_wrapper').addClass('shadow_white');
  2001. last_move = Date.parse(new Date());
  2002. company_cur = -1;
  2003. myMask = new Ext.LoadMask(Ext.getBody(), {
  2004. msg: '查询中,请稍后!',
  2005. cls: 'toplevel',
  2006. removeMask: true //完成后移除
  2007. });
  2008. map = new AMap.Map('container', {
  2009. mapStyle: mapStyle, //样式URL
  2010. viewMode: '3D',
  2011. turboMode: false,
  2012. resizeEnable: true,
  2013. zoom: mapzoom,
  2014. center: [121.475644, 31.1857],
  2015. features: ['bg', 'road', 'building'],
  2016. pitch: 45,
  2017. forceVector: true
  2018. });
  2019. map.on('zoomend', function(e) {
  2020. draw_all();
  2021. });
  2022. map.on('movestart', function(e) {
  2023. clear_detail_info();
  2024. });
  2025. map.on('mousemove', function(e) {
  2026. if (company_cur < 0)
  2027. return;
  2028. last_move = Date.parse(new Date());
  2029. company_cur = -1;
  2030. firstDraw = true;
  2031. map.setPitch(45);
  2032. draw_all();
  2033. LabelShow = true;
  2034. shower_click();
  2035. shower_mouseout();
  2036. });
  2037. map.on('complete', function(e) {
  2038. getCurrentData();
  2039. });
  2040. $("#search_company").on('input', function() {
  2041. update_companyList();
  2042. });
  2043. myMask.show();
  2044. if (V_LOGINNAME == 'ypxy') {
  2045. var win1 = new UWindow();
  2046. win1.create('win1', 'container', winypxy1_config);
  2047. win1.show();
  2048. var dev1 = new UWindow();
  2049. dev1.create('dev1', 'container', devypxy1_config);
  2050. dev1.show();
  2051. var win2 = new UWindow();
  2052. win2.create('win2', 'container', winypxy2_config);
  2053. win2.show();
  2054. var win3 = new UWindow();
  2055. win3.create('win3', 'container', winypxy3_config);
  2056. win3.show();
  2057. var win4 = new UWindow();
  2058. win4.create('win4', 'container', winypxy4_config);
  2059. win4.show();
  2060. var win5 = new UWindow();
  2061. win5.create('win5', 'container', winypxy5_config);
  2062. win5.show();
  2063. var dev2 = new UWindow();
  2064. dev2.create('dev2', 'container', devypxy2_config);
  2065. dev2.show();
  2066. var dev3 = new UWindow();
  2067. dev3.create('dev3', 'container', devypxy3_config);
  2068. dev3.show();
  2069. var dev4 = new UWindow();
  2070. dev4.create('dev4', 'container', devypxy4_config);
  2071. dev4.show();
  2072. var dev5 = new UWindow();
  2073. dev5.create('dev5', 'container', devypxy5_config);
  2074. dev5.show();
  2075. } else {
  2076. var win1 = new UWindow();
  2077. win1.create('win1', 'container', win1_config);
  2078. win1.show();
  2079. var win2 = new UWindow();
  2080. win2.create('win2', 'container', win2_config);
  2081. win2.show();
  2082. var win3 = new UWindow();
  2083. win3.create('win3', 'container', win3_config);
  2084. win3.show();
  2085. var win4 = new UWindow();
  2086. win4.create('win4', 'container', win4_config);
  2087. win4.show();
  2088. var dev1 = new UWindow();
  2089. dev1.create('dev1', 'container', dev1_config);
  2090. dev1.show();
  2091. var dev2 = new UWindow();
  2092. dev2.create('dev2', 'container', dev2_config);
  2093. dev2.show();
  2094. var dev3 = new UWindow();
  2095. dev3.create('dev3', 'container', dev3_config);
  2096. dev3.show();
  2097. var dev4 = new UWindow();
  2098. dev4.create('dev4', 'container', dev4_config);
  2099. dev4.show();
  2100. }
  2101. function getReportState(params = {}) {
  2102. $.ajax({
  2103. type: "POST",
  2104. url: baseUrl+"/iot/userstate/getUserStateList",
  2105. data: params,
  2106. success: function(data) {
  2107. var result = eval('(' + data + ')');
  2108. var getState = result.RESULT[0].STATE
  2109. console.log('getState')
  2110. console.log(getState);
  2111. if (getState != 3&&result.success) {
  2112. layui.use('layer', function() {
  2113. var layer = layui.layer;
  2114. layer.open({
  2115. icon: 7,
  2116. title: '提示信息',
  2117. closeBtn: false,
  2118. btn: ['确定', '取消'],
  2119. content: '您有报告未读,请查看!',
  2120. yes: function(index, layero) { //yes对应第一个按钮“确定”
  2121. if (getState == 0) {
  2122. location.href = baseUrl + 'view/efireAnalysis/waterIndex.html';
  2123. // window.location.href = "../waterIndex.html";
  2124. } else if (getState == 1) {
  2125. location.href = baseUrl + 'view/efireAnalysis/waterIndex.html';
  2126. // window.location.href = "../waterIndex.html";
  2127. } else if (getState == 2) {
  2128. location.href = baseUrl + 'view/efireAnalysis/eleFireIndex.html';
  2129. // window.location.href = "../eleFireIndex.html";
  2130. }
  2131. },
  2132. btn2: function(index, layero) { //该操作对应的是“取消”按钮
  2133. layer.close(index)
  2134. return false;
  2135. },
  2136. });
  2137. });
  2138. }
  2139. },
  2140. error: function() {
  2141. console.log("发生错误")
  2142. // alert("发生错误");
  2143. },
  2144. complete: function() {
  2145. // console.log("ajax请求完事,最终操作在这里完成")
  2146. }
  2147. });
  2148. }
  2149. window.onresize = function() {
  2150. body_resize();
  2151. };
  2152. body_resize();
  2153. V_LOGINNAME = $("#V_LOGINNAME").val();
  2154. getReportState({
  2155. "queryJson": '{"V_LOGINNAME": "'+V_LOGINNAME+'"}'
  2156. });
  2157. // initWebSocket();
  2158. });