map.js20210303.bak 94 KB

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