| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490 | 
							- /**
 
-  * map.js
 
-  */
 
- Ext.Loader.setConfig({
 
-     enabled: true
 
- });
 
- Ext.Loader.setPath('Ext.ux', '../res/extjs/examples/ux');
 
- Ext.require([
 
-     'Ext.grid.*',
 
-     'Ext.data.*',
 
-     'Ext.ux.RowExpander',
 
-     'Ext.selection.CheckboxModel'
 
- ]);
 
- var sm = Ext.create('Ext.selection.CheckboxModel');
 
- var myMask;
 
- var baseUrl = "";
 
- var theme = "";
 
- var mapStyle = "";
 
- var map;
 
- var mapzoom = 11;
 
- var StatusStore=null,ConfirmStore=null,AlarmStore=null,showAlarm=null;
 
- var firstDraw = false;
 
- var storeTime = 60000;
 
- var centerLng = 121.475644;
 
- var currentLng = 121.475644;
 
- var centerLat = 31.1857;
 
- var currentLat = 31.1857;
 
- var rotation = 0;
 
- var alarm_show_window=null;
 
- var show_alarm_list;
 
- var V_LOGINNAME='',V_PASSWORD='';
 
- var viewAlarmType,pieAlarmType,statusType;
 
- var listSync=true;
 
- var synctime = 0;
 
- var company_code = '';
 
- var start=0;
 
- var end = 360;
 
- var targetZoom = 20;
 
- Ext.define('Alarm',{
 
- 	extend: 'Ext.data.Model',
 
- 	fields: [
 
- 		{ header: '告警内容',  name: 'data', width:80 },
 
- 	    { header: '报告时间', name: 'time', width:150},
 
- 	    { header: '单位', name: 'company', width:200 },
 
- 	    { header: '详细信息', name: 'name',width:400 },
 
- 	    { header: '状态', name: 'clzt', width:60 }
 
- 	]
 
- });
 
- var showBuilding = function(idx) {
 
- 	$("#fp_backbtn").css("display","block");
 
-     var company_code = idx.target.getExtData().company_code;
 
-     for(var i=0;i<StatusStore.length;i++){
 
-         if(StatusStore[i].company_code==company_code){
 
-         	$("#search_company").val(StatusStore[i].company_name);
 
-         	$("#company_code").val(company_code);
 
- 			$("#saerch_company_list").html('');
 
- 			getCurrentData2();
 
- 			break;
 
-         }
 
-     }
 
- }
 
- var btn_over = function() {
 
- 	$("#fp_backbtn").css("background-image","url("+baseUrl +"/res/img/back_on.png)");
 
- }
 
- var btn_out = function() {
 
- 	$("#fp_backbtn").css("background-image","url("+baseUrl +"/res/img/back.png)");
 
- }
 
- var back_all = function() {
 
- 	$("#fp_backbtn").css("display","none");
 
- 	clear_search();
 
- }
 
- var showVideo = function(idx){
 
- 	var company_code = idx.target.getExtData().company_code;
 
- 	location.href = baseUrl + 'view/videoCam/index.jsp?theme='+theme+'&company_code='+company_code;
 
- }
 
- var showInformation = function(idx) {
 
-     var company_code = idx.target.getExtData().company_code;
 
-     for(var i=0;i<StatusStore.length;i++){
 
-         if(StatusStore[i].company_code==company_code){
 
-             var iconurl = StatusStore[i].fire_alarm?(baseUrl+'res/img/icons/01.png')
 
-                 :(StatusStore[i].water_alarm?(baseUrl+'res/img/icons/02.png')
 
-                     :(StatusStore[i].other_alarm?(baseUrl+'res/img/icons/03.png'):(baseUrl+'res/img/icons/00.png')));
 
-             $("#company_code").val(company_code);
 
-             Ext.create('Ext.window.Window', {
 
-                 title: StatusStore[i].company_name,
 
-                 icon:iconurl,
 
-                 width: 460,
 
-                 bodyPadding: 10,
 
-                 modal:true,
 
-                 items:  [{
 
-                     xtype: 'textfield',
 
-                     fieldLabel:'单位名称',
 
-                     width:300,
 
-                     value:StatusStore[i].company_name
 
-                 },{
 
-                     xtype: 'textfield',
 
-                     fieldLabel:'单位地址',
 
-                     width:430,
 
-                     value:StatusStore[i].fulladdress
 
-                 },{
 
-                     xtype: 'textfield',
 
-                     fieldLabel:'单位属性',
 
-                     width:240,
 
-                     value:StatusStore[i].xmlx
 
-                 },
 
-                 	Ext.create('Ext.panel.Panel',{
 
-                 		layout:{
 
-                 			type:'table',
 
-                 			columns:3
 
-                 		},
 
-                 		defaults:{
 
-                 			bodyStyle:'margin:0px;padding:0px;background:rgba(0,0,0,0);'
 
-                 		},
 
-                 		items:[{
 
-                 			html:'火警系统告警:',
 
-                 			width:120
 
-                 		},{
 
-                 			html:StatusStore[i].fire_alarm?'未处理':'已处理',
 
-                 			width:200
 
-                 		},{
 
-                 			html:'<button>查看</button>'
 
-                 		},{
 
-                 			html:'水系统告警:',
 
-                 			width:120
 
-                 		},{
 
-                 			html:StatusStore[i].water_alarm?'未处理':'已处理',
 
-                 			width:200
 
-                 		},{
 
-                 			html:'<button>查看</button>'
 
-                 		},{
 
-                 			html:'RTU告警:',
 
-                 			width:120
 
-                 		},{
 
-                 			html:StatusStore[i].other_alarm?'未处理':'已处理',
 
-                 			width:200
 
-                 		},{
 
-                 			html:'<button>查看</button>'
 
-                 		}]
 
-                 	})
 
-             ],
 
-                 buttons:[{
 
-                     text: '查询',
 
-                     iconCls: 'ok_btn',
 
-                     handler: function() {
 
-                     	show_alarm_list();
 
-                         this.up('window').hide();
 
-                     }
 
-                 },{
 
-                     text: '关闭',
 
-                     iconCls: 'cancel_btn',
 
-                     handler: function() {
 
-                         this.up('window').hide();
 
-                     }
 
-                 }],
 
-                 closeAction: 'hide'
 
-             }).show();
 
-             break;
 
-         }
 
-     }
 
- }
 
- var draw_confirm = function(){
 
- }
 
- var body_resize = function() {
 
-     if($(document).innerWidth()<1800){
 
-     	$("#saerch_company_list").css('top','120px');
 
-     	$("#bar5").css('top','90px');
 
-     }else{
 
-     	$("#saerch_company_list").css('top','80px');
 
-     	$("#bar5").css('top','50px');
 
-     }
 
- 	$("#alarm_wrapper_table").css('left',(($(document).innerWidth()-800)/2)+'px');
 
- 	$("#mask_l").css('height',$(document).innerHeight()+'px');
 
- 	$("#mask_r").css('height',$(document).innerHeight()+'px');
 
- }
 
