/** * 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查看' },{ html:'水系统告警:', width:120 },{ html:StatusStore[i].water_alarm?'未处理':'已处理', width:200 },{ html:'' },{ html:'RTU告警:', width:120 },{ html:StatusStore[i].other_alarm?'未处理':'已处理', width:200 },{ html:'' }] }) ], 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;i100)&&(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;i0) $("#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;i0) 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;i0) 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+'%
处置率', 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+'%
处置率', 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: '{point.name}:{point.showv}%' }, 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:'' },{ title:'水系统报告', html:'' },{ title:'RTU报告', html:'' }], 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(); });