map.js 79 KB

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