- var drawCompany = function(){
 
-     if(StatusStore.length>0){
 
-         if(firstDraw)
 
-             map.clearMap();
 
-         else{
 
-             map.setZoomAndCenter(11,[centerLng,centerLat]);
 
-             map.setFitView();
 
-         }
 
-         var current_device_id='';
 
-         var device_count=0;
 
-         var fire_device_count=0;
 
-         var water_device_count=0;
 
-         var rtu_device_count=0;
 
-         var other_device_count=0;
 
-         var fire_device_out=0;
 
-         var water_device_out=0;
 
-         var rtu_device_out=0;
 
-         var other_device_out=0;
 
-         var fire_device_alarm=0;
 
-         var water_device_alarm=0;
 
-         var rtu_device_alarm=0;
 
-         var other_device_alarm=0;
 
-         var fire_device_normal=0;
 
-         var water_device_normal=0;
 
-         var rtu_device_normal=0;
 
-         var other_device_normal=0;
 
-         var total_normal=0;
 
-         var mark_array = new Array();
 
-         if(StatusStore.length==1){
 
-         	$("#search_company").val(StatusStore[0].company_name);
 
-         }
 
-         for(var i=0;i<StatusStore.length;i++){
 
-             var iconurl = (StatusStore[i].fire_alarm&&(viewAlarmType.substring(1,2)=='1'))?(baseUrl+'res/img/icons/01.gif')
 
-             		:((StatusStore[i].efire_alarm&&(viewAlarmType.substring(2,3)=='1'))?(baseUrl+'res/img/icons/01.png')
 
-             				:((StatusStore[i].water_alarm&&(viewAlarmType.substring(3,4)=='1'))?(baseUrl+'res/img/icons/02.png')
 
-             						:((StatusStore[i].other_alarm&&(viewAlarmType.substring(6,7)=='1'))?(baseUrl+'res/img/icons/03.png')
 
-             								:(baseUrl+'res/img/icons/00.png'))));
 
-             currentLat = StatusStore[i].lat;
 
-             currentLng = StatusStore[i].lng;
 
-             var markers= new AMap.Marker({
 
-                 icon:iconurl,
 
-                 position: new AMap.LngLat(StatusStore[i].lng,StatusStore[i].lat),
 
-                 title:StatusStore[i].company_name,
 
-                 extData:{
 
-                 	icontype:'company',
 
-                     company_code:StatusStore[i].company_code
 
-                 },
 
-                 offset: new AMap.Pixel(-12, -12),
 
-                 draggable:true,
 
-                 raiseOnDrag:true,
 
-                 autoRotation:true,
 
-                 label:StatusStore[i].company_name
 
-             });
 
-             if((StatusStore[i].lng>100)&&(StatusStore[i].lng<130)&&(StatusStore[i].lat>29)&&(StatusStore[i].lat<37))
 
-             	mark_array.push(markers);
 
-             AMap.event.addListener(markers,'click',showBuilding,this);
 
-             markers.setMap(map);
 
-             if(StatusStore.length==1){
 
-             	if(StatusStore[i].company_code=='10122'){
 
-             		 var markers= new AMap.Marker({
 
-                          icon:baseUrl+'res/img/icons/video.png',
 
-                          position: new AMap.LngLat(StatusStore[i].lng,StatusStore[i].lat),
 
-                          title:StatusStore[i].company_name,
 
-                          extData:{
 
-                         	 icontype:'camvideo',
 
-                              company_code:StatusStore[i].company_code
 
-                          },
 
-                          offset: new AMap.Pixel(-12, -48),
 
-                          draggable:true,
 
-                          raiseOnDrag:true,
 
-                          autoRotation:true,
 
-                          label:StatusStore[i].company_name+'.摄像机'
 
-                          
 
-                      });
 
-             		 AMap.event.addListener(markers,'click',showVideo,this);
 
-                      markers.setMap(map);
 
-                      mark_array.push(markers);
 
-             	}
 
-             }
 
-         }
 
- //        var persent = Number(((total_normal*100)/device_count).toString().match(/^\d+(?:\.\d{0,2})?/));
 
-         var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
 
-         for(var i=0;i<ConfirmStore.length;i++){
 
-     		if(ConfirmStore[i].id=='fire_info'){
 
-     			draw_cycle_icon2('fire_confirm','火灾系统报告'
 
-     					,'处理比率:',ConfirmStore[i].alarm,ConfirmStore[i].alarmConfirm,themecolor);
 
-     	        draw_cycle_icon('fire_alarm','火灾设备'
 
-       	              ,ConfirmStore[i].device,0,ConfirmStore[i].outConfirm,ConfirmStore[i].out-ConfirmStore[i].outConfirm,themecolor);    			
 
-     		}
 
-     		else if(ConfirmStore[i].id=='water_info'){
 
-     			draw_cycle_icon2('water_confirm','水系统报告'
 
-     					,'处理比率:',ConfirmStore[i].alarm,ConfirmStore[i].alarmConfirm,themecolor);
 
-     	        draw_cycle_icon('water_alarm','水系统设备'
 
-     	        		,ConfirmStore[i].device,0,ConfirmStore[i].outConfirm,ConfirmStore[i].out-ConfirmStore[i].outConfirm,themecolor);     			    			
 
-     		}
 
-     		else if(ConfirmStore[i].id=='rtu_info'){
 
-     			draw_cycle_icon2('rtu_confirm','RTU报告'
 
-     					,'处理比率:',ConfirmStore[i].alarm,ConfirmStore[i].alarmConfirm,themecolor);
 
-     	        draw_cycle_icon('rtu_alarm','RTU设备'
 
-     	        		,ConfirmStore[i].device,0,ConfirmStore[i].outConfirm,ConfirmStore[i].out-ConfirmStore[i].outConfirm,themecolor); 
 
-     		}
 
-     		else if(ConfirmStore[i].id=='efire_info'){
 
-     			draw_cycle_icon2('efire_confirm','电气火灾报告'
 
-     					,'处理比率:',ConfirmStore[i].alarm,ConfirmStore[i].alarmConfirm,themecolor);
 
-     	        draw_cycle_icon('efire_alarm','电气火灾设备'
 
-     	        		,ConfirmStore[i].device,0,ConfirmStore[i].outConfirm,ConfirmStore[i].out-ConfirmStore[i].outConfirm,themecolor); 
 
-     		}
 
-         }
 
-     	if(AlarmStore.length>0)
 
-     		$("#alarm_wrapper").html("["+AlarmStore[0].time+"] "+AlarmStore[0].data+" "+AlarmStore[0].company+" "+AlarmStore[0].name);
 
-         if(!firstDraw)
 
-         	map.setFitView(mark_array,true,[20,20,20,20],22);
 
-         firstDraw = true;
 
-         rotation = 0;
 
-         map.setRotation(rotation);
 
-         if(StatusStore.length==1){
 
-             map.setZoom(20);
 
-         	map.setPitch(60);
 
-             map.setCenter([currentLng,currentLat]);
 
-         }else{
 
-         	mapzoom = map.getZoom();
 
-         	map.setPitch(45);
 
-         }
 
-     }
 
- }
 
- var changeMapView = function(type){
 
- 	$("#viewAlarmType").val(type);
 
- 	viewAlarmType = type;
 
- 	draw_all();
 
- }
 
- var changeAlarmView = function(type){
 
- 	$("#pieAlarmType").val(type);
 
- 	pieAlarmType = type;
 
- 	draw_all();
 
- }
 
- var changeStatusView = function(type){
 
- 	$("#statusType").val(type);
 
- 	statusType = type;
 
- 	draw_all();
 
- }
 
