map.js 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028
  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. $.ajax({
  1088. type: 'POST',
  1089. url: qurl,
  1090. data: qdata,
  1091. success: function(result) {
  1092. var json = eval('(' + result + ')');
  1093. if (json.action == 'getAlarmList') {
  1094. $(".alarm_tab_area").remove();
  1095. if ((json.ALARM == undefined) || (json.ALARM.length == 0))
  1096. return;
  1097. var parent = document.getElementById('container');
  1098. json.ALARM.sort(alarmSortByTime);
  1099. var area = document.createElement('div');
  1100. area.id = 'alarm_tab_area';
  1101. area.setAttribute('class', 'alarm_tab_area');
  1102. parent.appendChild(area);
  1103. for (var i = 0; i < json.ALARM.length; i++) {
  1104. if (i >= 6)
  1105. break;
  1106. var tab = document.createElement('div');
  1107. tab.id = 'alarm_tab_' + (i + 1);
  1108. tab.setAttribute('class', 'alarm_tab');
  1109. tab.setAttribute('onclick', (json.ALARM[i].dwtype == 1) ? 'show_all_fireAlarm()' :
  1110. (AlarmStore[i].dwtype == 2) ? 'show_all_waterAlarm()' :
  1111. (AlarmStore[i].dwtype == 5) ? 'show_all_waterAlarm()' :
  1112. (AlarmStore[i].dwtype == 6) ? 'show_all_rtuAlarm()' :
  1113. (AlarmStore[i].dwtype == 7) ? 'show_all_efireAlarm()' : '#');
  1114. tab.style.top = (120 * i) + 'px';
  1115. if (($(document).innerHeight() - 205) > (120 * (i + 1)))
  1116. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1117. else
  1118. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1119. area.appendChild(tab);
  1120. var title = document.createElement('div');
  1121. title.id = 'alarm_tab_title_' + (i + 1);
  1122. title.setAttribute('class', 'alarm_tab_title');
  1123. title.innerHTML = (json.ALARM[i].dwtype == 1) ? '火警监测报告' :
  1124. (json.ALARM[i].dwtype == 2) ? '水系统监测报告' :
  1125. (json.ALARM[i].dwtype == 5) ? '水系统监测报告' :
  1126. (json.ALARM[i].dwtype == 6) ? 'RTU监测报告' :
  1127. (json.ALARM[i].dwtype == 7) ? '电气火灾监测报告' : '其他报告';
  1128. tab.appendChild(title);
  1129. var time_label = document.createElement('div');
  1130. time_label.id = 'alarm_tab_time_' + (i + 1);
  1131. time_label.setAttribute('class', 'alarm_tab_time');
  1132. time_label.innerHTML = json.ALARM[i].time;
  1133. tab.appendChild(time_label);
  1134. var data = document.createElement('div');
  1135. data.id = "alarm_tab_data_" + (i + 1);
  1136. data.setAttribute('class', 'alarm_tab_data');
  1137. data.innerHTML = json.ALARM[i].company_name + ' ' + json.ALARM[i].data;
  1138. tab.appendChild(data);
  1139. var icon = document.createElement('img');
  1140. icon.setAttribute('class', 'alarm_tab_icon');
  1141. icon.height = '66';
  1142. icon.width = '66';
  1143. icon.src = baseUrl + 'res/img/icons/' + ((json.ALARM[i].dwtype == 1) ? 'alarm_tab_01.gif' :
  1144. (json.ALARM[i].dwtype == 2) ? 'alarm_tab_03.gif' :
  1145. (json.ALARM[i].dwtype == 5) ? 'alarm_tab_03.gif' :
  1146. (json.ALARM[i].dwtype == 6) ? 'alarm_tab_04.gif' :
  1147. (json.ALARM[i].dwtype == 7) ? 'alarm_tab_02.gif' : 'alarm_tab_04.gif');
  1148. tab.appendChild(icon);
  1149. }
  1150. }
  1151. }
  1152. });
  1153. detail_info = document.createElement('div');
  1154. detail_info.id = 'detail_info';
  1155. detail_info.style.position = 'absolute';
  1156. detail_info.style.top = (pixel.getY() - 270) + 'px';
  1157. detail_info.style.left = (pixel.getX() - 101) + 'px';
  1158. detail_info.style.width = '203px';
  1159. detail_info.style.height = '270px';
  1160. detail_info.style.backgroundImage = 'url(../../res/img/icons/detail_info.png)';
  1161. detail_info.style.zIndex = '500';
  1162. detail_info.onmouseleave = clear_detail_info;
  1163. parent.appendChild(detail_info);
  1164. var info_title = document.createElement('div');
  1165. info_title.id = 'info_title';
  1166. info_title.setAttribute('class', 'info_title');
  1167. info_title.innerHTML = '<div style="display:inline-block;vertical-align:middle;align-self:center;">' + StatusStore[i].company_name + '</div>';
  1168. detail_info.appendChild(info_title);
  1169. var info_body0 = document.createElement('div');
  1170. info_body0.id = 'info_body0';
  1171. info_body0.setAttribute('class', 'info_body0');
  1172. info_body0.innerHTML = '地址:' + StatusStore[i].address;
  1173. detail_info.appendChild(info_body0);
  1174. var info_body1 = document.createElement('div');
  1175. info_body1.id = 'info_body1';
  1176. info_body1.setAttribute('class', 'info_body1');
  1177. info_body1.innerHTML = '联系人:' + StatusStore[i].username;
  1178. detail_info.appendChild(info_body1);
  1179. var info_body2 = document.createElement('div');
  1180. info_body2.id = 'info_body2';
  1181. info_body2.setAttribute('class', 'info_body2');
  1182. info_body2.innerHTML = '联系电话:' + StatusStore[i].phone;
  1183. detail_info.appendChild(info_body2);
  1184. var info_btn = document.createElement('div');
  1185. info_btn.id = 'info_btn';
  1186. info_btn.setAttribute('class', 'info_btn');
  1187. info_btn.innerHTML = '查看详情';
  1188. info_btn.company_code = company_code;
  1189. info_btn.onclick = function(e) {
  1190. var event = e;
  1191. location.href = baseUrl + 'view/frontpage/company.jsp?company_code=' + event.currentTarget.company_code;
  1192. }
  1193. detail_info.appendChild(info_btn);
  1194. // var info_btn1 = document.createElement('div');
  1195. // info_btn1.id = 'info_btn1';
  1196. // info_btn1.setAttribute('class','info_btn');
  1197. // info_btn1.innerHTML='历史数据';
  1198. // info_btn1.company_code=company_code;
  1199. // info_btn1.onclick=function(e){
  1200. // var event = e;
  1201. // location.href = baseUrl+'view/frontpage/company.jsp?company_code='+event.currentTarget.company_code;
  1202. // }
  1203. // detail_info.appendChild(info_btn1);
  1204. $("#data_number_11").html(StatusStore[i].d1a);
  1205. $("#data_number_12").html(StatusStore[i].d1a - StatusStore[i].d1ac);
  1206. $("#data_number_21").html(StatusStore[i].d7a);
  1207. $("#data_number_22").html(StatusStore[i].d7a - StatusStore[i].d7ac);
  1208. $("#data_number_31").html(StatusStore[i].d2a);
  1209. $("#data_number_32").html(StatusStore[i].d2a - StatusStore[i].d2ac);
  1210. if (V_LOGINNAME == 'ypxy') {
  1211. var query = new Object();
  1212. query.V_LOGINNAME = V_LOGINNAME;
  1213. query.V_PASSWORD = V_PASSWORD;
  1214. query.dwtype = '2';
  1215. query.COMMSTATUS = 'NO';
  1216. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  1217. query.company_code = company_code;
  1218. $.ajax({
  1219. type: 'POST',
  1220. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  1221. data: {
  1222. queryJson: Ext.JSON.encode(query)
  1223. },
  1224. success: function(result) {
  1225. var json = eval('(' + result + ')');
  1226. if (json.action == 'getConfirmStatusByDays') {
  1227. if (json.check == 'true') {
  1228. ConfirmStore = json.RESULT;
  1229. if (json.company_name != null)
  1230. companyName = json.company_name;
  1231. else
  1232. companyName = null;
  1233. for (var i = 0; i < ConfirmStore.length; i++) {
  1234. if (ConfirmStore[i].id == 'water_alarm') {
  1235. $("#data_number_41").html(ConfirmStore[i].count);
  1236. $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1237. draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
  1238. $("#dev4_count").html(3);
  1239. $("#device_count_num_42").html(ConfirmStore[i].sum);
  1240. $("#dev4-label-hidden").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1241. $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1242. if (ConfirmStore[i].count == 0)
  1243. $("#device_count_num_44").html('100%');
  1244. else
  1245. $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
  1246. if (ConfirmStore[i].count != 0)
  1247. $("#device_confirm_44").css('width', (300 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
  1248. else
  1249. $("#device_confirm_44").css('width', '300px');
  1250. $("#data_number_51").html(0);
  1251. $("#data_number_52").html(0);
  1252. draw_pie('data_pie_5', 0, 0);
  1253. $("#dev5_count").html(3);
  1254. $("#device_count_num_52").html(0);
  1255. $("#dev5-label-hidden").html(0);
  1256. $("#device_count_num_53").html(0);
  1257. $("#device_count_num_54").html('100%');
  1258. $("#device_confirm_54").css('width', '300px');
  1259. }
  1260. }
  1261. } else {
  1262. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1263. window.parent.document.location = baseUrl;
  1264. });
  1265. }
  1266. }
  1267. }
  1268. });
  1269. } else {
  1270. $("#data_number_41").html(StatusStore[i].d6a);
  1271. $("#data_number_42").html(StatusStore[i].d6a - StatusStore[i].d6ac);
  1272. draw_pie('data_pie_4', StatusStore[i].d6a, StatusStore[i].d6ac);
  1273. $("#dev4_count").html(StatusStore[i].d6);
  1274. $("#device_count_num_42").html(StatusStore[i].d6oc);
  1275. $("#dev4-label-hidden").html(StatusStore[i].d6o - StatusStore[i].d6oc);
  1276. $("#device_count_num_43").html(StatusStore[i].d6o - StatusStore[i].d6oc);
  1277. if (StatusStore[i].d6o == 0)
  1278. $("#device_count_num_44").html('100%');
  1279. else
  1280. $("#device_count_num_44").html(toDecimal(StatusStore[i].d6oc * 100 / StatusStore[i].d6o) + '%');
  1281. if (StatusStore[i].d6o != 0)
  1282. $("#device_confirm_44").css('width', (300 * StatusStore[i].d6oc / StatusStore[i].d6o) + 'px');
  1283. else
  1284. $("#device_confirm_44").css('width', '300px');
  1285. }
  1286. draw_pie('data_pie_1', StatusStore[i].d1a, StatusStore[i].d1ac);
  1287. draw_pie('data_pie_2', StatusStore[i].d7a, StatusStore[i].d7ac);
  1288. draw_pie('data_pie_3', StatusStore[i].d2a, StatusStore[i].d2ac);
  1289. $("#dev1_count").html(StatusStore[i].d1);
  1290. $("#device_count_num_12").html(StatusStore[i].d1oc);
  1291. $("#dev1-label-hidden").html(StatusStore[i].d1o - StatusStore[i].d1oc);
  1292. $("#device_count_num_13").html(StatusStore[i].d1o - StatusStore[i].d1oc);
  1293. if (StatusStore[i].d1o == 0)
  1294. $("#device_count_num_14").html('100%');
  1295. else
  1296. $("#device_count_num_14").html(toDecimal(StatusStore[i].d1oc * 100 / StatusStore[i].d1o) + '%');
  1297. $("#dev2_count").html(StatusStore[i].d7);
  1298. $("#device_count_num_22").html(StatusStore[i].d7oc);
  1299. $("#dev2-label-hidden").html(StatusStore[i].d7o - StatusStore[i].d7oc);
  1300. $("#device_count_num_23").html(StatusStore[i].d7o - StatusStore[i].d7oc);
  1301. if (StatusStore[i].d7o == 0)
  1302. $("#device_count_num_24").html('100%');
  1303. else
  1304. $("#device_count_num_24").html(toDecimal(StatusStore[i].d7oc * 100 / StatusStore[i].d7o) + '%');
  1305. $("#dev3_count").html(StatusStore[i].d2);
  1306. $("#device_count_num_32").html(StatusStore[i].d2oc);
  1307. $("#dev3-label-hidden").html(StatusStore[i].d2o - StatusStore[i].d2oc);
  1308. $("#device_count_num_33").html(StatusStore[i].d2o - StatusStore[i].d2oc);
  1309. if (StatusStore[i].d2o == 0)
  1310. $("#device_count_num_34").html('100%');
  1311. else
  1312. $("#device_count_num_34").html(toDecimal(StatusStore[i].d2oc * 100 / StatusStore[i].d2o) + '%');
  1313. if (StatusStore[i].d1o != 0) {
  1314. $("#device_confirm_14").css('width', (300 * StatusStore[i].d1oc / StatusStore[i].d1o) + 'px');
  1315. } else
  1316. $("#device_confirm_14").css('width', '300px');
  1317. if (StatusStore[i].d7o != 0)
  1318. $("#device_confirm_24").css('width', (300 * StatusStore[i].d7oc / StatusStore[i].d7o) + 'px');
  1319. else
  1320. $("#device_confirm_24").css('width', '300px');
  1321. if (StatusStore[i].d2o != 0)
  1322. $("#device_confirm_34").css('width', (300 * StatusStore[i].d2oc / StatusStore[i].d2o) + 'px');
  1323. else
  1324. $("#device_confirm_34").css('width', '300px');
  1325. $(".alarm_tab_area").remove();
  1326. // if((AlarmStore!=null)&&(AlarmStore.length>0)){
  1327. // var parent = document.getElementById('container');
  1328. // AlarmStore.sort(alarmSortByTime);
  1329. // var area = document.createElement('div');
  1330. // area.id= 'alarm_tab_area';
  1331. // area.setAttribute('class','alarm_tab_area');
  1332. // parent.appendChild(area);
  1333. // for(var i=0;i<AlarmStore.length;i++){
  1334. // if(i>=6)
  1335. // break;
  1336. // var tab = document.createElement('div');
  1337. // tab.id = 'alarm_tab_'+(i+1);
  1338. // tab.setAttribute('class','alarm_tab');
  1339. // tab.setAttribute('onclick',(AlarmStore[i].dwtype==1)?'show_all_fireAlarm()':
  1340. // (AlarmStore[i].dwtype==2)?'show_all_waterAlarm()':
  1341. // (AlarmStore[i].dwtype==5)?'show_all_waterAlarm()':
  1342. // (AlarmStore[i].dwtype==6)?'show_all_rtuAlarm()':
  1343. // (AlarmStore[i].dwtype==7)?'show_all_efireAlarm()':'#');
  1344. // tab.style.top=(120*i)+'px';
  1345. // if(($(document).innerHeight()-205)>(120*(i+1)))
  1346. // $('#alarm_tab_area').css('height',($(document).innerHeight()-205)+'px');
  1347. // else
  1348. // $('#alarm_tab_area').css('height',($(document).innerHeight()-205)+'px');
  1349. // area.appendChild(tab);
  1350. // var title = document.createElement('div');
  1351. // title.id = 'alarm_tab_title_'+(i+1);
  1352. // title.setAttribute('class','alarm_tab_title');
  1353. // title.innerHTML=(AlarmStore[i].dwtype==1)?'火警监测报告':
  1354. // (AlarmStore[i].dwtype==2)?'水系统监测报告':
  1355. // (AlarmStore[i].dwtype==5)?'水系统监测报告':
  1356. // (AlarmStore[i].dwtype==6)?'RTU监测报告':
  1357. // (AlarmStore[i].dwtype==7)?'电气火灾监测报告':'其他报告';
  1358. // tab.appendChild(title);
  1359. // var time_label = document.createElement('div');
  1360. // time_label.id = 'alarm_tab_time_'+(i+1);
  1361. // time_label.setAttribute('class','alarm_tab_time');
  1362. // time_label.innerHTML=AlarmStore[i].time;
  1363. // tab.appendChild(time_label);
  1364. // var data = document.createElement('div');
  1365. // data.id = "alarm_tab_data_"+(i+1);
  1366. // data.setAttribute('class','alarm_tab_data');
  1367. // data.innerHTML=AlarmStore[i].company_name+' '+AlarmStore[i].data;
  1368. // tab.appendChild(data);
  1369. // var icon = document.createElement('img');
  1370. // icon.setAttribute('class','alarm_tab_icon');
  1371. // icon.height = '66';
  1372. // icon.width = '66';
  1373. // icon.src = baseUrl+'res/img/icons/'+((AlarmStore[i].dwtype==1)?'alarm_tab_01.gif'
  1374. // :(AlarmStore[i].dwtype==2)?'alarm_tab_03.gif'
  1375. // :(AlarmStore[i].dwtype==5)?'alarm_tab_03.gif'
  1376. // :(AlarmStore[i].dwtype==6)?'alarm_tab_04.gif'
  1377. // :(AlarmStore[i].dwtype==7)?'alarm_tab_02.gif':'alarm_tab_04.gif')+'?t='+(new Date());
  1378. // tab.appendChild(icon);
  1379. // }
  1380. // }
  1381. break;
  1382. }
  1383. }
  1384. }
  1385. var markerSortByRotation = function(a, b) {
  1386. if ((rotation <= 45) || (rotation >= 315))
  1387. return b.lat - a.lat;
  1388. else if ((rotation > 45) && (rotation <= 135))
  1389. return a.lng - b.lng;
  1390. else if ((rotation > 135) && (rotation <= 270))
  1391. return a.lat - b.lat;
  1392. else
  1393. return b.lng - a.lng;
  1394. }
  1395. var alarmSortByTime = function(a, b) {
  1396. var time_a = Date.parse(a.time);
  1397. var time_b = Date.parse(b.time);
  1398. return time_b - time_a;
  1399. }
  1400. var draw_pie = function(id, total, num) {
  1401. var mColor = '#34abf5';
  1402. var percent = 100;
  1403. if (total > 0)
  1404. percent = Number(((num * 100) / total).toString().match(/^\d+(?:\.\d{0,2})?/));
  1405. if (percent < 60)
  1406. mColor = '#f66167';
  1407. else if (percent < 80)
  1408. mColor = '#DDDF0D';
  1409. if (id == 'data_pie_1') {
  1410. $("#title-label-11").css({
  1411. color: mColor
  1412. }).html(percent + '%');
  1413. $("#title-label-12").html(total);
  1414. } else if (id == 'data_pie_2') {
  1415. $("#title-label-21").css({
  1416. color: mColor
  1417. }).html(percent + '%');
  1418. $("#title-label-22").html(total);
  1419. } else if (id == 'data_pie_3') {
  1420. $("#title-label-31").css({
  1421. color: mColor
  1422. }).html(percent + '%');
  1423. $("#title-label-32").html(total);
  1424. } else if (id == 'data_pie_4') {
  1425. $("#title-label-41").css({
  1426. color: mColor
  1427. }).html(percent + '%');
  1428. $("#title-label-42").html(total);
  1429. }
  1430. Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5', '#DDDF0D'], function(color) {
  1431. return {
  1432. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  1433. stops: [
  1434. [0, color],
  1435. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  1436. ]
  1437. };
  1438. });
  1439. Highcharts.chart(id, {
  1440. chart: {
  1441. type: 'pie',
  1442. backgroundColor: 'rgba(0,0,0,0)',
  1443. height: '100%',
  1444. options3d: {
  1445. enabled: true,
  1446. alpha: 45,
  1447. beta: 0
  1448. }
  1449. },
  1450. title: {
  1451. text: '处置率:' + percent + '%',
  1452. floating: true,
  1453. y: 85,
  1454. style: { fontSize: '12px', color: '#ffffff' }
  1455. },
  1456. exporting: {
  1457. enabled: false
  1458. },
  1459. credits: {
  1460. enabled: false
  1461. },
  1462. tooltip: {
  1463. // enabled: false
  1464. pointFormat: '{point.percentage:.2f}%'
  1465. },
  1466. plotOptions: {
  1467. pie: {
  1468. allowPointSelect: true,
  1469. cursor: 'pointer',
  1470. depth: 15,
  1471. dataLabels: {
  1472. enabled: false,
  1473. format: '{point.name}'
  1474. }
  1475. }
  1476. },
  1477. series: [{
  1478. type: 'pie',
  1479. name: '处置率',
  1480. startAngle: 90,
  1481. data: [{
  1482. name: '待处理',
  1483. y: 100 - percent,
  1484. sliced: true,
  1485. selected: true
  1486. },
  1487. ['已处理', percent]
  1488. ]
  1489. }]
  1490. });
  1491. }
  1492. var draw_all = function() {
  1493. if (company_cur > 0)
  1494. return;
  1495. var d0 = 0,
  1496. d0o = 0,
  1497. d0oc = 0,
  1498. d0a = 0,
  1499. d0ac = 0;
  1500. var d1 = 0,
  1501. d1o = 0,
  1502. d1oc = 0,
  1503. d1a = 0,
  1504. d1ac = 0;
  1505. var d2 = 0,
  1506. d2o = 0,
  1507. d2oc = 0,
  1508. d2a = 0,
  1509. d2ac = 0;
  1510. var d6 = 0,
  1511. d6o = 0,
  1512. d6oc = 0,
  1513. d6a = 0,
  1514. d6ac = 0;
  1515. var d7 = 0,
  1516. d7o = 0,
  1517. d7oc = 0,
  1518. d7a = 0,
  1519. d7ac = 0;
  1520. var totalLat = 0,
  1521. totalLng = 0,
  1522. latngCount = 0;
  1523. // map.clearMap();
  1524. clear_detail_info();
  1525. markers = [];
  1526. var zoom = map.getZoom();
  1527. var iconWidth = 28;
  1528. var iconHeight = 28;
  1529. if ((StatusStore != null) && (StatusStore.length > 0)) {
  1530. rotation = map.getRotation();
  1531. StatusStore.sort(markerSortByRotation);
  1532. for (var i = 0; i < StatusStore.length; i++) {
  1533. var obj = StatusStore[i];
  1534. var iconurl = baseUrl + 'res/img/icons/building.png';
  1535. if ((obj.d0a != obj.d0ac) ||
  1536. (obj.d0o != obj.d0oc) ||
  1537. (obj.d1a != obj.d1ac) ||
  1538. (obj.d1o != obj.d1oc) ||
  1539. (obj.d2a != obj.d2ac) ||
  1540. (obj.d2o != obj.d2oc) ||
  1541. (obj.d6a != obj.d6ac) ||
  1542. (obj.d6o != obj.d6oc) ||
  1543. (obj.d7a != obj.d7ac) ||
  1544. (obj.d7o != obj.d7oc))
  1545. iconurl = baseUrl + 'res/img/icons/building_alarm.png';
  1546. d1 += obj.d1;
  1547. d1o += obj.d1o;
  1548. d1a += obj.d1a;
  1549. d1oc += obj.d1oc;
  1550. d1ac += obj.d1ac;
  1551. d2 += obj.d2;
  1552. d2o += obj.d2o;
  1553. d2a += obj.d2a;
  1554. d2oc += obj.d2oc;
  1555. d2ac += obj.d2ac;
  1556. d6 += obj.d6;
  1557. d6o += obj.d6o;
  1558. d6a += obj.d6a;
  1559. d6oc += obj.d6oc;
  1560. d6ac += obj.d6ac;
  1561. d7 += obj.d7;
  1562. d7o += obj.d7o;
  1563. d7a += obj.d7a;
  1564. d7oc += obj.d7oc;
  1565. d7ac += obj.d7ac;
  1566. if ((obj.lat > 30) && (obj.lat < 33) && (obj.lng > 120) && (obj.lng < 125)) {
  1567. totalLng += obj.lng;
  1568. totalLat += obj.lat;
  1569. latngCount++;
  1570. var marker = new AMap.Marker({
  1571. icon: new AMap.Icon({
  1572. size: new AMap.Size(iconWidth, iconHeight),
  1573. image: iconurl,
  1574. imageSize: new AMap.Size(iconWidth, iconHeight)
  1575. }),
  1576. position: new AMap.LngLat(obj.lng, obj.lat),
  1577. extData: {
  1578. icontype: 'company',
  1579. company_code: obj.company_code
  1580. },
  1581. offset: new AMap.Pixel(-(iconWidth / 2), -(iconHeight / 2)),
  1582. draggable: false,
  1583. raiseOnDrag: false,
  1584. autoRotation: false,
  1585. label: {
  1586. offset: new AMap.Pixel(-iconWidth - 5, -(iconHeight / 2) - 10),
  1587. content: "<div id='label_" + obj.company_code + "' class='info " + (LabelShow ? 'shown' : 'hiden') + "'>" + obj.company_name + "</div>",
  1588. direction: 'right'
  1589. }
  1590. });
  1591. AMap.event.addListener(marker, 'click', showBuilding, this);
  1592. AMap.event.addListener(marker, 'mouseover', showInfo, this);
  1593. if (!MapShow) {
  1594. marker.setMap(map);
  1595. markers.push(marker);
  1596. }
  1597. }
  1598. }
  1599. var sts = [{
  1600. url: baseUrl + 'res/img/icons/icon_juhe_grade1.png',
  1601. size: new AMap.Size(40, 40),
  1602. offset: new AMap.Pixel(-16, -16)
  1603. }, {
  1604. url: baseUrl + 'res/img/icons/icon_juhe_grade2.png',
  1605. size: new AMap.Size(40, 40),
  1606. offset: new AMap.Pixel(-16, -16)
  1607. }, {
  1608. url: baseUrl + 'res/img/icons/icon_juhe_grade3.png',
  1609. size: new AMap.Size(40, 40),
  1610. offset: new AMap.Pixel(-18, -18)
  1611. }];
  1612. if (!MapShow) {
  1613. MapShow = true;
  1614. // map.plugin(["AMap.MarkerClusterer"],function(){
  1615. // cluster = new AMap.MarkerClusterer(map, markers, {
  1616. // styles: sts,
  1617. // gridSize: 80,
  1618. // maxZoom:14
  1619. //// minClusterSize:3
  1620. //// renderClusterMarker:_renderClusterMarker
  1621. // });
  1622. // });
  1623. }
  1624. if ((latngCount > 0) && (firstDraw)) {
  1625. map.setCenter(new AMap.LngLat(totalLng / latngCount, totalLat / latngCount, true));
  1626. map.setFitView();
  1627. firstDraw = false;
  1628. }
  1629. $("#data_number_11").html(d1a);
  1630. $("#data_number_12").html(d1a - d1ac);
  1631. $("#data_number_21").html(d7a);
  1632. $("#data_number_22").html(d7a - d7ac);
  1633. $("#data_number_31").html(d2a);
  1634. $("#data_number_32").html(d2a - d2ac);
  1635. $("#data_number_31").html(d2a);
  1636. $("#data_number_32").html(d2a - d2ac);
  1637. draw_pie('data_pie_1', d1a, d1ac);
  1638. draw_pie('data_pie_2', d7a, d7ac);
  1639. draw_pie('data_pie_3', d2a, d2ac);
  1640. if (V_LOGINNAME == 'ypxy') {
  1641. var query = new Object();
  1642. query.V_LOGINNAME = V_LOGINNAME;
  1643. query.V_PASSWORD = V_PASSWORD;
  1644. query.dwtype = '2';
  1645. query.COMMSTATUS = 'NO';
  1646. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  1647. query.company_code = company_code;
  1648. $.ajax({
  1649. type: 'POST',
  1650. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  1651. data: {
  1652. queryJson: Ext.JSON.encode(query)
  1653. },
  1654. success: function(result) {
  1655. var json = eval('(' + result + ')');
  1656. if (json.action == 'getConfirmStatusByDays') {
  1657. if (json.check == 'true') {
  1658. ConfirmStore = json.RESULT;
  1659. if (json.company_name != null)
  1660. companyName = json.company_name;
  1661. else
  1662. companyName = null;
  1663. for (var i = 0; i < ConfirmStore.length; i++) {
  1664. if (ConfirmStore[i].id == 'water_alarm') {
  1665. $("#data_number_41").html(ConfirmStore[i].count);
  1666. $("#data_number_42").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1667. draw_pie('data_pie_4', ConfirmStore[i].count, ConfirmStore[i].sum);
  1668. $("#dev4_count").html(6);
  1669. $("#device_count_num_42").html(ConfirmStore[i].sum);
  1670. $("#dev4-label-hidden").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1671. $("#device_count_num_43").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  1672. if (ConfirmStore[i].count == 0)
  1673. $("#device_count_num_44").html('100%');
  1674. else
  1675. $("#device_count_num_44").html(toDecimal(ConfirmStore[i].sum * 100 / ConfirmStore[i].count) + '%');
  1676. if (ConfirmStore[i].count != 0)
  1677. $("#device_confirm_44").css('width', (300 * ConfirmStore[i].sum / ConfirmStore[i].count) + 'px');
  1678. else
  1679. $("#device_confirm_44").css('width', '300px');
  1680. $("#data_number_51").html(0);
  1681. $("#data_number_52").html(0);
  1682. draw_pie('data_pie_5', 0, 0);
  1683. $("#dev5_count").html(6);
  1684. $("#device_count_num_52").html(0);
  1685. $("#dev5-label-hidden").html(0);
  1686. $("#device_count_num_53").html(0);
  1687. $("#device_count_num_54").html('100%');
  1688. $("#device_confirm_54").css('width', '300px');
  1689. }
  1690. }
  1691. } else {
  1692. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1693. window.parent.document.location = baseUrl;
  1694. });
  1695. }
  1696. }
  1697. }
  1698. });
  1699. } else {
  1700. $("#data_number_41").html(d6a);
  1701. $("#data_number_42").html(d6a - d6ac);
  1702. draw_pie('data_pie_4', d6a, d6ac);
  1703. $("#dev4_count").html(d6);
  1704. $("#device_count_num_42").html(d6oc);
  1705. $("#dev4-label-hidden").html(d6o - d6oc);
  1706. $("#device_count_num_43").html(d6o - d6oc);
  1707. if (d6o == 0)
  1708. $("#device_count_num_44").html('100%');
  1709. else
  1710. $("#device_count_num_44").html(toDecimal(d6oc * 100 / d6o) + '%');
  1711. if (d6o != 0)
  1712. $("#device_confirm_44").css('width', (300 * d6oc / d6o) + 'px');
  1713. else
  1714. $("#device_confirm_44").css('width', '300px');
  1715. }
  1716. $("#dev1_count").html(d1);
  1717. $("#device_count_num_12").html(d1oc);
  1718. $("#dev1-label-hidden").html(d1o - d1oc);
  1719. $("#device_count_num_13").html(d1o - d1oc);
  1720. if (d1o == 0)
  1721. $("#device_count_num_14").html('100%');
  1722. else
  1723. $("#device_count_num_14").html(toDecimal(d1oc * 100 / d1o) + '%');
  1724. $("#dev2_count").html(d7);
  1725. $("#device_count_num_22").html(d7oc);
  1726. $("#dev2-label-hidden").html(d7o - d7oc);
  1727. $("#device_count_num_23").html(d7o - d7oc);
  1728. if (d7o == 0)
  1729. $("#device_count_num_24").html('100%');
  1730. else
  1731. $("#device_count_num_24").html(toDecimal(d7oc * 100 / d7o) + '%');
  1732. $("#dev3_count").html(d2);
  1733. $("#device_count_num_32").html(d2oc);
  1734. $("#dev3-label-hidden").html(d2o - d2oc);
  1735. $("#device_count_num_33").html(d2o - d2oc);
  1736. if (d2o == 0)
  1737. $("#device_count_num_34").html('100%');
  1738. else
  1739. $("#device_count_num_34").html(toDecimal(d2oc * 100 / d2o) + '%');
  1740. if (d1o != 0) {
  1741. $("#device_confirm_14").css('width', (300 * d1oc / d1o) + 'px');
  1742. } else
  1743. $("#device_confirm_14").css('width', '300px');
  1744. if (d7o != 0)
  1745. $("#device_confirm_24").css('width', (300 * d7oc / d7o) + 'px');
  1746. else
  1747. $("#device_confirm_24").css('width', '300px');
  1748. if (d2o != 0)
  1749. $("#device_confirm_34").css('width', (300 * d2oc / d2o) + 'px');
  1750. else
  1751. $("#device_confirm_34").css('width', '300px');
  1752. }
  1753. $(".alarm_tab_area").remove();
  1754. if ((AlarmStore != null) && (AlarmStore.length > 0)) {
  1755. var parent = document.getElementById('container');
  1756. AlarmStore.sort(alarmSortByTime);
  1757. var area = document.createElement('div');
  1758. area.id = 'alarm_tab_area';
  1759. area.setAttribute('class', 'alarm_tab_area');
  1760. parent.appendChild(area);
  1761. for (var i = 0; i < AlarmStore.length; i++) {
  1762. if (i >= 6)
  1763. break;
  1764. var tab = document.createElement('div');
  1765. tab.id = 'alarm_tab_' + (i + 1);
  1766. tab.setAttribute('class', 'alarm_tab');
  1767. tab.setAttribute('onclick', (AlarmStore[i].dwtype == 1) ? 'show_all_fireAlarm()' :
  1768. (AlarmStore[i].dwtype == 2) ? 'show_all_waterAlarm()' :
  1769. (AlarmStore[i].dwtype == 5) ? 'show_all_waterAlarm()' :
  1770. (AlarmStore[i].dwtype == 6) ? 'show_all_rtuAlarm()' :
  1771. (AlarmStore[i].dwtype == 7) ? 'show_all_efireAlarm()' : '#');
  1772. tab.style.top = (120 * i) + 'px';
  1773. if (($(document).innerHeight() - 205) > (120 * (i + 1)))
  1774. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1775. else
  1776. $('#alarm_tab_area').css('height', ($(document).innerHeight() - 205) + 'px');
  1777. area.appendChild(tab);
  1778. var title = document.createElement('div');
  1779. title.id = 'alarm_tab_title_' + (i + 1);
  1780. title.setAttribute('class', 'alarm_tab_title');
  1781. title.innerHTML = (AlarmStore[i].dwtype == 1) ? '火警监测报告' :
  1782. (AlarmStore[i].dwtype == 2) ? '水系统监测报告' :
  1783. (AlarmStore[i].dwtype == 5) ? '水系统监测报告' :
  1784. (AlarmStore[i].dwtype == 6) ? 'RTU监测报告' :
  1785. (AlarmStore[i].dwtype == 7) ? '电气火灾监测报告' : '其他报告';
  1786. tab.appendChild(title);
  1787. var time_label = document.createElement('div');
  1788. time_label.id = 'alarm_tab_time_' + (i + 1);
  1789. time_label.setAttribute('class', 'alarm_tab_time');
  1790. time_label.innerHTML = AlarmStore[i].time;
  1791. tab.appendChild(time_label);
  1792. var data = document.createElement('div');
  1793. data.id = "alarm_tab_data_" + (i + 1);
  1794. data.setAttribute('class', 'alarm_tab_data');
  1795. data.innerHTML = AlarmStore[i].company_name + ' ' + AlarmStore[i].data;
  1796. tab.appendChild(data);
  1797. var icon = document.createElement('img');
  1798. icon.setAttribute('class', 'alarm_tab_icon');
  1799. icon.height = '66';
  1800. icon.width = '66';
  1801. icon.src = baseUrl + 'res/img/icons/' + ((AlarmStore[i].dwtype == 1) ? 'alarm_tab_01.gif' :
  1802. (AlarmStore[i].dwtype == 2) ? 'alarm_tab_03.gif' :
  1803. (AlarmStore[i].dwtype == 5) ? 'alarm_tab_03.gif' :
  1804. (AlarmStore[i].dwtype == 6) ? 'alarm_tab_04.gif' :
  1805. (AlarmStore[i].dwtype == 7) ? 'alarm_tab_02.gif' : 'alarm_tab_04.gif') + '?t=' + (new Date());
  1806. tab.appendChild(icon);
  1807. }
  1808. }
  1809. }
  1810. var getCurrentData = function() {
  1811. if (((new Date()).getTime() - synctime) < storeTime)
  1812. return;
  1813. $("#fp_backbtn").css("display", "none");
  1814. synctime = (new Date()).getTime();
  1815. var query = new Object();
  1816. query.V_LOGINNAME = V_LOGINNAME;
  1817. query.V_PASSWORD = V_PASSWORD;
  1818. query.V_COMMAND = 'FRONTPAGE';
  1819. query.COMMSTATUS = "NO";
  1820. if ($("#company_code").val().length > 0)
  1821. query.company_code = $("#company_code").val();
  1822. var qdata = JSON.stringify(query);
  1823. var qurl = baseUrl + '/cgi-bin/WebAction.cgi';
  1824. if ((baseUrl.indexOf('localhost') >= 0) || (baseUrl.indexOf('127.0.0.1') >= 0))
  1825. qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
  1826. $.ajax({
  1827. type: 'POST',
  1828. url: qurl,
  1829. data: qdata,
  1830. success: function(result) {
  1831. if ((result == undefined) || (result.length == 0)) {
  1832. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1833. window.parent.document.location = baseUrl;
  1834. });
  1835. } else {
  1836. var json = eval('(' + result + ')');
  1837. if (json.check == 'false') {
  1838. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  1839. window.parent.document.location = baseUrl;
  1840. });
  1841. }
  1842. if (json.action == 'getFrontpageQuery') {
  1843. if (json.check == 'true') {
  1844. if (json.LIST != undefined)
  1845. StatusStore = json.LIST;
  1846. if (json.ALARM != undefined)
  1847. AlarmStore = json.ALARM;
  1848. draw_all();
  1849. }
  1850. }
  1851. }
  1852. myMask.hide();
  1853. }
  1854. });
  1855. setTimeout(getCurrentData, storeTime);
  1856. }
  1857. var chk_company_cur = function(idx) {
  1858. var nrow = 0;
  1859. while (1) {
  1860. idx++;
  1861. if (idx >= StatusStore.length)
  1862. idx = 0;
  1863. var obj = StatusStore[idx];
  1864. if ((obj.lat > 30) && (obj.lat < 33) && (obj.lng > 120) && (obj.lng < 125))
  1865. return idx;
  1866. nrow++;
  1867. if (nrow >= StatusStore.length)
  1868. return -1;
  1869. }
  1870. }
  1871. var show_cur_comany = function() {
  1872. var current_t = Date.parse(new Date());
  1873. if ((current_t - last_move) > 30000) {
  1874. last_move = current_t;
  1875. if ((StatusStore != null) && (StatusStore.length > 0)) {
  1876. company_cur = chk_company_cur(company_cur);
  1877. if (company_cur >= 0) {
  1878. var obj = StatusStore[company_cur];
  1879. showBuilding(obj.company_code);
  1880. LabelShow = false;
  1881. shower_click();
  1882. }
  1883. }
  1884. }
  1885. setTimeout(show_cur_comany, 5000);
  1886. }
  1887. var body_resize = function() {
  1888. $("#mask_l").css('height', $(window).innerHeight() + 'px');
  1889. $("#mask_r").css('height', $(window).innerHeight() + 'px');
  1890. $("#mask_b").css('top', ($(window).innerHeight() - 100) + 'px');
  1891. $("#mask_b").css('width', $(window).innerWidth() + 'px');
  1892. $("#mask_t").css('width', $(window).innerWidth() + 'px');
  1893. $("#map_header").css('left', ($(window).innerWidth() - 740) / 2 + 'px');
  1894. $("#map_header").css('height', '82px');
  1895. $("#container").css('width', $(window).innerWidth() + 'px');
  1896. $("#container").css('height', $(window).innerHeight() + 'px');
  1897. var area_height = $(window).innerHeight() - 129;
  1898. $("#data_bar_area").css('height', area_height + 'px');
  1899. $("#alarm_tab_area").css('height', ($(window).innerHeight() - 205) + 'px');
  1900. draw_all();
  1901. }
  1902. var show_all_fireAlarm = function() {
  1903. if ($("#V_LOGINNAME").val() == 'guest')
  1904. return;
  1905. parent.window.keep_menu();
  1906. if ($("#company_code").val() != undefined)
  1907. location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1908. else
  1909. location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme=' + theme;
  1910. }
  1911. var show_all_waterAlarm = function() {
  1912. if ($("#V_LOGINNAME").val() == 'guest')
  1913. return;
  1914. parent.window.keep_menu();
  1915. if ($("#company_code").val() != undefined)
  1916. location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1917. else
  1918. location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme=' + theme;
  1919. }
  1920. var show_all_rtuAlarm = function() {
  1921. if ($("#V_LOGINNAME").val() == 'guest')
  1922. return;
  1923. parent.window.keep_menu();
  1924. if ($("#company_code").val() != undefined)
  1925. location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1926. else
  1927. location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme=' + theme;
  1928. }
  1929. var show_all_efireAlarm = function() {
  1930. if ($("#V_LOGINNAME").val() == 'guest')
  1931. return;
  1932. parent.window.keep_menu();
  1933. if ($("#company_code").val() != undefined)
  1934. location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  1935. else
  1936. location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme=' + theme;
  1937. }
  1938. var show_all_fireDevice = function() {
  1939. if ($("#V_LOGINNAME").val() == 'guest')