map.js 116 KB

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