- var createStatusPieTable = function(p,pheight,id,fun){
 
- 	var div = document.createElement('div');
 
- 	div.style.width = '276px';
 
- 	div.style.heigh = '136px';
 
- 	div.style.margin = '10px';
 
- 	div.style.padding = '4px 0px 0px 16px';
 
- 	div.style.position = 'absolution';
 
- 	div.style.left = '0px';
 
- 	div.style.top = pheight+'px';
 
- 	div.style.cursor = 'pointer';
 
- 	div.onclick = fun;
 
- 	div.style.background = 'url(../res/img/pie_background2.png) no-repeat';
 
- 	p.appendChild(div);
 
- 	var table = document.createElement('table');
 
- 	table.border='0';
 
- 	table.onclick = fun;
 
- 	table.style.margin = '4px 0px 0px 0px';
 
- 	table.style.border = '0px solid #000;';
 
- 	table.style.width = '260px';
 
- 	table.style.height = '120px';
 
- 	div.appendChild(table);
 
- 	var trr = document.createElement('tr');
 
- 	table.appendChild(trr);
 
- 	var td99 = document.createElement('td');
 
- 	trr.appendChild(td99);
 
- 	var table7 = document.createElement('table');
 
- 	td99.appendChild(table7);
 
- 	var trtitle = document.createElement('tr');
 
- 	table7.appendChild(trtitle);
 
- 	var th = document.createElement('th');
 
- 	th.style.border='0px solid #000';
 
- 	th.style.textAlign='left';
 
- 	th.style.fontSize='16px';
 
- 	th.style.fontWeight='bold';
 
- 	th.style.overflow='hidden';
 
- 	th.style.color='#ffffff';
 
- 	trtitle.appendChild(th);
 
- 	var tr = document.createElement('tr');
 
- 	tr.border='0';
 
- 	tr.style.border='0px solid #000';
 
- 	tr.style.height='20px';
 
- 	table7.appendChild(tr);
 
- 	var td2 = document.createElement('td');
 
- 	trr.appendChild(td2);
 
- 	var table2 = document.createElement('table');
 
- 	table2.style.color = '#dcdcdc';
 
- 	table2.style.fontSize='12px';
 
- 	table2.style.fontFamily = '"微软雅黑", Microsoft YaHei';
 
- 	td2.appendChild(table2);
 
- 	var div_title = document.createElement('div');
 
- 	div_title.id = id+'_label_title';
 
- 	th.appendChild(div_title);
 
- 	var tr2 = document.createElement('tr');
 
- 	tr2.border='0';
 
- 	tr2.style.border='0px solid #000';
 
- //	tr2.style.height='40px';
 
- 	table2.appendChild(tr2);
 
- 	var td5 = document.createElement('td');
 
- 	td5.style.border='0px solid #000';
 
- 	td5.style.width='104px';
 
- 	td5.style.height='104px';
 
- 	tr.appendChild(td5);
 
- 	var div_pie2 = document.createElement('div');
 
- 	div_pie2.id = id+'_pie';
 
- 	div_pie2.style.width='104px';
 
- 	div_pie2.style.height='104px';
 
- 	td5.appendChild(div_pie2);
 
- 	var td22 = document.createElement('td');
 
- 	tr2.appendChild(td22);
 
- 	var table3 = document.createElement('table');
 
- 	table3.style.color = '#dcdcdc';
 
- 	table3.style.fontSize='12px';
 
- 	table3.style.width = '156px';
 
- 	table3.style.fontFamily = '"微软雅黑", Microsoft YaHei';
 
- 	td22.appendChild(table3);
 
- 	var tr5 = document.createElement('tr');
 
- 	table3.appendChild(tr5);
 
- 	var td4 = document.createElement('td');
 
- 	td4.style.border='0px solid #000';
 
- 	td4.style.width='50px';
 
- 	td4.style.paddingTop = '12px';
 
- 	td4.style.height = '26px';
 
- 	td4.style.textAlign = 'left';
 
- 	td4.style.height ='24px';
 
- 	td4.innerHTML='设备数量',
 
- 	tr5.appendChild(td4);
 
- 	var td6 =document.createElement('td');
 
- 	td6.style.border='0px solid #000';
 
- 	td6.style.width='90px';
 
- 	td6.style.paddingTop = '0px';
 
- 	td6.style.textAlign = 'left';
 
- 	td6.id = id+'_label_text_0';
 
- 	td6.style.color='#ffffff';
 
- 	td6.style.fontSize='24px';
 
- //	td6.style.fontWeight = 'bold';
 
- 	tr5.appendChild(td6);
 
- 	var tr3 = document.createElement('tr');
 
- 	tr3.border='0';
 
- 	tr3.style.border='0px solid #000';
 
- 	table3.appendChild(tr3);
 
- 	var tr33 = document.createElement('tr');
 
- 	table3.appendChild(tr33);
 
- 	var td7 = document.createElement('td');
 
- 	td7.style.border='0px solid #000';
 
- 	td7.style.width='50px';
 
- 	td7.style.paddingTop = '12px';
 
- 	td7.style.height = '26px';
 
- 	td7.style.textAlign = 'left';
 
- 	td7.innerHTML='已处理',
 
- 	tr33.appendChild(td7);
 
- 	var td8 =document.createElement('td');
 
- 	td8.style.border='0px solid #000';
 
- 	td8.style.width='90px';
 
- 	td8.style.paddingTop = '0px';
 
- 	td8.style.textAlign = 'left';
 
- 	td8.id = id+'_label_text_2';
 
- 	td8.style.color='#31e9ff';
 
- 	td8.style.fontSize='24px';
 
- 	tr33.appendChild(td8);
 
- 	td8.innerHTML='0';
 
- 	var tr4 = document.createElement('tr');
 
- 	table3.appendChild(tr4);
 
- 	var td9 = document.createElement('td');
 
- 	td9.style.border='0px solid #000';
 
- 	td9.style.width='50px';
 
- 	td9.style.height='26px';
 
- 	td9.style.paddingTop = '12px';
 
- 	td9.style.textAlign = 'left';
 
- 	td9.innerHTML='待处理',
 
- 	tr4.appendChild(td9);
 
- 	var td10 =document.createElement('td');
 
- 	td10.style.border='0px solid #000';
 
- 	td10.style.width='90px';
 
- 	td10.style.paddingTop = '0px';
 
- 	td10.style.textAlign = 'left';
 
- 	td10.id = id+'_label_text_3';
 
- 	td10.style.color='#f66167';
 
- 	td10.style.fontSize='24px';
 
- //	td10.style.fontWeight = 'bold';
 
- 	tr4.appendChild(td10);
 
- 	td10.innerHTML='0';
 
- 	pheight += 156;
 
- 	p.style.height=pheight+'px';
 
- }
 
