/** * */ 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 myStore=null; var StatusStore; var baseUrl; var company_code; var theme; var ConfirmStore var pieWidth; var showAlarm=null; var pieMask; var V_LOGINNAME='',V_PASSWORD=''; var myMask; var sm = Ext.create('Ext.selection.CheckboxModel'); Ext.define('VWaterOption',{ extend: 'Ext.data.Model', fields: [ { name:"id", type:'int' }, { name:'company_code', type:'string' }, { name:'company_name', type:'string' }, { name:'fulladdress', type:'string' }, { name:'rtmp', type:'string' }, { name:'xmlx', type:'string' }, { name:'list_count', type:'int' } ] }); Ext.define('CompanyComboStore',{ extend:'Ext.data.Model', fields: [ {name:'owner_name', type:'string'}, {name:'owner_id',type:'string'} ] }); var drawDevices = function(){ // alert('get device info'); if(StatusStore.length>0){ 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(); for(var i=0;i0)){ for(var j=0;j
监控总数:'+water_device_count+'
在线总数:'+(water_device_count-water_device_out)+'
离线线总数:'+water_device_out+'
在线率:',water_device_count,(water_device_count-water_device_out),themecolor); draw_cycle_icon('waterPie2','状态正常

在线总数:'+(water_device_count-water_device_out)+'
正常总数:'+water_device_normal+'
告警总数:'+water_device_alarm+'
正常率:',(water_device_count-water_device_out),water_device_normal,themecolor); } } var draw_confirm = function(){ var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000'; for(var i=0;i告警总数:'+ConfirmStore[i].count+'
已处理:'+ConfirmStore[i].sum+'
未处理:'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'
处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor); Highcharts.chart('waterArea',{ chart:{ type:'area', backgroundColor: 'rgba(0,0,0,0)' }, title:{ text:'近期告警发生及处理情况汇总', style:{fontSize:'14px',color:themecolor,fontWeight:'bold'} }, legend:{ floating:true, itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}, x:300, y:(115-pieWidth) }, colors:['#f66167', '#34abf5'], exporting: { enabled: false }, credits: { enabled: false }, xAxis:{ categories:ConfirmStore[i].day_list, tickmarkPlacement:'on', lineColor:'#666666', tickColor:'#666666', labels:{ enabled:false, style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} }, title:{ enabled:false } }, yAxis:{ title:{ text:'次', style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} }, lineColor:'#666666', tickColor:'#666666', labels:{ formatter:this.value, style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} } }, plotOptions:{ area:{ stackiung:'normal', lineColor:'#666666', lineWidth:1, marker:{ lineWidth:1, lineColor:'#666666' } } }, series:[ { name:'告警次数', data:ConfirmStore[i].count_list },{ name:'处理次数', data:ConfirmStore[i].sum_list } ] }); } } } var draw_cycle_icon = function(icon_id,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'; $("#"+icon_id+"Title").html('

'+name+percent+'%'); Highcharts.chart(icon_id,{ chart: { type: 'solidgauge', height: '85%', backgroundColor: 'rgba(0,0,0,0)', reflow:true, marginTop:0 }, title:{ text:percent+'%', floating:true, y:pieWidth/3, style:{fontSize:'14px',color:themecolor,fontWeight:'bold'} }, exporting: { enabled: false }, credits: { enabled: false }, tooltip: { enabled: false }, pane: { startAngle: -90, endAngle: 180, background: [{ outerRadius: '90%', innerRadius: '60%', backgroundColor: 'rgba(0,0,0,0)', borderWidth: 0 }] }, yAxis: { min: 0, max: 100, lineWidth: 0, tickPositions: [] }, plotOptions: { solidgauge: { dataLabels: { enabled: false }, stickyTracking: false, rounded: true, warp: false } }, series:[{ name:'', data:[{ color: Highcharts.Color(mColor) .setOpacity(0.2) .get(), radius: '90%', innerRadius: '60%', y: 100 },{ color: Highcharts.Color(mColor) .setOpacity(0.6) .get(), radius: '90%', innerRadius: '60%', y: percent }] }] }); if((theme=='access')||(theme=='')){ $('#'+icon_id).addClass('shadow_black'); }else{ $('#'+icon_id).addClass('shadow_white'); } } var draw_confirm = function(){ var list = ConfirmStore[0].point_list; var ncount = ConfirmStore[0].list_count; $("#WaterPiePanel_title_string").html(ConfirmStore[0].company_name+'.水系统监控设备通信信号强弱情况'); var table = document.createElement("table"); table.width="100%"; table.border='0'; table.style='border:0px solid #000;height:100%;'; $("#waterArea").html(''); document.getElementById("waterArea").appendChild(table); for(var i=0;i5?5:list[j].point_data); var myColor = ((v<3)?'#f66167':((v<4)?'#DDDF0D':'#34abf5')); var div = document.createElement('div'); div.id = 'WaterPiePanel_'+list[j].device_id; div.style.overflow='hidden'; div.style.padding='5px'; div.style.margin='20px'; div.style.width='150px'; div.style.height='250px'; div.style.border='2px solid rgba(255,255,255,0.0)'; div.style.background = 'rgba(255,255,255,0.0)'; div.style.color = '#ffffff'; div.style.cursor = 'pointer'; div.style.float = 'left'; div.device_id = list[j].device_id; div.company_code = company_code; div_root.appendChild(div); $("#WaterPiePanel_"+list[j].device_id).mouseover(function(){ $(this).css({ 'overflow':'hidden', 'padding':'5px', 'margin':'20px', 'width':'150px', 'height':'250px', 'cursor':'pointer', 'float':'left', 'color':'#ffff00', 'border':'2px solid rgba(255,255,255,0.3)', 'background':'rgba(0,0,0,0.3)' }); }); $("#WaterPiePanel_"+list[j].device_id).mouseout(function(){ $(this).css({ 'overflow':'hidden', 'padding':'5px', 'margin':'20px', 'width':'150px', 'height':'250px', 'cursor':'pointer', 'float':'left', 'color':'#ffffff', 'border':'2px solid rgba(255,255,255,0.0)', 'background':'rgba(255,255,255,0.0)' }); }); $("#WaterPiePanel_"+list[j].device_id).click(function(e){ var id = e.currentTarget.device_id; var cid = e.currentTarget.company_code; myMask.show(); var query = new Object(); // query.V_LOGINNAME = V_LOGINNAME; // query.V_PASSWORD = V_PASSWORD; query.company_code = cid; query.device_id = id; query.dwtype = '2'; query.point_code = '3'; $.ajax({ type:'POST', url: baseUrl+"iot/data/view/getSyncDataVListByCompany", data: { queryJson : Ext.JSON.encode(query) }, success: function(result){ var json = eval('(' + result + ')'); if(json.action=='getSyncDataVListByCompany'){ if(json.check=='true'){ ConfirmStore = json.RESULT; draw_confirm(); }else{ Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){ window.parent.frames.return_login(); }); } } myMask.hide(); } }); }); var title = document.createElement('div'); title.style.margin = '0px'; title.style.padding = '0px'; title.style.width = '150px'; title.style.height = '50px'; title.style.fontSize = '14px'; title.style.fontWeight = 'bold'; title.innerHTML = list[j].name; div.appendChild(title); var text = document.createElement('div'); text.style.margin = '0px'; text.style.padding = '0px'; text.style.width = '150px'; text.style.height = '80px'; text.style.fontSize = '10px'; text.style.fontWeight = 'normal'; var str = '信号强弱:'+v+'
采集时间:
'+list[j].data_time; text.innerHTML = str div.appendChild(text); var pie = document.createElement('div'); pie.style.margin = '0px'; pie.style.padding = '0px'; pie.style.width = '120px'; pie.style.height = '100px'; var pieId = 'WaterDevicePie_'+list[j].device_id; pie.id = pieId; div.appendChild(pie); Highcharts.getOptions().colors = Highcharts.map([ '#000000',myColor, myColor], 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(pieId,{ chart: { type: 'solidgauge', height: '85%', backgroundColor: 'rgba(0,0,0,0)', reflow:true, marginTop:0 }, title:{ text:v+'%', floating:true, y:(pieWidth*2/5), style:{fontSize:'21px',color:themecolor,fontWeight:'bold'} }, exporting: { enabled: false }, credits: { enabled: false }, tooltip: { enabled: false }, pane: { startAngle: -90, endAngle: 270, background: [{ outerRadius: '90%', innerRadius: '60%', backgroundColor: 'rgba(0,0,0,0)', borderWidth: 0 }] }, yAxis: { min: 0, max: 5, lineWidth: 0, tickPositions: [] }, plotOptions: { solidgauge: { dataLabels: { enabled: false }, linecap: 'square', stickyTracking: false, rounded: false, warp: false } }, series:[{ name:'', data:[{ color: Highcharts.Color(myColor) .setOpacity(0.2) .get(), radius: '110%', innerRadius: '80%', y: 100 },{ color: (Highcharts.theme && Highcharts.theme.contrastTextColor) , radius: '110%', innerRadius: '80%', y: v*20 },{ color: (Highcharts.theme && Highcharts.theme.contrastTextColor) , radius: '60%', innerRadius: '0%', y: 100 }] }] }); // Highcharts.chart(pieId,{ // chart:{ // type:'bar', // backgroundColor: 'rgba(0,0,0,0)' // }, // title:{ // text:null // }, // exporting: { // enabled: false // }, // credits: { // enabled: false // }, // legend:{ // enabled: false // }, // tooltip:{ // enabled:false // }, // xAxis:{ // categories:['电量'], // labels:{ // enabled:false // }, // gridLineWidth:0, // lineWidth:0, // tickWidth:0 // }, // yAxis:{ // min: 0, // max: 100, // title:{ // text:null // }, // labels:{ // enabled:false // }, // gridLineWidth:0, // lineWidth:0, // stackLabels:{ // enabled:false // }, // tickWidth:0 // }, // legend:{ // reversed:true, // enabled:false // }, // plotOptions:{ // series:{ // stacking:'normal' // } // }, // series:[{ // name:'剩余电量', //// visible:false, // data:[v] // }] // }); } break; } } pieMask.hide(); } var getCurrentData = function(){ var div = Ext.getCmp('VWaterOptionListPanel'); var model = div.getSelectionModel(); var record = model.getSelection()[0]; show_datapie(record); } Ext.onReady(function(){ baseUrl = document.getElementById('basePath').value; theme = document.getElementById('theme').value; company_code = document.getElementById('company_code').value; $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME')); $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD')); V_LOGINNAME = $("#V_LOGINNAME").val(); V_PASSWORD = $("#V_PASSWORD").val(); var currentWidth = document.documentElement.clientWidth; pieWidth = currentWidth/7; var chkIcon = '' var unchkIcon = '' var countPerPage = 20; var maxHeight = 10000; var chkBoolean = function(flag) { if(flag) return chkIcon; return unchkIcon; } var queryJson = new Object(); queryJson.V_LOGINNAME = V_LOGINNAME; // queryJson.V_PASSWORD = V_PASSWORD; queryJson.dwtype = '2'; queryJson.point_code = '3' if((company_code!=null)&&(company_code!='null')&&(company_code.length>0)) queryJson.company_code = company_code; myStore = Ext.create('Ext.data.Store', { model: 'VWaterOption', pageSize: countPerPage, proxy: { type: 'ajax', actionMethods: { create : 'POST', read : 'POST', // by default GET update : 'POST', destroy: 'POST' }, url: baseUrl+'iot/data/view/getSyncStatusVListByCompany', reader: { type: 'json', root: 'RESULT', totalProperty: 'totalCount' }, extraParams:{ queryJson:Ext.JSON.encode(queryJson) } }, sorters:[{ property:'time', direction:'DESC' }], remoteSort: true }); var CompanyStory = Ext.create('Ext.data.Store',{ model: 'CompanyComboStore', proxy: { type: 'ajax', actionMethods: { create : 'POST', read : 'POST', // by default GET update : 'POST', destroy: 'POST' }, url: baseUrl+'iot/company/view/getNameList', reader: { type: 'json', root: 'RESULT', totalProperty: 'totalCount' }, extraParams:{ queryJson:Ext.JSON.encode(queryJson) } } }); var ClztStory = Ext.create('Ext.data.Store',{ fields:['abbr','name'], data:[ {'abbr':0,'name':'未处理'}, {'abbr':1,'name':'已处理'} ] }); var FilterForm = Ext.create('Ext.form.Panel', { id: 'VWaterOptionFilterForm', labelWidth: 55, defaultType: 'textfield', bodyPadding: 15, items: [{ xtype:'combo', fieldLabel:'单位名称', id: 'ff_company_code', name:'ff_company_code', displayField : 'owner_name', valueField : 'owner_id', editable : false, width:330, store:CompanyStory },{ xtype:'combo', fieldLabel:'处理状态', id: 'ff_clzt', name: 'ff_clzt', displayField : 'name', valueField : 'abbr', editable : false, width:330, store:ClztStory }], buttons: [{ text: '筛选', iconCls:'ok_btn', handler: function() { var form = this.up('form').getForm(); if (form.isValid()) { var query = new Object(); // var tmp = Ext.getCmp('ff_company_code'); query.dwtype = '2'; query.point_code = '2' if(Ext.getCmp('ff_company_code').getValue().length>0){ query.company_code = Ext.getCmp('ff_company_code').getValue(); $("#company_code").val(query.company_code); company_code = query.company_code; $("#WaterPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.火警系统监控告警处理情况'); }else{ $("#company_code").val(''); $("#WaterPiePanel_title_string").html('火警系统监控告警处理情况'); company_code = null; } query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue(); // query.V_LOGINNAME = V_LOGINNAME; // query.V_PASSWORD = V_PASSWORD; query.COMMSTATUS = 'NO'; var jsonstr = Ext.JSON.encode(query); myStore.getProxy().extraParams = { queryJson : jsonstr }; Ext.getCmp('VWaterOptionListPageToolbar').moveFirst(); Ext.getCmp('ff_company_code').setValue(''); Ext.getCmp('ff_clzt').setValue(''); Ext.getCmp('VWaterOptionFilterWin').hide(); getCurrentData(); } } },{ text: '关闭', iconCls: 'cancel_btn', handler: function() { Ext.getCmp('VWaterOptionFilterWin').hide(); } }] }); var filterwin = function() { Ext.create('Ext.window.Window',{ id: 'VWaterOptionFilterWin', title: '水系统报告筛选', height: 210, width: 400, layout: 'fit', items: FilterForm, closable:false, modal:true, closeAction: 'hide' }).show(); CompanyStory.reload(); } var radiogroup = new Ext.create('Ext.form.RadioGroup',{ fieldLabel:'误报', id:'uf_r_clwb', width:300, items:[{ name:'uf_r_clwb', inputValue:'1', boxLabel:'是' },{ name:'uf_r_clwb', inputValue:'0', boxLabel:'否', checked:true }] }); var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{ fieldLabel:'处理范围', id:'uf_r_clfw', width:300, items:[{ name:'uf_r_clfw', inputValue:'1', boxLabel:'批量' },{ name:'uf_r_clfw', inputValue:'0', boxLabel:'单一', checked:true }] }); var clear_modify_form = function(){ Ext.getCmp('uf_company_name').setValue(''); Ext.getCmp('uf_name').setValue(''); Ext.getCmp('uf_device_code').setValue(''); Ext.getCmp('uf_id').setValue(''); Ext.getCmp('uf_status').setValue(''); Ext.getCmp('uf_fullname').setValue(''); Ext.getCmp('uf_clwb').setValue(''); Ext.getCmp('uf_clr').setValue(''); Ext.getCmp('uf_clsj').setValue(''); Ext.getCmp('uf_clnr').setValue(''); } var fireInfoForm = Ext.create('Ext.form.Panel', { id: 'waterInfoForm', labelWidth: 55, url: baseUrl+'iot/alarm/view/updateSj', defaultType: 'textfield', bodyPadding: 15, items: [{ fieldLabel:'单位名称', id: 'uf_company_name', name: 'uf_company_name', anchor:'90%' },{ fieldLabel:'监控设备', id:'uf_name', name:'uf_name', anchor:'100%' },{ fieldLabel:'设备编号', id:'uf_device_code', name:'uf_device_code', hidden: true },{ fieldLabel:'记录编号', id:'uf_id', name:'uf_id', hidden: true },{ fieldLabel:'设备编号', id:'uf_status', name:'uf_status', hidden: true },{ fieldLabel:'报告信息', id: 'uf_fullname', name:'uf_fullname', xtype: 'textareafield', maxLength: 250, cols:4, anchor:'100%' },{ fieldLabel:'误报', id: 'uf_clwb', name:'uf_clwb', maxLength: 200, anchor:'65%' },radiogroup,radiogroup2,{ fieldLabel:'处理人', id: 'uf_clr', name:'uf_clr', maxLength: 120, anchor:'65%' },{ fieldLabel:'处理时间', id: 'uf_clsj', name:'uf_clsj', maxLength: 200, anchor:'80%' },{ fieldLabel:'处理内容', id: 'uf_clnr', name:'uf_clnr', xtype: 'textareafield', maxLength: 250, cols:4, anchor:'100%' },{ id:'fm_queryJson', name:'queryJson', hidden:true }], buttons: [{ text: '处理', id:'confirmBtn', iconCls:'ok_btn', handler: function() { var form = this.up('form').getForm(); if (form.isValid()) { var queryJson = new Object(); // queryJson.V_LOGINNAME = V_LOGINNAME; // queryJson.V_PASSWORD = V_PASSWORD; queryJson.id = Ext.getCmp('uf_id').getValue(); queryJson.status = Ext.getCmp('uf_status').getValue(); queryJson.name = Ext.getCmp('uf_name').getValue(); queryJson.device_code = Ext.getCmp('uf_device_code').getValue(); queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1'; queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1'; queryJson.clnr = Ext.getCmp('uf_clnr').getValue(); var jsonstr = Ext.JSON.encode(queryJson); Ext.getCmp('fm_queryJson').setValue(jsonstr); form.submit({ method:'post', success: function(form, action) { Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){ clear_modify_form(); myStore.reload(); getCurrentData(); }); }, failure: function(form, action) { Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){ clear_modify_form(); myStore.reload(); getCurrentData(); }); } }); this.up('window').close(); } } },{ text: '关闭', iconCls: 'cancel_btn', handler: function() { this.up('window').close(); } }] }); var vWaterInfoWin = Ext.create('Ext.window.Window',{ id:'VWaterInfoWin', title:'详细信息: ', width:400, layout:'fit', closable:false, modal:true, closeAction:'hide', items:fireInfoForm }); var showFireInfoWin = function(record){ vWaterInfoWin.show(); $("#VInfoWin_Title").html(record.get('data')); Ext.getCmp('uf_company_name').setValue(record.get('company_name')); Ext.getCmp('uf_name').setValue(record.get('name')); Ext.getCmp('uf_device_code').setValue(record.get('device_code')); Ext.getCmp('uf_fullname').setValue(record.get('fullname')); Ext.getCmp('uf_clr').setValue(record.get('clr_name')); Ext.getCmp('uf_clsj').setValue(record.get('clsj')); Ext.getCmp('uf_clnr').setValue(record.get('clnr')); Ext.getCmp('uf_id').setValue(record.get('id')); Ext.getCmp('uf_clwb').setValue(record.get('clwb')=='1'?'误报':'告警'); Ext.getCmp('uf_status').setValue(record.get('status')); if(record.get('clzt')=='已处理'){ Ext.getCmp('uf_clwb').setVisible(true); Ext.getCmp('uf_r_clwb').setVisible(false); Ext.getCmp('uf_r_clfw').setVisible(false); Ext.getCmp('confirmBtn').setVisible(false); Ext.getCmp('uf_clr').setVisible(true); Ext.getCmp('uf_clsj').setVisible(true); }else{ Ext.getCmp('uf_clwb').setVisible(false); Ext.getCmp('uf_r_clwb').setVisible(true); Ext.getCmp('uf_r_clfw').setVisible(true); Ext.getCmp('confirmBtn').setVisible(true); Ext.getCmp('uf_clr').setVisible(false); Ext.getCmp('uf_clsj').setVisible(false); } } var WaterOptionPanel = Ext.create('Ext.grid.Panel', { title: '水系统监控单位列表', titleCollapse:true, id: 'VWaterOptionListPanel', region:'north', store: myStore, height: (pieWidth*3/2), columns: [ { header: '序号', dataIndex: 'id',width:50, menuDisabled:true }, { header: '单位名称', dataIndex: 'company_name',width:240, menuDisabled:true }, { header: '详细地址', dataIndex: 'fulladdress', width:640, menuDisabled:true }, { header: '单位类型', dataIndex: 'xmlx', width:100, menuDisabled:true }, { header: '设备数量', dataIndex: 'list_count', width:80, menuDisabled:true } ], columnLines: true, width: '100%', frame: true, border:false, iconCls: 'icon-grid', listeners:{ 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){ pieMask.show(); show_datapie(record); } } }); var piebar = Ext.create('Ext.panel.Panel',{ id:'WaterPiePanel', width:'100%', region:'center', layout:'border', height: maxHeight, title:'水系统监控设备通信信号强弱情况', defaults:{ border:false }, items:[ { region:'east', xtype:'panel', id:'waterArea', style:'overflow:auto', width:currentWidth } ] }); pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."}); myMask = new Ext.LoadMask(document.body,{msg:"Loading..."}); new Ext.create('Ext.panel.Panel',{ width:'100%', id: 'WaterAlarmPanel', layout:'border', items:[ WaterOptionPanel,piebar ], renderTo: Ext.getBody() }); pieMask.show(); myStore.addListener('load',function(store,record,opts){ pieMask.show(); WaterOptionPanel.getSelectionModel().select(0,true); getCurrentData(); }); myStore.reload(); maxHeight = document.documentElement.clientHeight; Ext.getCmp('WaterAlarmPanel').setHeight(maxHeight); }); ///** // * // */ // //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 StatusStore; //var baseUrl; //var company_code; //var theme; //var ConfirmStore //var pieWidth; //var showAlarm=null; //var pieMask; //var V_LOGINNAME='',V_PASSWORD=''; // //var sm = Ext.create('Ext.selection.CheckboxModel'); // //Ext.define('VWaterOption',{ // extend: 'Ext.data.Model', // fields: [ // { name:"id", type:'int' }, // { name:'company_code', type:'string' }, // { name:'company_name', type:'string' }, // { name:'fulladdress', type:'string' }, // { name:'rtmp', type:'string' }, // { name:'xmlx', type:'string' }, // { name:'list_count', type:'int' } // ] //}); // //Ext.define('CompanyComboStore',{ // extend:'Ext.data.Model', // fields: [ // {name:'owner_name', type:'string'}, // {name:'owner_id',type:'string'} // ] //}); // //var drawDevices = function(){ //// alert('get device info'); // if(StatusStore.length>0){ // 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(); // for(var i=0;i0)){ // for(var j=0;j
监控总数:'+water_device_count+'
在线总数:'+(water_device_count-water_device_out)+'
离线线总数:'+water_device_out+'
在线率:',water_device_count,(water_device_count-water_device_out),themecolor); // draw_cycle_icon('waterPie2','状态正常

在线总数:'+(water_device_count-water_device_out)+'
正常总数:'+water_device_normal+'
告警总数:'+water_device_alarm+'
正常率:',(water_device_count-water_device_out),water_device_normal,themecolor); // } //} // //var draw_confirm = function(){ // var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000'; // for(var i=0;i告警总数:'+ConfirmStore[i].count+'
已处理:'+ConfirmStore[i].sum+'
未处理:'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'
处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor); // Highcharts.chart('waterArea',{ // chart:{ // type:'area', // backgroundColor: 'rgba(0,0,0,0)' // }, // title:{ // text:'近期告警发生及处理情况汇总', // style:{fontSize:'14px',color:themecolor,fontWeight:'bold'} // }, // legend:{ // floating:true, // itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}, // x:300, // y:(115-pieWidth) // }, // colors:['#f66167', '#34abf5'], // exporting: { // enabled: false // }, // credits: { // enabled: false // }, // xAxis:{ // categories:ConfirmStore[i].day_list, // tickmarkPlacement:'on', // lineColor:'#666666', // tickColor:'#666666', // labels:{ // enabled:false, // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // }, // title:{ // enabled:false // } // }, // yAxis:{ // title:{ // text:'次', // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // }, // lineColor:'#666666', // tickColor:'#666666', // labels:{ // formatter:this.value, // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // } // }, // plotOptions:{ // area:{ // stackiung:'normal', // lineColor:'#666666', // lineWidth:1, // marker:{ // lineWidth:1, // lineColor:'#666666' // } // } // }, // series:[ // { // name:'告警次数', // data:ConfirmStore[i].count_list // },{ // name:'处理次数', // data:ConfirmStore[i].sum_list // } // ] // }); // } // } //} // //var draw_cycle_icon = function(icon_id,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'; // $("#"+icon_id+"Title").html('

