12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085 |
- /**
- *
- */
- 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 centerLng;
- var centerLat;
- var company_code;
- var theme;
- var ConfirmStore
- var pieWidth;
- var showAlarm=null;
- var pieMask;
- var V_LOGINNAME='',V_PASSWORD='';
- var maxHeight = 10000;
- var maxWidth = 10000;
- var companyName = null;
- var sm = Ext.create('Ext.selection.CheckboxModel');
- Ext.define('VFireOption',{
- extend: 'Ext.data.Model',
- fields: [
- { name:'id', type:'int'},
- { name:'orderIdx', type:'int'},
- { name:'device_code', type:'string' },
- { name:'company_code', type:'string' },
- { name:'company_name', type:'string' },
- { name:'fullname', type:'string' },
- { name:'time', type:'string' },
- { name:'name', type:'string' },
- { name:'status', type:'string' },
- { name:'data', type:'string' },
- { name:'clzt', type:'string' },
- { name:'clr_name', type:'string' },
- { name:'clsj', type:'string' },
- { name:'clnr', type:'string'},
- { name:'clwb', type:'string'}
- ]
- });
- 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;i<StatusStore.length;i++){
- if((StatusStore[i].point_list!=null)
- &&(StatusStore[i].point_list!=undefined)
- &&(StatusStore[i].point_list.length>0)){
- for(var j=0;j<StatusStore[i].point_list.length;j++){
- if(StatusStore[i].point_list[j].device_id!=current_device_id){
- current_device_id=StatusStore[i].point_list[j].device_id;
- device_count++;
- if((StatusStore[i].point_list[j].dwtype=='1')
- ||(StatusStore[i].point_list[j].dwtype==1))
- fire_device_count++;
- else if((StatusStore[i].point_list[j].dwtype=='2')
- ||(StatusStore[i].point_list[j].dwtype==2))
- water_device_count++;
- else if((StatusStore[i].point_list[j].dwtype=='3')
- ||(StatusStore[i].point_list[j].dwtype==3))
- other_device_count++;
- else if((StatusStore[i].point_list[j].dwtype=='4')
- ||(StatusStore[i].point_list[j].dwtype==4))
- water_device_count++;
- else if((StatusStore[i].point_list[j].dwtype=='5')
- ||(StatusStore[i].point_list[j].dwtype==5))
- water_device_count++;
- else if((StatusStore[i].point_list[j].dwtype=='6')
- ||(StatusStore[i].point_list[j].dwtype==6))
- rtu_device_count++;
- else
- other_device_count++;
- }
- if((StatusStore[i].point_list[j].point_code=='0')
- ||(StatusStore[i].point_list[j].point_code==0)){
- if((StatusStore[i].point_list[j].point_data!='0')
- &&(StatusStore[i].point_list[j].point_data!=0)){
- if((StatusStore[i].point_list[j].dwtype=='1')
- ||(StatusStore[i].point_list[j].dwtype==1))
- fire_device_alarm++;
- else if((StatusStore[i].point_list[j].dwtype=='2')
- ||(StatusStore[i].point_list[j].dwtype==2)){
- if((StatusStore[i].point_list[j].point_data=='4')
- ||(StatusStore[i].point_list[j].point_data==4))
- water_device_out++;
- else
- water_device_alarm++;
- }
- else if((StatusStore[i].point_list[j].dwtype=='3')
- ||(StatusStore[i].point_list[j].dwtype==3))
- other_device_out++;
- else if((StatusStore[i].point_list[j].dwtype=='4')
- ||(StatusStore[i].point_list[j].dwtype==4))
- if((StatusStore[i].point_list[j].point_data=='4')
- ||(StatusStore[i].point_list[j].point_data==4))
- water_device_out++;
- else
- water_device_alarm++;
- else if((StatusStore[i].point_list[j].dwtype=='5')
- ||(StatusStore[i].point_list[j].dwtype==5))
- if((StatusStore[i].point_list[j].point_data=='4')
- ||(StatusStore[i].point_list[j].point_data==4))
- water_device_out++;
- else
- water_device_alarm++;
- else if((StatusStore[i].point_list[j].dwtype=='6')
- ||(StatusStore[i].point_list[j].dwtype==6))
- rtu_device_out++;
- else
- other_device_out++;
- }
- }
- }
- }
- }
- fire_device_normal = fire_device_count-fire_device_out-fire_device_alarm;
- water_device_normal = water_device_count-water_device_out-water_device_alarm;
- rtu_device_normal = rtu_device_count-rtu_device_out-rtu_device_alarm;
- other_device_normal = other_device_count-other_device_out-other_device_alarm;
- total_normal = fire_device_normal+water_device_normal+rtu_device_normal+other_device_normal;
- var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
- draw_cycle_icon('firePie1','设备在线<br/> <br/>监控总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_count+'</span><br/>在线总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(fire_device_count-fire_device_out)+'</span><br/>离线线总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_out+'</span><br/>在线率:',fire_device_count,(fire_device_count-fire_device_out),themecolor);
- draw_cycle_icon('firePie2','状态正常<br/> <br/>在线总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(fire_device_count-fire_device_out)+'</span><br/>正常总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_normal+'</span><br/>告警总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+fire_device_alarm+'</span><br/>正常率:',(fire_device_count-fire_device_out),fire_device_normal,themecolor);
- }
- }
- var draw_confirm = function(){
- var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
- if(companyName!=null)
- $("#FirePiePanel_title_string").html(companyName+'.离线报告列表');
- else
- $("#FirePiePanel_title_string").html('离线报告列表');
- for(var i=0;i<ConfirmStore.length;i++){
- if(ConfirmStore[i].id=='fire_alarm'){
- var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
- var percent = 100;
- if(ConfirmStore[i].count>0)
- percent = Number(((ConfirmStore[i].sum*100)/ConfirmStore[i].count).toString().match(/^\d+(?:\.\d{0,2})?/));
- if(percent<60)
- mColor = '#f66167';
- else if(percent<80)
- mColor = '#DDDF0D';
- $("#operation_num_1").html(ConfirmStore[i].count);
- $("#operation_num_2").html(ConfirmStore[i].sum);
- $("#operation_num_3").html(ConfirmStore[i].count-ConfirmStore[i].sum);
- $("#operation_num_4").html(percent);
- // draw_cycle_icon('firePie3','告警处理情况<br/>告警总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].count+'</span><br/>已处理:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].sum+'</span><br/>未处理:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'</span><br/>处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor);
- Highcharts.getOptions().colors = Highcharts.map(['#DDDF0D',mColor], 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('operation_pie',{
- chart: {
- type: 'solidgauge',
- height: '100%',
- backgroundColor: 'rgba(0,0,0,0)',
- animation: false
- },
- title:{
- text:percent+'%',
- floating:true,
- y:90,
- style:{fontSize:'16px',color:themecolor,fontWeight:'bold'}
- },
- exporting: {
- enabled: false
- },
- credits: {
- enabled: false
- },
- tooltip: {
- enabled: false
- },
- pane: {
- startAngle: 0,
- background: [{
- outerRadius: '110%',
- innerRadius: '55%',
- 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: 'rgba(0,0,0,0.3)',
- radius: '110%',
- innerRadius: '60%',
- y: 100
- },{
- color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
- radius: '110%',
- innerRadius: '60%',
- y: percent
- }]
- }]
- });
- Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5'], function (color) {
- return {
- linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
- stops: [
- [0, color],
- [1, Highcharts.Color(color).setOpacity(0).get('rgb')] // darken
- ]
- };
- });
- Highcharts.chart('operation_area',{
- chart:{
- type:'area',
- // zoomType: 'x',
- backgroundColor: 'rgba(0,0,0,0)'
- },
- color:['#f66167', '#34abf5'],
- title:{
- text:(companyName==null)?'火灾监控离线处理情况跟踪':companyName+'.火灾监控离线处理情况跟踪',
- float:true,
- style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
- enabled:false
- },
- legend:{
- // enabled:false,
- floating:true,
- x:410,
- y:-210,
- itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
- },
- // colors:['#f66167', '#34abf5'],
- exporting: {
- enabled: false
- },
- credits: {
- enabled: false
- },
- xAxis:{
- categories:ConfirmStore[i].day_list,
- tickmarkPlacement:'on',
- gridLineWidth:0,
- labels:{
- enabled:false,
- style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
- },
- title:{
- enabled:false
- }
- },
- yAxis:{
- title:{
- enabled:false,
- text:'次',
- style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
- },
- gridLineWidth:1,
- gridLineColor:'rgba(0,0,0,0.2)',
- labels:{
- // enabled:false,
- formatter:this.value,
- style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
- }
- },
- plotOptions:{
- area:{
- stackiung:'normal',
- // fillOpacity:0.1,
- // lineColor:'#666666',
- // lineWidth:1,
- marker:{
- lineWidth:0,
- enabled:false,
- radius:0
- // lineColor:'#666666'
- }
- }
- },
- series:[
- {
- name:'离线次数',
- data:ConfirmStore[i].count_list,
- lineWidth:1,
- lineColor:'#f66167',
- fillColor: {
- linearGradient: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 1
- },
- stops: [
- [0, '#f66167'],
- [1, Highcharts.Color('#f66167').setOpacity(0.3).get('rgba')]
- ]
- }
- },{
- name:'处理次数',
- data:ConfirmStore[i].sum_list,
- lineWidth:1,
- lineColor:'#34abf5',
- fillColor: {
- linearGradient: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 1
- },
- stops: [
- [0, '#34abf5'],
- [1, Highcharts.Color('#34abf5').setOpacity(0.3).get('rgba')]
- ]
- },
- }
- ]
- });
- }
- }
- }
- 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('<br/><br/>'+name+percent+'%');
- Highcharts.getOptions().colors = Highcharts.map([ '#000000',mColor, mColor], 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: '85%',
- backgroundColor: 'rgba(0,0,0,0)',
- reflow:true,
- marginTop:0
- },
- title:{
- text:percent+'%',
- 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: 100,
- lineWidth: 0,
- tickPositions: []
- },
- plotOptions: {
- solidgauge: {
- dataLabels: {
- enabled: false
- },
- linecap: 'square',
- stickyTracking: false,
- rounded: false,
- warp: false
- }
- },
- series:[{
- name:'',
- data:[{
- color: Highcharts.Color(mColor)
- .setOpacity(0.2)
- .get(),
- radius: '110%',
- innerRadius: '80%',
- y: 100
- },{
- color: (Highcharts.theme && Highcharts.theme.contrastTextColor) ,
- radius: '110%',
- innerRadius: '80%',
- y: percent
- },{
- color: (Highcharts.theme && Highcharts.theme.contrastTextColor) ,
- radius: '60%',
- innerRadius: '0%',
- y: 100
- }]
- }]
- });
- if((theme=='access')||(theme=='')){
- $('#'+icon_id).addClass('shadow_black');
- }else{
- $('#'+icon_id).addClass('shadow_white');
- }
- }
- var getCurrentData = function(){
- var query = new Object();
- // query.V_LOGINNAME = V_LOGINNAME;
- // query.V_PASSWORD = V_PASSWORD;
- query.dwtype='1';
- query.COMMSTATUS = 'ONLY';
- if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
- query.company_code = company_code;
- pieMask.show();
- $.ajax({
- type:'POST',
- url: baseUrl+"iot/alarm/view/getConfirmStatusByDays",
- data: {
- queryJson : Ext.JSON.encode(query)
- },
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.action=='getConfirmStatusByDays'){
- if(json.check=='true'){
- ConfirmStore = json.RESULT;
- if(json.company_name!=null)
- companyName = json.company_name;
- else
- companyName = null;
- draw_confirm();
- }else{
- Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
- window.parent.frames.return_login();
- });
- }
- }
- pieMask.hide();
- }
- });
- }
- var body_resize = function(){
- maxHeight = document.documentElement.clientHeight;
- maxWidth = document.documentElement.clientWidth;
- Ext.getCmp('FireAlarmPanel').setHeight(maxHeight);
- Ext.getCmp('FireAlarmPanel').setWidth(maxWidth);
- }
- function exportbtn_click(){
- V_LOGINNAME = $("#V_LOGINNAME").val();
- company_code = document.getElementById('company_code').value;
- clzt = document.getElementById('clzt').value;
- time_start = document.getElementById('time_start').value;
- time_end = document.getElementById('time_end').value;
- var fields = '';
- var array = ['id','company_name','device_code','name','data2','clr','clnr','clwb','clzt','time','clsj'];
- var name = ['编号','公司名称','设备编号','设备名称','报警类型','处理人','处理内容','是否误报','处理状态','报警时间','处理时间'];
- for(var i=0;i<11;i++){
- if(i>0)
- fields += ',';
- fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
- }
- var query = new Object();
- // query.V_LOGINNAME = V_LOGINNAME;
- query.company_code = company_code;
- query.clzt = clzt;
- query.time_start = time_start;
- query.time_end = time_end;
- query.COMMSTATUS = 'ONLY';
- query.EXPORT_FILE = '火系统离线数据列表';
- query.fields = '['+fields+']';
- $.ajax({
- type:'POST',
- url: baseUrl+"iot/excel/view/fireAlarmExcel",
- data: {
- queryJson : Ext.JSON.encode(query)
- },
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.action=='dormExport'){
- ConfirmStore = json.RESULT;
- var elemIF = document.createElement("iframe");
- elemIF.src = baseUrl+json.filename;
- elemIF.style.display = "none";
- document.body.appendChild(elemIF);
- }
-
- }
- });
-
- }
- 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 = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
- var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
- var countPerPage = 20;
-
- 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.COMMSTATUS = 'ONLY';
- if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
- queryJson.company_code = company_code;
- var myStore = Ext.create('Ext.data.Store', {
- model: 'VFireOption',
- pageSize: countPerPage,
- proxy: {
- type: 'ajax',
- actionMethods: {
- create : 'POST',
- read : 'POST', // by default GET
- update : 'POST',
- destroy: 'POST'
- },
- url: baseUrl+'iot/alarm/view/getHJList',
- reader: {
- type: 'json',
- root: 'RESULT',
- totalProperty: 'totalCount'
- },
- extraParams:{
- queryJson:Ext.JSON.encode(queryJson)
- }
- },
- sorters:[{
- property:'time',
- direction:'DESC'
- }],
- remoteSort: true
- });
- myStore.on("load",function(myStore){
- getCurrentData();
- //do something
- });
- 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: 'VFireOptionFilterForm',
- 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:'datefield',
- fieldLabel:"开始日期",
- minValue:'07/07/2017',
- minText:"当前日期选择应大于当天日期",
- format:"Y-m-d",
- columnWidth:0.5,
- id: 'ff_start_data',
- name:"ff_start_data",
- editable:false,//只读约束
- width:330
- },{
- xtype:'datefield',
- fieldLabel:"结束日期",
- minValue:'07/07/2017',
- minText:"当前日期选择应大于当天日期",
- format:"Y-m-d",
- columnWidth:0.5,
- id: 'ff_end_data',
- name:"ff_end_data",
- editable:false,//只读约束
- width:330
- },{
- 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');
- if(Ext.getCmp('ff_company_code').getValue()){
- query.company_code = Ext.getCmp('ff_company_code').getValue();
- $("#company_code").val(query.company_code);
- company_code = query.company_code;
- $("#FirePiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.离线报告列表');
- }else{
- $("#company_code").val('');
- $("#FirePiePanel_title_string").html('离线报告列表');
- company_code = null;
- }
- if(Ext.getCmp('ff_clzt').getValue()){
- query.clzt = Ext.getCmp('ff_clzt').getValue();
- $("#clzt").val(query.clzt);
-
- }else{
- $("#clzt").val('');
- }
- if(Ext.getCmp('ff_start_data').getValue()){
- query.time_start = Ext.getCmp('ff_start_data').getValue();
- var datetime=query.time_start.getFullYear() + '-' + (query.time_start.getMonth() + 1) + '-' + query.time_start.getDate() + ' ' + query.time_start.getHours() + ':' + query.time_start.getMinutes() + ':' + query.time_start.getSeconds();
- $("#time_start").val(datetime);
-
- }else{
- $("#time_start").val('');
- }
- if(Ext.getCmp('ff_end_data').getValue()){
- query.time_end = Ext.getCmp('ff_end_data').getValue();
- var datetime1=query.time_end.getFullYear() + '-' + (query.time_end.getMonth() + 1) + '-' + query.time_end.getDate() + ' ' + query.time_end.getHours() + ':' + query.time_end.getMinutes() + ':' + query.time_end.getSeconds();
- $("#time_end").val(datetime1);
-
- }else{
- $("#time_end").val('');
- }
- // 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 = 'ONLY';
- var jsonstr = Ext.JSON.encode(query);
- myStore.getProxy().extraParams = {
- queryJson : jsonstr
- };
- Ext.getCmp('VFireOptionListPageToolbar').moveFirst();
- Ext.getCmp('ff_company_code').setValue('');
- Ext.getCmp('ff_clzt').setValue('');
- Ext.getCmp('VFireOptionFilterWin').hide();
- // getCurrentData();
- }
- }
- },{
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function() {
- Ext.getCmp('VFireOptionFilterWin').hide();
- }
- }]
- });
- var filterwin = function() {
- Ext.create('Ext.window.Window',{
- id: 'VFireOptionFilterWin',
- 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: 'fireInfoForm',
- labelWidth: 55,
- url: baseUrl+'iot/alarm/view/updateHj',
- 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 vFileInfoWin = Ext.create('Ext.window.Window',{
- id:'VFileInfoWin',
- title:'详细信息: <span id="VInfoWin_Title"></span>',
- width:400,
- layout:'fit',
- closable:false,
- modal:true,
- closeAction:'hide',
- items:fireInfoForm
- });
- var showFireInfoWin = function(record){
- vFileInfoWin.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 FireOptionPanel = Ext.create('Ext.grid.Panel', {
- // title: '离线报告列表',
- header :{
- height:0,
- border:'0px solid #000000'
- },
- titleCollapse:true,
- id: 'VFireOptionListPanel',
- region:'center',
- store: myStore,
- // selModel: sm,
- columns: [
- { header: 'id', dataIndex:'id',hidden:true, menuDisabled:true},
- { header: '序号', dataIndex: 'orderIdx',width:50, menuDisabled:true },
- { header: '单位名称', dataIndex: 'company_name',width:240, menuDisabled:true },
- { header: '报告时间', dataIndex: 'time', width:160, menuDisabled:true },
- { header: '报告数据', dataIndex: 'data', width:140, menuDisabled:true },
- { header: '报告内容', dataIndex: 'fullname', width:900,minWidth:400, maxWidth:1600,menuDisabled:true },
- { header: '处理状态', dataIndex: 'clzt', width:100, menuDisabled:true },
- { header: '处理人', dataIndex: 'clr_name',width:150, menuDisabled:true },
- { header: '处理时间', dataIndex: 'clsj', width:160, menuDisabled:true }
- ],
- columnLines: true,
- height: maxHeight,
- width: '100%',
- tbar: new Ext.create('Ext.toolbar.Toolbar',{
- items:[{
- html:'<span id="FirePiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">离线报告列表</span>'
- },'->',{
- xtype: 'button',
- iconCls:'back_btn',
- text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
- listeners: {
- click: function(){
- window.parent.document.location=baseUrl+'view/frontpage/map.jsp?&theme='+theme+'&company_code='+company_code;
- }
- }
- },'-',
- {
- xtype: 'button',
- iconCls:'filter_btn',
- text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
- listeners: {
- click: filterwin
- }
- },'-',
- {
- xtype: 'button',
- iconCls:'filter_btn',
- text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">导出</span>',
- listeners: {
- click: exportbtn_click
-
- }
- },'-']
- }),
- bbar: new Ext.PagingToolbar({
- store: myStore,
- id:'VFireOptionListPageToolbar',
- displayInfo: true,
- pageSize: countPerPage,
- prependButtons: true,
- displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
- emptyMsg : "没有记录",
- firstText: '第一页',
- prevText: '前一页',
- nextText: '后一页',
- lastText: '最后一页',
- refreshText: '刷新'
- }),
- frame: true,
- border:false,
- iconCls: 'icon-grid',
- listeners:{
- 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){
- showFireInfoWin(record);
- }
- }
- });
- var piebar = Ext.create('Ext.panel.Panel',{
- id:'FirePiePanel',
- width:'100%',
- height:498,
- region:'north',
- layout:'border',
- defaults:{
- border:false
- },
- html:'<div id="operation_body" class="operation_body"><div id="operation_dock_l" class="operation_dock_l"></div><div id="operation_dock_r" class="operation_dock_r"></div><img id="operation_title_icon" class="operation_title_icon" width="48" height="48" src="../../res/img/icons/1.gif"/><div id="operation_title_text" class="operation_title_text">火灾监控离线处理情况</div><div id="operation_label_1" class="operation_label_1">总数</div><div id="operation_label_2" class="operation_label_2">已处理</div><div id="operation_label_3" class="operation_label_3">未处理</div><div id="operation_label_4" class="operation_label_4">处置率</div><div id="operation_num_1" class="operation_num_1"></div><div id="operation_num_2" class="operation_num_2"></div><div id="operation_num_3" class="operation_num_3"></div><div id="operation_num_4" class="operation_num_4"></div><div id="operation_pie_bg" class="operation_pie_bg"></div><div id="operation_pie" class="operation_pie"></div><div id="operation_pie_title" class="operation_pie_title">处置率</div><div id="operation_area_bg" class="operation_area_bg"></div><div id="operation_area" class="operation_area"></div></div>'
- });
- pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
- new Ext.create('Ext.panel.Panel',{
- width:'100%',
- id: 'FireAlarmPanel',
- layout:'border',
- items:[
- piebar,FireOptionPanel
- ],
- renderTo: Ext.getBody()
- });
- myStore.reload();
- // getCurrentData();
- $(window).resize(function(){
- body_resize();
- });
- body_resize();
- });
|