- var createAlarmPieTable = function(p,pheight,id1,id2,fun){
 
- 	var div = document.createElement('div');
 
- 	div.style.width = '276px';
 
- 	div.style.heigh = '136px';
 
- 	div.style.margin = '10px';
 
- 	div.style.padding = '8px 0px 8px 16px';
 
- 	div.style.position = 'absolution';
 
- 	div.style.left = '0px';
 
- 	div.style.top = pheight+'px';
 
- 	div.style.cursor = 'pointer';
 
- 	div.onclick = fun;
 
- 	div.style.background = 'url(../res/img/pie_background2.png) no-repeat';
 
- 	p.appendChild(div);
 
- 	var table = document.createElement('table');
 
- 	table.border='0';
 
- 	table.style.border = '0px solid #000;';
 
- 	table.style.width = '260px';
 
- 	table.style.height = '120px';
 
- 	table.style.overflow = 'hidden';
 
- 	div.appendChild(table);
 
- 	var tr = document.createElement('tr');
 
- 	tr.border='0';
 
- 	tr.style.border='0px solid #000';
 
- 	tr.style.height='20px';
 
- 	table.appendChild(tr);
 
- 	var td2 = document.createElement('td');
 
- 	tr.appendChild(td2);
 
- 	var table2 = document.createElement('table');
 
- 	table2.style.color = '#dcdcdc';
 
- 	table2.style.fontSize='12px';
 
- 	table2.style.fontFamily = '"微软雅黑", Microsoft YaHei';
 
- 	td2.appendChild(table2);
 
- 	var trr = document.createElement('tr');
 
- 	table2.appendChild(trr);
 
- 	var th = document.createElement('th');
 
- 	th.style.border='0px solid #000';
 
- 	th.style.textAlign='left';
 
- 	th.style.fontSize='16px';
 
- 	th.style.fontWeight='bold';
 
- 	th.style.overflow='hidden';
 
- 	th.style.color='#ffffff';
 
- 	th.colSpan='2';
 
- 	trr.appendChild(th);
 
- 	var div_title = document.createElement('div');
 
- 	div_title.id = id2+'_label_title';
 
- 	th.appendChild(div_title);
 
- 	var tr2 = document.createElement('tr');
 
- 	tr2.border='0';
 
- 	tr2.style.border='0px solid #000';
 
- //	tr2.style.height='40px';
 
- 	table2.appendChild(tr2);
 
- 	var td4 = document.createElement('td');
 
- 	td4.style.border='1px solid rgba(0,0,0,0)';
 
- 	td4.style.width='50px';
 
- 	td4.style.height = '50px';
 
- 	td4.style.paddingTop = '38px';
 
- 	td4.style.textAlign = 'left';
 
- 	td4.innerHTML='总数',
 
- 	tr2.appendChild(td4);
 
- 	var td6 =document.createElement('td');
 
- 	td6.style.border='1px solid rgba(0,0,0,0)';
 
- 	td6.style.paddingTop='26px';
 
- 	td6.style.width='90px';
 
- //	td6.style.verticalAlign = 'bottom';
 
- 	td6.style.textAlign = 'left';
 
- 	td6.id = id2+'_label_text_0';
 
- 	td6.style.color='#31e9ff';
 
- 	td6.style.fontSize='24px';
 
- //	td6.style.fontWeight = 'bold';
 
- 	tr2.appendChild(td6);
 
- 	var tr3 = document.createElement('tr');
 
- 	tr3.border='0';
 
- 	tr3.style.border='0px solid #000';
 
- //	tr3.style.height='40px';
 
- 	table2.appendChild(tr3);
 
- 	var td41 = document.createElement('td');
 
- 	td41.style.border='1px solid rgba(0,0,0,0)';
 
- 	td41.style.width='50px';
 
- 	td41.style.height = '24px';
 
- 	td41.style.paddingTop = '12px';
 
- 	td41.style.textAlign = 'left';
 
- 	td41.innerHTML='待处理',
 
- 	tr3.appendChild(td41);
 
- 	var td61 =document.createElement('td');
 
- 	td61.style.border='1px solid  rgba(0,0,0,0)';
 
- 	td61.style.width='90px';
 
- 	td61.style.paddingTop = '0px';
 
- 	td61.style.textAlign = 'left';
 
- 	td61.id = id2+'_label_text_1';
 
- 	td61.style.color='#f66167';
 
- 	td61.style.fontSize='24px';
 
- //	td61.style.fontWeight = 'bold';
 
- 	tr3.appendChild(td61);
 
- 	var tr4 = document.createElement('tr');
 
- 	table2.appendChild(tr4);
 
- 	var td5 = document.createElement('td');
 
- 	td5.style.border='0px solid #000';
 
- 	td5.style.width='120px';
 
- 	td5.style.height='120px';
 
- 	td5.rowspan = '2';
 
- 	tr.appendChild(td5);
 
- 	var div_pie2 = document.createElement('div');
 
- 	div_pie2.id = id2+'_pie';
 
- 	div_pie2.style.width='120px';
 
- 	div_pie2.style.height='120px';
 
- 	td5.appendChild(div_pie2);
 
- 	pheight += 156;
 
- 	p.style.height=pheight+'px';
 
- }
 
