map.js 114 KB

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