'+name+percent+'%'); // // Highcharts.chart(icon_id,{ // chart: { // type: 'solidgauge', // height: '85%', // backgroundColor: 'rgba(0,0,0,0)', // reflow:true, // marginTop:0 // }, // title:{ // text:percent+'%', // floating:true, // y:pieWidth/3, // style:{fontSize:'14px',color:themecolor,fontWeight:'bold'} // }, // exporting: { // enabled: false // }, // credits: { // enabled: false // }, // tooltip: { // enabled: false // }, // pane: { // startAngle: -90, // endAngle: 180, // background: [{ // outerRadius: '90%', // 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: true, // warp: false // } // }, // series:[{ // name:'', // data:[{ // color: Highcharts.Color(mColor) // .setOpacity(0.2) // .get(), // radius: '90%', // innerRadius: '60%', // y: 100 // },{ // color: Highcharts.Color(mColor) // .setOpacity(0.6) // .get(), // radius: '90%', // innerRadius: '60%', // y: percent // }] // }] // }); // if((theme=='access')||(theme=='')){ // $('#'+icon_id).addClass('shadow_black'); // }else{ // $('#'+icon_id).addClass('shadow_white'); // } // //} // //var draw_confirm = function(){ // var list = ConfirmStore[0].point_list; // var ncount = ConfirmStore[0].list_count; //// '水系统监控设备电池电量情况' // $("#WaterPiePanel_title_string").html(ConfirmStore[0].company_name+'.水系统监控设备通信信号情况'); // var table = document.createElement("table"); // table.width="100%"; // table.border='0'; // table.style='border:0px solid #000;height:'+(pieWidth*ncount)+'px;'; // $("#waterArea").html(''); // document.getElementById("waterArea").appendChild(table); // for(var i=0;i' // +'
最新数值:'+point_list.point_data+'' // +'
采集时间:'+point_list.data_time+''; // $("#pie_title_"+(i+1)).html(txt); // Highcharts.chart('pie_'+(i+1),{ // chart: { // type: 'solidgauge', // height: '85%', // backgroundColor: 'rgba(0,0,0,0)', // reflow:true, // marginTop:0 // }, // title:{ // text:(point_list.point_data>5?5:point_list.point_data), // floating:true, // y:pieWidth*.35, // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // }, // exporting: { // enabled: false // }, // credits: { // enabled: false // }, // tooltip: { // enabled: false // }, // pane: { // startAngle: -90, // endAngle: 180, // background: [{ // outerRadius: '70%', // innerRadius: '40%', // backgroundColor: 'rgba(0,0,0,0)', // borderWidth: 0 // }] // }, // yAxis: { // min: 0, // max: 100, // lineWidth: 0, // tickPositions: [] // }, // plotOptions: { // solidgauge: { // dataLabels: { // enabled: false // }, // stickyTracking: false, // rounded: true, // warp: false // } // }, // series:[{ // name:'', // data:[{ // color: Highcharts.Color(mColor) // .setOpacity(0.2) // .get(), // radius: '70%', // innerRadius: '40%', // y: 100 // },{ // color: Highcharts.Color(mColor) // .setOpacity(0.6) // .get(), // radius: '70%', // innerRadius: '40%', // y: (Number(point_list.point_data>5?5:point_list.point_data)/5)*100 // }] // }] // }); // Highcharts.chart('area_'+(i+1),{ // chart:{ // type:'line', // backgroundColor: 'rgba(0,0,0,0)' // }, // title:{ //// floating:true, // text:point_list.name+'.通信信号数据跟踪', // style:{fontSize:'14px',color:themecolor,fontWeight:'bold'} // }, // legend:{ //// floating:true, // enabled:false, // itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'} // }, // colors:[mColor], // exporting: { // enabled: false // }, // credits: { // enabled: false // }, // xAxis:{ // categories:point_list.time_list, // tickmarkPlacement:'on', // lineColor:'#666666', // tickColor:'#666666', // labels:{ // enabled:false, // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // }, // title:{ // enabled:false // } // }, // yAxis:{ // title:{ // text:'', // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // }, // lineColor:'#666666', // tickColor:'#666666', // labels:{ // formatter:this.value, // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'} // } // }, // plotOptions:{ // area:{ // stackiung:'normal', // lineColor:'#666666', // lineWidth:1, // marker:{ // lineWidth:1, // lineColor:'#666666' // } // } // }, // series:[ // { // name:'通信信号', // data:point_list.data_list // } // ] // }); // } //} // //var show_datapie = function(record){ // var query = new Object(); // query.V_LOGINNAME = V_LOGINNAME; // query.V_PASSWORD = V_PASSWORD; // query.company_code = record.get('company_code'); // query.dwtype = '2'; // query.point_code = '3'; // $.ajax({ // type:'POST', // url: baseUrl+"iot/data/view/getSyncDataVListByCompany", // data: { // queryJson : Ext.JSON.encode(query) // }, // success: function(result){ // var json = eval('(' + result + ')'); // if(json.action=='getSyncDataVListByCompany'){ // if(json.check=='true'){ // ConfirmStore = json.RESULT; // draw_confirm(); // }else{ // Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){ // window.parent.frames.return_login(); // }); // } // } // pieMask.hide(); // } // }); //} // //var getCurrentData = function(){ // var div = Ext.getCmp('VWaterOptionListPanel'); // var model = div.getSelectionModel(); // var record = model.getSelection()[0]; // show_datapie(record); //} // //Ext.onReady(function(){ // baseUrl = document.getElementById('basePath').value; // theme = document.getElementById('theme').value; // company_code = document.getElementById('company_code').value; // V_LOGINNAME = $("#V_LOGINNAME").val(); // V_PASSWORD = $("#V_PASSWORD").val(); // var currentWidth = document.documentElement.clientWidth; // pieWidth = currentWidth/7; // var chkIcon = '' // var unchkIcon = '' // var countPerPage = 20; // var maxHeight = 10000; // // var chkBoolean = function(flag) { // if(flag) // return chkIcon; // return unchkIcon; // } // var queryJson = new Object(); // queryJson.V_LOGINNAME = V_LOGINNAME; // queryJson.V_PASSWORD = V_PASSWORD; // queryJson.dwtype = '2'; // queryJson.point_code = '3' // var myStore = Ext.create('Ext.data.Store', { // model: 'VWaterOption', // pageSize: countPerPage, // proxy: { // type: 'ajax', // actionMethods: { // create : 'POST', // read : 'POST', // by default GET // update : 'POST', // destroy: 'POST' // }, // url: baseUrl+'iot/data/view/getSyncStatusVListByCompany', // reader: { // type: 'json', // root: 'RESULT', // totalProperty: 'totalCount' // }, // extraParams:{ // queryJson:Ext.JSON.encode(queryJson) // } // }, // sorters:[{ // property:'time', // direction:'DESC' // }], // remoteSort: true // }); // var CompanyStory = Ext.create('Ext.data.Store',{ // model: 'CompanyComboStore', // proxy: { // type: 'ajax', // actionMethods: { // create : 'POST', // read : 'POST', // by default GET // update : 'POST', // destroy: 'POST' // }, // url: baseUrl+'iot/company/view/getNameList', // reader: { // type: 'json', // root: 'RESULT', // totalProperty: 'totalCount' // }, // extraParams:{ // queryJson:Ext.JSON.encode(queryJson) // } // } // }); // var ClztStory = Ext.create('Ext.data.Store',{ // fields:['abbr','name'], // data:[ // {'abbr':0,'name':'未处理'}, // {'abbr':1,'name':'已处理'} // ] // }); // var FilterForm = Ext.create('Ext.form.Panel', { // id: 'VWaterOptionFilterForm', // labelWidth: 55, // defaultType: 'textfield', // bodyPadding: 15, // items: [{ // xtype:'combo', // fieldLabel:'单位名称', // id: 'ff_company_code', // name:'ff_company_code', // displayField : 'owner_name', // valueField : 'owner_id', // editable : false, // width:330, // store:CompanyStory // },{ // xtype:'combo', // fieldLabel:'处理状态', // id: 'ff_clzt', // name: 'ff_clzt', // displayField : 'name', // valueField : 'abbr', // editable : false, // width:330, // store:ClztStory // }], // buttons: [{ // text: '筛选', // iconCls:'ok_btn', // handler: function() { // var form = this.up('form').getForm(); // if (form.isValid()) { // var query = new Object(); //// var tmp = Ext.getCmp('ff_company_code'); // query.dwtype = '2'; // query.point_code = '2' // if(Ext.getCmp('ff_company_code').getValue().length>0){ // query.company_code = Ext.getCmp('ff_company_code').getValue(); // $("#company_code").val(query.company_code); // company_code = query.company_code; // $("#WaterPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.火警系统监控告警处理情况'); // }else{ // $("#company_code").val(''); // $("#WaterPiePanel_title_string").html('火警系统监控告警处理情况'); // company_code = null; // } // query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue(); // query.V_LOGINNAME = V_LOGINNAME; // query.V_PASSWORD = V_PASSWORD; // query.COMMSTATUS = 'NO'; // var jsonstr = Ext.JSON.encode(query); // myStore.getProxy().extraParams = { // queryJson : jsonstr // }; // Ext.getCmp('VWaterOptionListPageToolbar').moveFirst(); // Ext.getCmp('ff_company_code').setValue(''); // Ext.getCmp('ff_clzt').setValue(''); // Ext.getCmp('VWaterOptionFilterWin').hide(); // getCurrentData(); // } // } // },{ // text: '关闭', // iconCls: 'cancel_btn', // handler: function() { // Ext.getCmp('VWaterOptionFilterWin').hide(); // } // }] // }); // var filterwin = function() { // Ext.create('Ext.window.Window',{ // id: 'VWaterOptionFilterWin', // title: '水系统报告筛选', // height: 210, // width: 400, // layout: 'fit', // items: FilterForm, // closable:false, // modal:true, // closeAction: 'hide' // }).show(); // CompanyStory.reload(); // } // var radiogroup = new Ext.create('Ext.form.RadioGroup',{ // fieldLabel:'误报', // id:'uf_r_clwb', // width:300, // items:[{ // name:'uf_r_clwb', // inputValue:'1', // boxLabel:'是' // },{ // name:'uf_r_clwb', // inputValue:'0', // boxLabel:'否', // checked:true // }] // }); // var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{ // fieldLabel:'处理范围', // id:'uf_r_clfw', // width:300, // items:[{ // name:'uf_r_clfw', // inputValue:'1', // boxLabel:'批量' // },{ // name:'uf_r_clfw', // inputValue:'0', // boxLabel:'单一', // checked:true // }] // }); // var clear_modify_form = function(){ // Ext.getCmp('uf_company_name').setValue(''); // Ext.getCmp('uf_name').setValue(''); // Ext.getCmp('uf_device_code').setValue(''); // Ext.getCmp('uf_id').setValue(''); // Ext.getCmp('uf_status').setValue(''); // Ext.getCmp('uf_fullname').setValue(''); // Ext.getCmp('uf_clwb').setValue(''); // Ext.getCmp('uf_clr').setValue(''); // Ext.getCmp('uf_clsj').setValue(''); // Ext.getCmp('uf_clnr').setValue(''); // } // var fireInfoForm = Ext.create('Ext.form.Panel', { // id: 'waterInfoForm', // labelWidth: 55, // url: baseUrl+'iot/alarm/view/updateSj', // defaultType: 'textfield', // bodyPadding: 15, // items: [{ // fieldLabel:'单位名称', // id: 'uf_company_name', // name: 'uf_company_name', // anchor:'90%' // },{ // fieldLabel:'监控设备', // id:'uf_name', // name:'uf_name', // anchor:'100%' // },{ // fieldLabel:'设备编号', // id:'uf_device_code', // name:'uf_device_code', // hidden: true // },{ // fieldLabel:'记录编号', // id:'uf_id', // name:'uf_id', // hidden: true // },{ // fieldLabel:'设备编号', // id:'uf_status', // name:'uf_status', // hidden: true // },{ // fieldLabel:'报告信息', // id: 'uf_fullname', // name:'uf_fullname', // xtype: 'textareafield', // maxLength: 250, // cols:4, // anchor:'100%' // },{ // fieldLabel:'误报', // id: 'uf_clwb', // name:'uf_clwb', // maxLength: 200, // anchor:'65%' // },radiogroup,radiogroup2,{ // fieldLabel:'处理人', // id: 'uf_clr', // name:'uf_clr', // maxLength: 120, // anchor:'65%' // },{ // fieldLabel:'处理时间', // id: 'uf_clsj', // name:'uf_clsj', // maxLength: 200, // anchor:'80%' // },{ // fieldLabel:'处理内容', // id: 'uf_clnr', // name:'uf_clnr', // xtype: 'textareafield', // maxLength: 250, // cols:4, // anchor:'100%' // },{ // id:'fm_queryJson', // name:'queryJson', // hidden:true // }], // buttons: [{ // text: '处理', // id:'confirmBtn', // iconCls:'ok_btn', // handler: function() { // var form = this.up('form').getForm(); // if (form.isValid()) { // var queryJson = new Object(); // queryJson.V_LOGINNAME = V_LOGINNAME; // queryJson.V_PASSWORD = V_PASSWORD; // queryJson.id = Ext.getCmp('uf_id').getValue(); // queryJson.status = Ext.getCmp('uf_status').getValue(); // queryJson.name = Ext.getCmp('uf_name').getValue(); // queryJson.device_code = Ext.getCmp('uf_device_code').getValue(); // queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1'; // queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1'; // queryJson.clnr = Ext.getCmp('uf_clnr').getValue(); // var jsonstr = Ext.JSON.encode(queryJson); // Ext.getCmp('fm_queryJson').setValue(jsonstr); // form.submit({ // method:'post', // success: function(form, action) { // Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){ // clear_modify_form(); // myStore.reload(); // getCurrentData(); // }); // }, // failure: function(form, action) { // Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){ // clear_modify_form(); // myStore.reload(); // getCurrentData(); // }); // } // }); // this.up('window').close(); // } // } // },{ // text: '关闭', // iconCls: 'cancel_btn', // handler: function() { // this.up('window').close(); // } // }] // }); // var vWaterInfoWin = Ext.create('Ext.window.Window',{ // id:'VWaterInfoWin', // title:'详细信息: ', // width:400, // layout:'fit', // closable:false, // modal:true, // closeAction:'hide', // items:fireInfoForm // }); // var showFireInfoWin = function(record){ // vWaterInfoWin.show(); // $("#VInfoWin_Title").html(record.get('data')); // Ext.getCmp('uf_company_name').setValue(record.get('company_name')); // Ext.getCmp('uf_name').setValue(record.get('name')); // Ext.getCmp('uf_device_code').setValue(record.get('device_code')); // Ext.getCmp('uf_fullname').setValue(record.get('fullname')); // Ext.getCmp('uf_clr').setValue(record.get('clr_name')); // Ext.getCmp('uf_clsj').setValue(record.get('clsj')); // Ext.getCmp('uf_clnr').setValue(record.get('clnr')); // Ext.getCmp('uf_id').setValue(record.get('id')); // Ext.getCmp('uf_clwb').setValue(record.get('clwb')=='1'?'误报':'告警'); // Ext.getCmp('uf_status').setValue(record.get('status')); // if(record.get('clzt')=='已处理'){ // Ext.getCmp('uf_clwb').setVisible(true); // Ext.getCmp('uf_r_clwb').setVisible(false); // Ext.getCmp('uf_r_clfw').setVisible(false); // Ext.getCmp('confirmBtn').setVisible(false); // Ext.getCmp('uf_clr').setVisible(true); // Ext.getCmp('uf_clsj').setVisible(true); // }else{ // Ext.getCmp('uf_clwb').setVisible(false); // Ext.getCmp('uf_r_clwb').setVisible(true); // Ext.getCmp('uf_r_clfw').setVisible(true); // Ext.getCmp('confirmBtn').setVisible(true); // Ext.getCmp('uf_clr').setVisible(false); // Ext.getCmp('uf_clsj').setVisible(false); // } // } // var WaterOptionPanel = Ext.create('Ext.grid.Panel', { // title: '水系统监控单位列表', // titleCollapse:true, // id: 'VWaterOptionListPanel', // region:'center', // store: myStore, // columns: [ // { header: '序号', dataIndex: 'id',width:50, menuDisabled:true }, // { header: '单位名称', dataIndex: 'company_name',width:240, menuDisabled:true }, // { header: '详细地址', dataIndex: 'fulladdress', width:640, menuDisabled:true }, // { header: '单位类型', dataIndex: 'xmlx', width:100, menuDisabled:true }, // { header: '设备数量', dataIndex: 'list_count', width:80, menuDisabled:true } // ], // columnLines: true, // height: maxHeight, // width: '100%', // frame: true, // border:false, // iconCls: 'icon-grid', // listeners:{ // 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){ // pieMask.show(); // show_datapie(record); // } // } // }); // var piebar = Ext.create('Ext.panel.Panel',{ // id:'WaterPiePanel', // width:'100%', // height:pieWidth+50, // region:'north', // layout:'border', // title:'水系统监控设备通信信号情况', // defaults:{ // border:false // }, // items:[ // { // region:'east', // xtype:'panel', // id:'waterArea', // style:'overflow:auto', // width:currentWidth // } // ] // }); // pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."}); // new Ext.create('Ext.panel.Panel',{ // width:'100%', // id: 'WaterAlarmPanel', // layout:'border', // items:[ // piebar,WaterOptionPanel // ], // renderTo: Ext.getBody() // }); // pieMask.show(); // myStore.addListener('load',function(store,record,opts){ // pieMask.show(); // WaterOptionPanel.getSelectionModel().select(0,true); // getCurrentData(); // }); // myStore.reload(); // maxHeight = document.documentElement.clientHeight; // Ext.getCmp('WaterAlarmPanel').setHeight(maxHeight); // //});