- var draw_all = function(){
 
- 	myMask.hide();
 
-     var alarm_pie_bar = document.getElementById('alarm_pie_bar');
 
-     var device_pie_bar = document.getElementById('device_pie_bar');
 
-     var alarmBarHeight = 0;
 
-     var deviceBarHeight = 0;
 
-     alarm_pie_bar.innerHTML='';
 
-     device_pie_bar.innerHTML='';
 
-     alarm_pie_bar.style.height = alarmBarHeight+'px';
 
-     alarm_pie_bar.style.width = '296px';
 
-     device_pie_bar.style.height = deviceBarHeight+'px';
 
-     device_pie_bar.style.width = '296px';
 
-     if(pieAlarmType.substring(1,2)=='1'){//火灾监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'fire_alarm2','fire_confirm',show_all_fireAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(pieAlarmType.substring(2,3)=='1'){//电气火灾监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'efire_alarm2','efire_confirm',show_all_efireAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(pieAlarmType.substring(3,4)=='1'){//水系统监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'water_alarm2','water_confirm',show_all_waterAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(pieAlarmType.substring(4,5)=='1'){//通道监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'access_alarm2','access_confirm',show_all_accessAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(pieAlarmType.substring(5,6)=='1'){//消防电源监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'power_alarm2','power_confirm',show_all_powerAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(pieAlarmType.substring(6,7)=='1'){//rtu监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'rtu_alarm2','rtu_confirm',show_all_rtuAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(pieAlarmType.substring(7,8)=='1'){//烟感监控告警
 
-     	createAlarmPieTable(alarm_pie_bar,alarmBarHeight,'smoke_alarm2','smoke_confirm',show_all_smokeAlarm);
 
-     	alarmBarHeight += 156;
 
-     }
 
-     if(statusType.substring(1,2)=='1'){//火灾监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'fire_alarm',show_all_fireDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
-     if(statusType.substring(2,3)=='1'){//电气火灾监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'efire_alarm',show_all_efireDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
-     if(statusType.substring(3,4)=='1'){//水系统监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'water_alarm',show_all_waterDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
-     if(statusType.substring(4,5)=='1'){//通道监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'access_alarm',show_all_accessDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
-     if(statusType.substring(5,6)=='1'){//消防用电监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'power_alarm',show_all_powerDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
-     if(statusType.substring(6,7)=='1'){//RTU监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'rtu_alarm',show_all_rtuDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
-     if(statusType.substring(7,8)=='1'){//烟感监控设备
 
-     	createStatusPieTable(device_pie_bar,deviceBarHeight,'smoke_alarm',show_all_smokeDevice);
 
-     	deviceBarHeight += 156;
 
-     }
 
- 	drawCompany();
 
- //	draw_confirm();
 
- }
 
- var show_all_smokeAlarm = function(){
 
- 	
 
- }
 
- var show_all_smokeDevice = function(){
 
- 	
 
- }
 
- var clear_search = function(){
 
- 	$("#fp_backbtn").css("display","none");
 
- 	$("#company_code",window.parent.document).val('');
 
- 	firstDraw = true;
 
- 	if($("#search_company").val().length>0){
 
- 		$("#search_company").val('');
 
- 		$("#company_code").val('');
 
- 		$("#saerch_company_list").html('');
 
- 		map.setZoom(mapzoom);
 
- 		map.setCenter([121.475644, 31.1857]);
 
- 		getCurrentData2();
 
- 	}
 
- }
 
- var update_companyList = function(){
 
- 	map.setZoom(mapzoom);
 
- 	$("#saerch_company_list").html('');
 
- 	if($("#search_company").val().length>0){
 
- 		var query = new Object();
 
- 		// query.V_LOGINNAME = V_LOGINNAME;
 
- 		// query.V_PASSWORD = V_PASSWORD;
 
- 		query.V_COMPANY_NAME = $("#search_company").val();
 
- 		$.ajax({
 
- 			type:'POST',
 
- 			url:baseUrl+"/iot/company/getList",
 
- 			data:{
 
- 				queryJson : Ext.JSON.encode(query),
 
- 				sort :"[{property:'V_COMPANY_NAME',direction:'ASC'}]"
 
- 			},
 
- 			success:function(result){
 
- 				var json = eval('(' + result + ')');
 
- 				if(json.action=='getCompanyList'){
 
- 					var list = json.RESULT;
 
- 					if(list.length>0){
 
- 						var saerch_company_list = document.getElementById('saerch_company_list');
 
- 						var table = document.createElement('table');
 
- 						table.border='0';
 
- 						table.style.width='300px';
 
- 						table.style.border='0px solid #000';
 
- 						saerch_company_list.appendChild(table);
 
- 						for(var i=0;i<list.length;i++){
 
- 							var tr = document.createElement('tr');
 
- 							tr.style.border='0px solid #000';
 
- 							table.appendChild(tr);
 
- 							var td = document.createElement('td');
 
- 							td.id='company_code_list_'+list[i].V_COMPANY_CODE;
 
- 							td.company_code=list[i].V_COMPANY_CODE;
 
- 							td.style.border='1px solid rgba(255,255,255,0.0)';
 
- 							td.style.background = 'rgba(255,255,255,0.3)';
 
- 							td.style.fontSize = '14px';
 
- 							td.style.cursor = "pointer";
 
- 							td.innerHTML=list[i].V_COMPANY_NAME;
 
- 							tr.appendChild(td);
 
- 							$("#company_code_list_"+list[i].V_COMPANY_CODE).mouseover(function(){
 
- 								$(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"});
 
- 							});
 
- 							$("#company_code_list_"+list[i].V_COMPANY_CODE).mouseout(function(){
 
- 								$(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"});
 
- 							});
 
- 							$("#company_code_list_"+list[i].V_COMPANY_CODE).click(function(e){
 
- 								var id = e.target.company_code;
 
- 								var name = e.target.innerHTML;
 
- 								$("#search_company").val(name);
 
- 								$("#company_code").val(id);
 
- 								$("#saerch_company_list").html('');
 
- 								$("#fp_backbtn").css("display","block");
 
- 								getCurrentData2();
 
- 							});
 
- 						}
 
- 					}
 
- 				}
 
- 			}
 
- 		});
 
- 	}
 
- }
 
- var getCurrentData2 = function(){
 
- 	
 
- 	myMask = new Ext.LoadMask(Ext.getBody(), {    
 
-         msg: '查询中,请稍后!',   
 
-         cls:'toplevel',
 
-         removeMask: true //完成后移除    
 
- 	}); 
 
- 	myMask.show();
 
- 	synctime = (new Date()).getTime();
 
- 	$("#alarm_wrapper").html('Loading......');
 
- 	var query = new Object();
 
- 	query.V_LOGINNAME = V_LOGINNAME;
 
- 	query.V_PASSWORD = V_PASSWORD;
 
- 	query.QUERY_FROM = 'FRONTPAGE';
 
- 	query.COMMSTATUS = "NO";
 
- 	query.V_COMMAND = 'FRONTPAGE';
 
- //	query.point_code = '0';
 
- //	query.clzt = '0';
 
- 	if($("#company_code").val().length>0)
 
- 		query.company_code = $("#company_code").val();
 
- 	var qurl = baseUrl+'/cgi-bin/WebAction.cgi';
 
- //	 if((baseUrl.indexOf('localhost')>=0)||(baseUrl.indexOf('127.0.0.1')>=0))
 
- 		qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
 
- //	ConfirmStore=null;
 
- //	StatusStore=null;
 
- 	$("#FireAlarmWinmdow").attr("src",'fireAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
- 	$("#FireAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
- 	$("#FireAlarmWinmdow").attr("frameborder",'0');
 
- 	$("#WaterAlarmWinmdow").attr("src",'waterAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
- 	$("#WaterAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
- 	$("#WaterAlarmWinmdow").attr("frameborder",'0');
 
- 	$("#RtuAlarmWinmdow").attr("src",'rtuAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
- 	$("#RtuAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
- 	$("#RtuAlarmWinmdow").attr("frameborder",'0');
 
-     $.ajax({
 
-         type:'POST',
 
-         url: qurl,
 
-         data: {
 
-         	queryJson : Ext.JSON.encode(query)
 
-     	},
 
-         success: function(result){
 
-             var json = eval('(' + result + ')');
 
-             if(json.action=='getSyncStatusVListByCompany'){
 
-             	if(json.check=='true'){
 
- 	                StatusStore = json.RESULT;
 
- 	                centerLng = json.avelng;
 
- 	                centerLat = json.avelat;
 
- 	                ConfirmStore = json.confirm_status;
 
- 	                AlarmStore = json.ALARM_LIST;
 
-                 	draw_all();
 
-                 	if((StatusStore.length==1)&&($("#company_code").val().length>0)){
 
-                 		var fireAlarm = false;
 
-                 		var waterAlarm = false;
 
-                 		var rtuAlarm = false;
 
-                 		if(ConfirmStore.length>0){
 
-                 			for(var i=0;i<ConfirmStore.length;i++){
 
-                 				if(ConfirmStore[i].id=='fire_info'){
 
-                 					if(ConfirmStore[i].alarmConfirm<ConfirmStore[i].alarm)
 
-                 						fireAlarm = true;
 
-                 				}else if(ConfirmStore[i].id=='water_info'){
 
-                 					if(ConfirmStore[i].alarmConfirm<ConfirmStore[i].alarm)
 
-                 						waterAlarm = true;
 
-                 				}else if(ConfirmStore[i].id=='rtu_info'){
 
-                 					if(ConfirmStore[i].alarmConfirm<ConfirmStore[i].alarm)
 
-                 						rtuAlarm = true;
 
-                 				}
 
-                 			}
 
-                 		}
 
-             			var iconurl = StatusStore[0].fire_alarm?(baseUrl+'res/img/icons/01.png')
 
-             	                :(StatusStore[0].water_alarm?(baseUrl+'res/img/icons/02.png')
 
-             	                    :(StatusStore[0].other_alarm?(baseUrl+'res/img/icons/03.png'):(baseUrl+'res/img/icons/00.png')));
 
-             	            Ext.create('Ext.window.Window', {
 
-             	                title: StatusStore[0].company_name,
 
-             	                icon:iconurl,
 
-             	                width: 460,
 
-             	                bodyPadding: 10,
 
-             	                modal:true,
 
-             	                items:  [{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             		                    xtype: 'textfield',
 
-             		                	columnWidth:.95,
 
-             		                    fieldLabel:'单位名称',
 
-             		                    width:300,
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    background: 'rgba(0,0,0,0)',
 
-             		                    value:StatusStore[0].company_name
 
-             	                	},{
 
-             	                	}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             		                    xtype: 'textfield',
 
-             		                	columnWidth:.95,
 
-             		                    fieldLabel:'单位地址',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:430,
 
-             		                    value:StatusStore[0].fulladdress
 
-             	                	},{
 
-             	                	}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             		                    xtype: 'textfield',
 
-             		                	columnWidth:.46,
 
-             		                    fieldLabel:'单位属性',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:240,
 
-             		                    value:StatusStore[0].xmlx
 
-             	                	},{}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             		                	columnWidth:.46,
 
-             		                    xtype: 'textfield',
 
-             		                    fieldLabel:'火警系统报告',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:200,
 
-             		                    value:fireAlarm?'待处理':'已处理',
 
-     		                    		fieldStyle:fireAlarm?'color:#f66167':'color:#000000'
 
-             	                	},{
 
-             	                		columnWidth:.20
 
-             	                	},{
 
-             	                		xtype:'button',
 
-             	                		text:'查看',
 
-             	                		handler:function(){
 
-             	                			show_all_fireAlarm();
 
-                             			}
 
-                                 	}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             		                    xtype: 'textfield',
 
-             		                	columnWidth:.46,
 
-             		                    fieldLabel:'水系统报告',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:200,
 
-             		                    value:waterAlarm?'待处理':'已处理',
 
-     		                    		fieldStyle:waterAlarm?'color:#f66167':'color:#000000'
 
-             	                	},{
 
-             	                		columnWidth:.20
 
-             	                	},{
 
-             	                		xtype:'button',
 
-             	                		text:'查看',
 
-             	                		handler:function(){
 
-             	                			show_all_waterAlarm();
 
-                             			}
 
-                                 	}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             		                	columnWidth:.46,
 
-             		                    xtype: 'textfield',
 
-             		                    fieldLabel:'RTU报告',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:200,
 
-             		                    value:rtuAlarm?'待处理':'已处理',
 
-     		                    		fieldStyle:rtuAlarm?'color:#f66167':'color:#000000'
 
-             	                	},{
 
-             	                		columnWidth:.20
 
-             	                	},{
 
-             	                		xtype:'button',
 
-             	                		text:'查看',
 
-             	                		handler:function(){
 
-             	                			show_all_rtuAlarm();
 
-                             			}
 
-                                 	}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	items:[{
 
-             	                		columnWidth:.50,
 
-             		                	xtype: 'textfield',
 
-             		                    fieldLabel:'联系人',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:240,
 
-             		                    value:StatusStore[0].username
 
-             	                	}]
 
-             	                },{
 
-             	                	layout:'column',
 
-             	                	style:{
 
-             	                		backgroundColor: 'rgba(0,0,0,0)',
 
-             	                		border: '0px solid #000000'
 
-             	                	},
 
-             	                	items:[{
 
-             	                		columnWidth:.80,
 
-             		                	xtype: 'textfield',
 
-             		                    fieldLabel:'联系电话',
 
-             		                    disabled:true,
 
-             		                    disabledCls:'x-item-disabled-new',
 
-             		                    width:400,
 
-             		                    value:StatusStore[0].phone
 
-             	                	}]
 
-             	                }],
 
-             	                buttons:[{
 
-             	                    text: '查询',
 
-             	                    iconCls: 'ok_btn',
 
-             	                    handler: function() {
 
-             	                    	show_alarm_list();
 
-             	                        this.up('window').hide();
 
-             	                    }
 
-             	                },{
 
-             	                    text: '关闭',
 
-             	                    iconCls: 'cancel_btn',
 
-             	                    handler: function() {
 
-             	                        this.up('window').hide();
 
-             	                    }
 
-             	                }],
 
-             	                closeAction: 'hide'
 
-             	            }).show();
 
-             			try{
 
-                         	map.setCenter([StatusStore[0].lng,StatusStore[0].lat]);
 
-             			}catch(e){}
 
-                         map.setZoom(20);
 
-                 	}
 
-             	}else{
 
-             		Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
 
-             			window.parent.document.location=baseUrl;
 
-             		});
 
-             	}
 
-             }
 
-             myMask.hide();
 
-         }
 
-     });
 
- }
 
- var getCurrentData = function(){
 
- 	if(((new Date()).getTime()-synctime)<storeTime)
 
- 		return;
 
- 	$("#fp_backbtn").css("display","none");
 
- 	synctime = (new Date()).getTime();
 
- 	var query = new Object();
 
- 	query.V_LOGINNAME = V_LOGINNAME;
 
- 	query.V_PASSWORD = V_PASSWORD;
 
- 	query.QUERY_FROM = 'FRONTPAGE';
 
- 	query.V_COMMAND = 'FRONTPAGE';
 
- 	query.COMMSTATUS = "NO";
 
- //	query.point_code = '0';
 
- //	query.clzt = '0';
 
- 	if($("#company_code").val().length>0)
 
- 		query.company_code = $("#company_code").val();
 
- //	ConfirmStore=null;
 
- //	StatusStore=null;
 
- 	var qurl = baseUrl+'/cgi-bin/WebAction.cgi';
 
- //	 if((baseUrl.indexOf('localhost')>=0)||(baseUrl.indexOf('127.0.0.1')>=0))
 
- 		qurl = 'http://47.103.74.123:8080/YtIoT/cgi-bin/WebAction.cgi';
 
-     $.ajax({
 
-         type:'POST',
 
-         url: qurl,
 
-         data: {
 
-         	queryJson : Ext.JSON.encode(query)
 
-     	},
 
-         success: function(result){
 
-             var json = eval('(' + result + ')');
 
-             if(json.action=='getSyncStatusVListByCompany'){
 
-             	if(json.check=='true'){
 
- 	                StatusStore = json.RESULT;
 
- 	                centerLng = json.avelng;
 
- 	                centerLat = json.avelat;
 
- 	                ConfirmStore = json.confirm_status;
 
- 	                AlarmStore = json.ALARM_LIST;
 
- 	                if(StatusStore.length==1){
 
- 	                	$("#company_code").val(StatusStore[0].company_code);
 
- 	                	$("#company_code",window.parent.document).val(StatusStore[0].company_code);
 
- 	                }
 
- //	                if(ConfirmStore!=null){
 
- 	                	draw_all();
 
- //	                }
 
-             	}else{
 
-             		Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
 
-             			window.parent.document.location=baseUrl;
 
-             		});
 
-             	}
 
-             	
 
-             }
 
-             myMask.hide();
 
-         }
 
-     });
 
-     setTimeout(getCurrentData,storeTime);
 
- }
 
- var mapRotation = function(){
 
- 	if((ConfirmStore!=null)&&(StatusStore.length==1)){
 
- //		start += 20;
 
- //		if(start>360)
 
- //			start -=360;
 
- //		draw_confirm();
 
- 	    rotation = (rotation-1);
 
- 	    if(rotation<0)
 
- 	        rotation = 359;
 
- 	    map.setRotation(rotation);
 
- 	}
 
-     setTimeout(mapRotation,2000);
 
- }
 
- var renderIcons = function () {
 
-     if (!this.series[0].icon) {
 
-         this.series[0].icon = this.renderer.path(['M', -8, 0, 'L', 8, 0, 'M', 0, -8, 'L', 8, 0, 0, 8])
 
-             .attr({
 
-                 'stroke': '#303030',
 
-                 'stroke-linecap': 'round',
 
-                 'stroke-linejoin': 'round',
 
-                 'stroke-width': 2,
 
-                 'zIndex': 10
 
-             })
 
-             .add(this.series[2].group);
 
-     }
 
-     this.series[0].icon.translate(
 
-         this.chartWidth / 2 - 10,
 
-         this.plotHeight / 2 - this.series[0].points[0].shapeArgs.innerR -
 
-             (this.series[0].points[0].shapeArgs.r - this.series[0].points[0].shapeArgs.innerR) / 2
 
-     );
 
-     if (!this.series[1].icon) {
 
-         this.series[1].icon = this.renderer.path(
 
-             ['M', -8, 0, 'L', 8, 0, 'M', 0, -8, 'L', 8, 0, 0, 8,
 
-                 'M', 8, -8, 'L', 16, 0, 8, 8]
 
-             )
 
-             .attr({
 
-                 'stroke': '#ffffff',
 
-                 'stroke-linecap': 'round',
 
-                 'stroke-linejoin': 'round',
 
-                 'stroke-width': 2,
 
-                 'zIndex': 10
 
-             })
 
-             .add(this.series[2].group);
 
-     }
 
-     this.series[1].icon.translate(
 
-         this.chartWidth / 2 - 10,
 
-         this.plotHeight / 2 - this.series[1].points[0].shapeArgs.innerR -
 
-             (this.series[1].points[0].shapeArgs.r - this.series[1].points[0].shapeArgs.innerR) / 2
 
-     );
 
-     if (!this.series[2].icon) {
 
-         this.series[2].icon = this.renderer.path(['M', 0, 8, 'L', 0, -8, 'M', -8, 0, 'L', 0, -8, 8, 0])
 
-             .attr({
 
-                 'stroke': '#303030',
 
-                 'stroke-linecap': 'round',
 
-                 'stroke-linejoin': 'round',
 
-                 'stroke-width': 2,
 
-                 'zIndex': 10
 
-             })
 
-             .add(this.series[2].group);
 
-     }
 
-     this.series[2].icon.translate(
 
-         this.chartWidth / 2 - 10,
 
-         this.plotHeight / 2 - this.series[2].points[0].shapeArgs.innerR -
 
-             (this.series[2].points[0].shapeArgs.r - this.series[2].points[0].shapeArgs.innerR) / 2
 
-     );
 
- }
 
- var draw_cycle_icon2 = function(Id, title, name, total, num, themecolor){
 
-     var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
 
-     var percent = 100;
 
-     if(total>0)
 
-         percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
 
-     if(percent<60)
 
-         mColor = '#f66167';
 
-     else if(percent<80)
 
-         mColor = '#DDDF0D';
 
-     var label_id_title = Id+'_label_title';
 
-     var label_id_text = Id+'_label_text';
 
-     var icon_id = Id+'_pie';
 
-     if((document.getElementById(icon_id)==null)
 
-     		||(document.getElementById(icon_id)=='undefined'))
 
-     	return;
 
-     if(title.length>0)
 
-     	document.getElementById(label_id_title).innerHTML=title;
 
-     document.getElementById(label_id_text+'_0').innerHTML=total;
 
-     document.getElementById(label_id_text+'_1').innerHTML=total-num;
 
-     Highcharts.getOptions().colors = Highcharts.map(['#f66167','#34abf5', '#DDDF0D'], function (color) {
 
-     	return {
 
-     		radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
 
-     		stops: [
 
-     			[0, color],
 
-     			[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
 
-     		]
 
-     	};
 
-     });
 
-     Highcharts.chart(icon_id,{
 
-         chart: {
 
-             type: 'solidgauge',
 
-             height: '100%',
 
-             backgroundColor: 'rgba(0,0,0,0)',
 
-             animation: false
 
-         },
 
-         title:{
 
-             text:percent+'%<br/>处置率',
 
-             floating:true,
 
-             y:46,
 
-             style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
 
-         },
 
-         exporting: {   
 
-             enabled: false
 
-         },
 
-         credits: {
 
-             enabled: false
 
-         },
 
-         tooltip: {
 
-             enabled: false
 
-         },
 
-         pane: {
 
-             startAngle: start,
 
-             background: [{ 
 
-                 outerRadius: '110%',
 
-                 innerRadius: '60%',
 
-                 backgroundColor: 'rgba(0,0,0,0)',
 
-                 borderWidth: 0
 
-             }]
 
-         },
 
-         yAxis: {
 
-             min: 0,
 
-             max: 100,
 
-             lineWidth: 0,
 
-             tickPositions: []
 
-         },
 
-         plotOptions: {
 
-             solidgauge: {
 
-                 dataLabels: {
 
-                     enabled: false
 
-                 },
 
-                 linecap: 'square',
 
-                 stickyTracking: false,
 
-                 rounded: false,
 
-                 warp: false
 
-             },
 
-             series:{
 
-             	animation: false
 
-             }
 
-         },
 
-         series:[{
 
-             name:name,
 
-             data:[{
 
-             	color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
 
-                 radius: '110%',
 
-                 innerRadius: '70%',
 
-                 y: 100
 
-             },{
 
-                 color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
 
-                 radius: '110%',
 
-                 innerRadius: '70%',
 
-                 y: percent
 
-             }]
 
-         }]
 
-     });
 
-     if((theme=='access')||(theme=='')){
 
-     	$('#'+label_id_title).addClass('shadow_black');
 
-     	$('#'+label_id_text).addClass('shadow_black');
 
-     	$('#'+icon_id).addClass('shadow_black');
 
-     }else{
 
-     	$('#'+label_id_title).addClass('shadow_white');
 
-     	$('#'+label_id_text).addClass('shadow_white');
 
-     	$('#'+icon_id).addClass('shadow_white');
 
-     }
 
- }
 
- var draw_cycle_icon = function(Id, title, num1, num2, num3, num4, themecolor){
 
-     var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
 
-     var label_id_title = Id+'_label_title';
 
-     var label_id_text = Id+'_label_text';
 
-     var icon_id = Id+'_pie';
 
-     var percent = 100;
 
-     if((num3+num4)>0)
 
-         percent = Number(((num3*100)/(num3+num4)).toString().match(/^\d+(?:\.\d{0,2})?/));
 
-     if((document.getElementById(icon_id)==null)
 
-     		||(document.getElementById(icon_id)=='undefined'))
 
-     	return;
 
-     if(title.length>0)
 
-     	document.getElementById(label_id_title).innerHTML=title;
 
-     document.getElementById(label_id_text+'_0').innerHTML=num1;
 
- //    document.getElementById(label_id_text+'_1').innerHTML=num2;
 
-     document.getElementById(label_id_text+'_2').innerHTML=num3;
 
-     document.getElementById(label_id_text+'_3').innerHTML=num4;
 
- //    var percent = Number(((num3*100)/(num3+num4)).toString().match(/^\d+(?:\.\d{0,2})?/));
 
-     Highcharts.setOptions({
 
-         lang: {
 
-             thousandsSep: ','
 
-         }
 
-     });
 
-     Highcharts.getOptions().colors = Highcharts.map(['#f66167','#34abf5', '#DDDF0D'], function (color) {
 
- //    Highcharts.getOptions().colors = Highcharts.map(['#DDDF0D','#f66167','#34abf5', '#DDDF0D','#34abf5'], function (color) {
 
-     	return {
 
-     		radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
 
-     		stops: [
 
-     			[0, color],
 
-     			[1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
 
-     		]
 
-     	};
 
-     });
 
-     Highcharts.chart(icon_id,{
 
-         chart: {
 
-             type: 'solidgauge',
 
-             height: '100%',
 
-             backgroundColor: 'rgba(0,0,0,0)',
 
-             animation: false
 
-         },
 
-         title:{
 
-             text:percent+'%<br/>处置率',
 
-             floating:true,
 
-             y:37,
 
-             style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
 
-         },
 
-         exporting: {   
 
-             enabled: false
 
-         },
 
-         credits: {
 
-             enabled: false
 
-         },
 
-         tooltip: {
 
-         	enabled: false,
 
-         	borderWidth: 0,
 
-             backgroundColor: 'none',
 
-             shadow: false,
 
-             style: {
 
-                 fontSize: '12px'
 
-             },
 
-             pointFormat: '<span style="border:2px solid #27c5ff; background:rgba(255,255,255,0.3); color:#ffffff; font-size:14px; font-weight:bold;">{point.name}:{point.showv}%</span>'
 
-         },
 
-         pane: {
 
-             startAngle: start,
 
-             background: [{ 
 
-                 outerRadius: '110%',
 
-                 innerRadius: '60%',
 
-                 backgroundColor: 'rgba(0,0,0,0)',
 
-                 borderWidth: 0
 
-             }]
 
-         },
 
-         yAxis: {
 
-             min: 0,
 
-             max: 100,
 
-             lineWidth: 0,
 
-             tickPositions: []
 
-         },
 
-         plotOptions: {
 
-             solidgauge: {
 
-                 dataLabels: {
 
-                     enabled: false
 
-                 },
 
-                 linecap: 'square',
 
-                 stickyTracking: false,
 
-                 rounded: false,
 
-                 warp: false
 
-             },
 
-             series:{
 
-             	animation: false
 
-             }
 
-         },
 
-         series:[{
 
-             name:title,
 
-             data:[{
 
-             	name: '未处理',
 
-             	showv: Number(((num4*100)/(num3+num4)).toString().match(/^\d+(?:\.\d{0,2})?/)),
 
-             	color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
 
-                 radius: '115%',
 
-                 innerRadius: '70%',
 
-                 y: 100
 
-             },{
 
-             	name:'已处理',
 
-             	showv:percent,
 
-             	color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
 
-                 radius: '115%',
 
-                 innerRadius: '70%',
 
-                 y: percent
 
-             }]
 
-         }]
 
-     });
 
-     if((theme=='access')||(theme=='')){
 
-     	$('#'+label_id_title).addClass('shadow_black');
 
-     	$('#'+label_id_text).addClass('shadow_black');
 
-     	$('#'+icon_id).addClass('shadow_black');
 
-     }else{
 
-     	$('#'+label_id_title).addClass('shadow_white');
 
-     	$('#'+label_id_text).addClass('shadow_white');
 
-     	$('#'+icon_id).addClass('shadow_white');
 
-     }
 
- }
 
- var  show_all_fireAlarm = function(){
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/fireAlarm/subFireAlarm.jsp?theme='+theme;
 
- }
 
- var show_all_waterAlarm = function(){
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/waterAlarm/subWaterAlarm.jsp?theme='+theme;
 
- }
 
- var show_all_rtuAlarm = function(){
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/rtuAlarm/subRtuAlarm.jsp?theme='+theme;
 
- }
 
- var  show_all_fireDevice = function(){
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/fireAlarm/FireDeviceIndex.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/fireAlarm/FireDeviceIndex.jsp?theme='+theme;
 
- }
 
- var show_all_efireDevice = function () {
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/efireAlarm/eFireDeviceIndex.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/efireAlarm/eFireDeviceIndex.jsp?theme='+theme;
 
- }
 
- var show_all_efireAlarm = function () {
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/efireAlarm/subeFireAlarm.jsp?theme='+theme;
 
- }
 
- var  show_all_waterDevice = function(){
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/waterAlarm/WaterDeviceIndex.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/waterAlarm/WaterDeviceIndex.jsp?theme='+theme;
 
- }
 
- var  show_all_rtuDevice = function(){
 
- 	if($("#company_code").val().length>0)
 
- 		location.href = baseUrl + 'view/rtuAlarm/RtuDeviceIndex.jsp?theme='+theme+'&company_code='+($("#company_code").val());
 
- 	else
 
- 		location.href = baseUrl + 'view/rtuAlarm/RtuDeviceIndex.jsp?theme='+theme;
 
- }
 
- Ext.onReady(function(){ 
 
-     baseUrl = $("#basePath").val();
 
-     theme = $("#theme").val();
 
-     $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
 
- 	$("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
 
-     V_LOGINNAME = $("#V_LOGINNAME").val();
 
-     V_PASSWORD = $("#V_PASSWORD").val();
 
-     viewAlarmType = $("#viewAlarmType").val();
 
-     pieAlarmType = $("#pieAlarmType").val();
 
-     statusType = $("#statusType").val();
 
-     company_code = $("#company_code").val();
 
-     mapStyle = (theme=='default')?'normal':(theme=='gray')?'amap://styles/light':'amap://styles/659dc6c4753dc6e87c65c8a874c02133';
 
- //    if((V_LOGINNAME=='dfmz')||(V_LOGINNAME=='ytkj'))
 
- 	location.href = baseUrl+'view/frontpage/map.jsp';
 
- 	return;
 
-     $("#alarm_wrapper_table").css('left',(($(document).innerWidth()-800)/2)+'px');
 
-     if((theme=='access')||(theme==''))
 
-     	$('#alarm_wrapper').addClass('shadow_black');
 
-     else
 
-     	$('#alarm_wrapper').addClass('shadow_white');
 
-     var tab = Ext.create('Ext.tab.Panel',{
 
-     	items:[{
 
-     		title:'火警系统报告',
 
-     		html:'<iframe id="FireAlarmWinmdow" name="FireAlarmWinmdow" src="fireAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):'')+'" style="width:100%;height:100%;" frameborder="0"></iframe>'
 
-     	},{
 
-     		title:'水系统报告',
 
-     		html:'<iframe id="WaterAlarmWinmdow" name="WaterAlarmWinmdow" src="waterAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):'')+'" style="width:100%;height:100%;" frameborder="0"></iframe>'
 
-     	},{
 
-     		title:'RTU报告',
 
-     		html:'<iframe id="RtuAlarmWinmdow" name="RtuAlarmWinmdow" src="rtuAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):'')+'" style="width:100%;height:100%;" frameborder="0"></iframe>'
 
-     	}],
 
-     	listeners:{
 
-     		click:{
 
-     			element: 'el', //bind to the underlying el property on the panel
 
-                 fn: function(){
 
-         			$("#FireAlarmWinmdow").attr("src",'fireAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
-         	    	$("#FireAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
-         	    	$("#FireAlarmWinmdow").attr("frameborder",'0');
 
-         	    	$("#WaterAlarmWinmdow").attr("src",'waterAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
-         	    	$("#WaterAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
-         	    	$("#WaterAlarmWinmdow").attr("frameborder",'0');
 
-         	    	$("#RtuAlarmWinmdow").attr("src",'rtuAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
-         	    	$("#RtuAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
-         	    	$("#RtuAlarmWinmdow").attr("frameborder",'0');
 
-                 }
 
-     		}
 
-     	}
 
-     });
 
-     myMask = new Ext.LoadMask(Ext.getBody(), {    
 
-         msg: '查询中,请稍后!',   
 
-         cls:'toplevel',
 
-         removeMask: true //完成后移除    
 
- 	});  
 
-     show_alarm_list = function(){
 
-     	if(alarm_show_window==null)
 
-     		alarm_show_window = Ext.create('Ext.window.Window', {
 
-     		    title: '最新报警事件记录',
 
-     		    id:'alarm_show_window',
 
-     		    height: 640,
 
-     		    width: 800,
 
-     		    layout: 'fit',
 
-     		    items:tab,
 
-     		    modal:true,
 
-     		    closable:true,
 
-     		    closeAction: 'hide'
 
-     		}).show();
 
-     	else{
 
-     		alarm_show_window.show();
 
-     	}
 
- 		$("#FireAlarmWinmdow").attr("src",'fireAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
-     	$("#FireAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
-     	$("#FireAlarmWinmdow").attr("frameborder",'0');
 
-     	$("#WaterAlarmWinmdow").attr("src",'waterAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
-     	$("#WaterAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
-     	$("#WaterAlarmWinmdow").attr("frameborder",'0');
 
-     	$("#RtuAlarmWinmdow").attr("src",'rtuAlarm/window.jsp?theme='+theme+(($("#company_code").val().length>0)?('&company_code='+($("#company_code").val())):''));
 
-     	$("#RtuAlarmWinmdow").attr("style",'width:100%;height:100%;');
 
-     	$("#RtuAlarmWinmdow").attr("frameborder",'0');
 
-     }
 
-     map = new AMap.Map('container', {
 
-         mapStyle: mapStyle, //样式URL
 
-         viewMode: '3D',
 
-         turboMode: false,
 
-         resizeEnable: true,
 
-         zoom: mapzoom,
 
-         center: [121.475644, 31.1857],
 
-         features:['bg', 'road', 'building'],
 
-         pitch: 45,
 
-         forceVector: true
 
-     });
 
-     myMask.show();
 
-     getCurrentData();
 
- //    mapRotation();
 
-     $("#search_company").on('input',function(){
 
-     	update_companyList();
 
-     });
 
-     $(window).resize(function(){
 
-     	body_resize();
 
-     });
 
-     body_resize();
 
- });
 
 
  |