/** * */ 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('FireStationOption', { extend: 'Ext.data.Model', fields: [ {name: 'id', type: 'int'}, {name: 'company', type: 'string'}, {name: 'companyCode', type: 'string'}, {name: 'fireSataionName', type: 'string'}, {name: 'addr', type: 'string'}, {name: 'phone', type: 'string'}, {name: 'area', type: 'string'}, {name: 'type', type: 'int'}, {name: 'status', type: 'int'}, {name: 'baifirehosenozzle', type: 'int'}, {name: 'firehose', type: 'int'}, {name: 'abc', type: 'int'}, {name: 'turnouts', type: 'int'}, {name: 'firehat', type: 'int'}, {name: 'firefightersboots', type: 'int'}, {name: 'entrytool', type: 'int'}, {name: 'firecar', type: 'int'}, {name: 'zd', type: 'string'}, {name: 'zz', type: 'string'}, {name: 'stationMaster', type: 'string'}, {name: 'stationMasterPhoen', type: 'string'}, {name: 'insertTime', type: 'string'}, {name: 'dd', type: 'string'} ] }); Ext.define('CompanyComboStore', { extend: 'Ext.data.Model', fields: [ // {name:'company', type:'string'}, // {name:'companyCode',type:'string'} {name: 'owner_name', type: 'string'}, {name: 'owner_id', type: 'string'} ] }); var draw_confirm = function () { if (companyName != null) $("#FirePiePanel_title_string").html(companyName + '.单位微型消防站列表'); else $("#FirePiePanel_title_string").html('单位微型消防站列表'); var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000'; for (var i = 0; i < ConfirmStore.length; i++) { if (ConfirmStore[i].id == 'efire_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','告警处理情况
告警总数:'+ConfirmStore[i].count+'
已处理:'+ConfirmStore[i].sum+'
未处理:'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'
处理率:',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('

' + 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(50,11,11,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 = '7'; query.COMMSTATUS = 'NO'; 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', 'data1', '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.status = status; query.time_start = time_start; query.time_end = time_end; query.COMMSTATUS = 'NO'; query.EXPORT_FILE = '电气火灾告警数据列表'; query.fields = '[' + fields + ']'; $.ajax({ type: 'POST', url: baseUrl + "iot/excel/view/EfireAlarmExcel", 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 = '' var unchkIcon = '' var countPerPage = 30; 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 = 'NO'; if ((company_code != null) && (company_code != 'null') && (company_code.length > 0)) queryJson.company_code = company_code; var myStore = Ext.create('Ext.data.Store', { model: 'FireStationOption', pageSize: countPerPage, proxy: { type: 'ajax', actionMethods: { create: 'POST', read: 'POST', // by default GET update: 'POST', destroy: 'POST' }, url: baseUrl + 'FireStationController/queryFireStation', 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', //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: ['status', 'name'], data: [ {'status': '0', 'name': '未启用'}, {'status': '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:'combo', fieldLabel:'单位名称', id: 'ff_company_code', name:'ff_company_code', displayField : 'owner_name', valueField : 'owner_id', allowBlank:false, blankText:"不能为空", editable : false, width:330, store:CompanyStory },*/ { xtype: 'combo', fieldLabel: '启用状态', id: 'ff_qyzt', name: 'ff_qyzt', displayField: 'name', valueField: 'status', 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_qyzt').getValue()) { query.status = Ext.getCmp('ff_qyzt').getValue(); $("#status").val(query.status); } else { $("#status").val(''); } query.status = Ext.getCmp('ff_qyzt').getValue() == null ? "" : Ext.getCmp('ff_qyzt').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('FireStationListPageToolbar').moveFirst(); Ext.getCmp('ff_company_code').setValue(''); Ext.getCmp('ff_qyzt').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: 'stationType', width: 300, items: [{ name: 'stationType', inputValue: '1', boxLabel: '重点', }, { name: 'stationType', inputValue: '0', boxLabel: '社区微站', //checked: }] }); var radiogroup2 = new Ext.create('Ext.form.RadioGroup', { fieldLabel: '启用状态', id: 'stationStatus', width: 300, items: [{ name: 'stationStatus', inputValue: '1', boxLabel: '启用' }, { name: 'stationStatus', inputValue: '0', boxLabel: '未启用', // checked:true }] }); var but =Ext.create('Ext.Button', { text: '详情', listeners: { blur : function() { Ext.create('Ext.window.Window', { id: 'VFireOptionFilterWin', title: '单位消防站筛选', height: 210, width: 400, layout: 'fit', items: FilterForm, closable: false, modal: true, closeAction: 'hide' }).show(); } } }) var childPanel2 = Ext.create('Ext.Panel', { html: '==========================基本信息===================' }); var clear_modify_form = function () { Ext.getCmp('fireSataionName').setValue(''); Ext.getCmp('company').setValue(''); Ext.getCmp('addr').setValue(''); Ext.getCmp('id').setValue(''); Ext.getCmp('stationStatus').setValue(''); Ext.getCmp('phone').setValue(''); Ext.getCmp('stationType').setValue(''); Ext.getCmp('area').setValue(''); // Ext.getCmp('uf_clsj').setValue(''); Ext.getCmp('firehose').setValue(''); } var clear_add_form = function () { Ext.getCmp('addfireSataionName').setValue(''); // Ext.getCmp('addcompany').setValue(''); Ext.getCmp('addfm_companyCode').setValue(''); Ext.getCmp('addaddr').setValue(''); Ext.getCmp('addid').setValue(''); Ext.getCmp('addphone').setValue(''); Ext.getCmp('addarea').setValue(''); Ext.getCmp('addbaifirehosenozzle').setValue(''); Ext.getCmp('addfirehose').setValue(''); Ext.getCmp('addabc').setValue(''); Ext.getCmp('addturnouts').setValue(''); Ext.getCmp('addfirehat').setValue(''); Ext.getCmp('addfirefightersboots').setValue(''); Ext.getCmp('addfirecar').setValue(''); Ext.getCmp('addentrytool').setValue(''); Ext.getCmp('addzd').setValue(''); Ext.getCmp('adddd').setValue(''); Ext.getCmp('addzz').setValue(''); Ext.getCmp('addstationMaster').setValue(''); Ext.getCmp('addstationMasterPhoen').setValue(''); } var fireInfoForm = Ext.create('Ext.form.Panel', { id: 'fireInfoForm', labelWidth: 55, layout: "column", url: baseUrl + 'FireStationController/updataFireStation', defaultType: 'textfield', bodyPadding: 15, items: [{ fieldLabel: '消防站名称', id: 'fireSataionName', name: 'fireSataionName', anchor: '100%' }, { fieldLabel: '所属单位', id: 'company', name: 'company', anchor: '100%' }, { fieldLabel: '单位编号', id: 'fm_companyCode', name: 'companyCode', anchor: '100%', hidden: true }, { fieldLabel: '记录编号', id: 'id', name: 'id', hidden: true }, { fieldLabel: '值班电话', id: 'phone', name: 'phone', xtype: 'textareafield', maxLength: 13, anchor: '100%' }, { fieldLabel: '详细地址', id: 'addr', name: 'addr', maxLength: 120, anchor: '65%' }, radiogroup, radiogroup2, { fieldLabel: '所属区域', id: 'area', name: 'area', maxLength: 120, anchor: '65%' }, { fieldLabel: '水枪数量/只', id: 'baifirehosenozzle', name: 'baifirehosenozzle', maxLength: 50, anchor: '15%' }, { fieldLabel: '水带/条', id: 'firehose', name: 'firehose', maxLength: 50, anchor: '15%' }, { fieldLabel: '灭火器/个', id: 'abc', name: 'abc', maxLength: 50, anchor: '15%', },but,{ fieldLabel: '防护服/件', id: 'turnouts', name: 'turnouts', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防头盔/个', id: 'firehat', name: 'firehat', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防靴/双', id: 'firefightersboots', name: 'firefightersboots', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防车/辆', id: 'firecar', name: 'firecar', maxLength: 50, anchor: '15%' }, { fieldLabel: '破拆工具/套', id: 'entrytool', name: 'entrytool', maxLength: 50, anchor: '15%' }, { fieldLabel: '辖区支队', id: 'zd', name: 'zd', maxLength: 50, anchor: '50%' }, { fieldLabel: '辖区大队', id: 'dd', name: 'dd', maxLength: 50, anchor: '50%' }, { fieldLabel: '辖区中队', id: 'zz', name: 'zz', maxLength: 50, anchor: '50%' }, { fieldLabel: '站长', id: 'stationMaster', name: 'stationMaster', maxLength: 50, anchor: '25%' }, { fieldLabel: '站长电话', id: 'stationMasterPhoen', name: 'stationMasterPhoen', anchor: '50%' }, { fieldLabel: '添加时间', id: 'insertTime', name: 'insertTime', maxLength: 50, anchor: '55%' }, { 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('id').getValue(); queryJson.company = Ext.getCmp('company').getValue(); queryJson.addr = Ext.getCmp('addr').getValue(); queryJson.status = Ext.getCmp('stationStatus').getChecked()[0].boxLabel == '启用' ? 1 : 0; queryJson.type = Ext.getCmp('stationType').getChecked()[0].boxLabel == '重点' ? 1 : 0; queryJson.firehose = Ext.getCmp('firehose').getValue(); //=============================================================== queryJson.phone = Ext.getCmp('phone').getValue(); queryJson.fireSataionName = Ext.getCmp('fireSataionName').getValue(); queryJson.companyCode = Ext.getCmp('fm_companyCode').getValue(); // queryJson.type = Ext.getCmp('type').getValue(); queryJson.area = Ext.getCmp('area').getValue(); queryJson.baifirehosenozzle = Ext.getCmp('baifirehosenozzle').getValue(); queryJson.abc = Ext.getCmp('abc').getValue(); queryJson.turnouts = Ext.getCmp('turnouts').getValue(); queryJson.firefightersboots = Ext.getCmp('firefightersboots').getValue(); queryJson.entrytool = Ext.getCmp('entrytool').getValue(); queryJson.firecar = Ext.getCmp('firecar').getValue(); queryJson.firehat = Ext.getCmp('firehat').getValue(); queryJson.zd = Ext.getCmp('zd').getValue(); queryJson.dd = Ext.getCmp('dd').getValue(); queryJson.zz = Ext.getCmp('zz').getValue(); queryJson.stationMaster = Ext.getCmp('stationMaster').getValue(); queryJson.stationMasterPhoen = Ext.getCmp('stationMasterPhoen').getValue(); queryJson.insertTime = Ext.getCmp('insertTime').getValue(); //========================================================== var jsonstr = Ext.JSON.encode(queryJson); Ext.getCmp('fm_queryJson').setValue(jsonstr); form.submit({ method: 'post', success: function (form, action) { Ext.Msg.alert('操作成功', '已确认1条记录', 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: '微型消防站信息: ', width: 928, layout: 'fit', closable: false, modal: true, closeAction: 'hide', items: fireInfoForm }); var addwin = function () { Ext.create('Ext.window.Window', { title: '新增单位微型消防站', height: 405, width: 945, layout: 'fit', items: addfireInfoForm, closable: false, modal: true, closeAction: 'hide' }).show(); //CompanyStory.reload(); } //================================================ var addradiogroup = new Ext.create('Ext.form.RadioGroup', { fieldLabel: '微站类型', id: 'addstationType', width: 300, items: [{ name: 'stationType', inputValue: '1', boxLabel: '重点', }, { name: 'stationType', inputValue: '0', boxLabel: '社区微站', //checked: }] }); var addradiogroup2 = new Ext.create('Ext.form.RadioGroup', { fieldLabel: '启用状态', id: 'addstationStatus', width: 300, items: [{ name: 'stationStatus', inputValue: '1', boxLabel: '启用' }, { name: 'stationStatus', inputValue: '0', boxLabel: '未启用', // checked:true }] }); var fireStationInfoForm = Ext.create('Ext.form.Panel', { id: 'fireStationInfoForm', labelWidth: 55, layout: "column", url: baseUrl + 'FireStationController/fireStationInfoForm', defaultType: 'textfield', bodyPadding: 15, items: [{ fieldLabel: '消防站名称', id: 'addfireSataionName', name: 'fireSataionName', allowBlank: false, blankText: "不能为空", anchor: '100%' }, { xtype: 'combo', fieldLabel: '单位名称', id: 'addfm_companyCode', name: 'company', displayField: 'owner_name', valueField: 'owner_id', allowBlank: false, blankText: "不能为空", editable: false, width: 330, store: CompanyStory }, { fieldLabel: '详细地址', allowBlank: false, blankText: "不能为空", id: 'addaddr', name: 'addr', hidden: true }, { fieldLabel: '记录编号', id: 'addid', name: 'id', hidden: true }, { fieldLabel: '值班电话', allowBlank: false, blankText: "不能为空", id: 'addphone', name: 'phone', xtype: 'textareafield', maxLength: 13, anchor: '100%' }, { fieldLabel: '详情地址', allowBlank: false, blankText: "不能为空", id: 'addaddr', name: 'area', maxLength: 120, anchor: '65%' }, addradiogroup, addradiogroup2, { fieldLabel: '所属区域', id: 'addarea', name: 'area', maxLength: 120, anchor: '65%' }, { fieldLabel: '水枪数量/只', id: 'addbaifirehosenozzle', allowBlank: false, blankText: "不能为空", name: 'baifirehosenozzle', maxLength: 50, anchor: '15%' }, { fieldLabel: '水带/条', id: 'addfirehose', allowBlank: false, blankText: "不能为空", name: 'firehose', maxLength: 50, anchor: '15%' }, { fieldLabel: '灭火器/个', allowBlank: false, blankText: "不能为空", id: 'addabc', name: 'abc', maxLength: 50, anchor: '15%' }, { fieldLabel: '防护服/件', allowBlank: false, blankText: "不能为空", id: 'addturnouts', name: 'turnouts', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防头盔/个', allowBlank: false, blankText: "不能为空", id: 'addfirehat', name: 'firehat', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防靴/双', id: 'addfirefightersboots', allowBlank: false, blankText: "不能为空", name: 'firefightersboots', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防车/辆', id: 'addfirecar', name: 'firecar', maxLength: 50, anchor: '15%' }, { fieldLabel: '破拆工具/套', id: 'addentrytool', allowBlank: false, blankText: "不能为空", name: 'entrytool', maxLength: 50, anchor: '15%' }, { fieldLabel: '辖区支队', id: 'addzd', name: 'zd', maxLength: 50, anchor: '50%' }, { fieldLabel: '辖区大队', id: 'adddd', name: 'dd', maxLength: 50, anchor: '50%' }, { fieldLabel: '辖区中队', id: 'addzz', name: 'zz', maxLength: 50, anchor: '50%' }, { fieldLabel: '站长', id: 'addstationMaster', name: 'stationMaster', maxLength: 50, anchor: '25%' }, { fieldLabel: '站长电话', id: 'addstationMasterPhoen', name: 'stationMasterPhoen', anchor: '50%' }, { id: 'addfm_queryJson', name: 'queryJson', hidden: true }], buttons: [{ text: '提交', id: 'addconfirmBtn', 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('addid').getValue(); // queryJson.company = Ext.getCmp('addcompany').getValue(); queryJson.addr = Ext.getCmp('addaddr').getValue(); queryJson.status = Ext.getCmp('addstationStatus').getChecked()[0].boxLabel == '启用' ? 1 : 0; queryJson.type = Ext.getCmp('addstationType').getChecked()[0].boxLabel == '重点' ? 1 : 0; queryJson.firehose = Ext.getCmp('addfirehose').getValue(); //=============================================================== queryJson.phone = Ext.getCmp('addphone').getValue(); queryJson.fireSataionName = Ext.getCmp('addfireSataionName').getValue(); queryJson.companyCode = Ext.getCmp('addfm_companyCode').getValue(); // queryJson.type = Ext.getCmp('type').getValue(); queryJson.area = Ext.getCmp('addarea').getValue(); queryJson.baifirehosenozzle = Ext.getCmp('addbaifirehosenozzle').getValue(); queryJson.abc = Ext.getCmp('addabc').getValue(); queryJson.turnouts = Ext.getCmp('addturnouts').getValue(); queryJson.firefightersboots = Ext.getCmp('addfirefightersboots').getValue(); queryJson.entrytool = Ext.getCmp('addentrytool').getValue(); queryJson.firecar = Ext.getCmp('addfirecar').getValue(); queryJson.firehat = Ext.getCmp('addfirehat').getValue(); queryJson.zd = Ext.getCmp('addzd').getValue(); queryJson.dd = Ext.getCmp('adddd').getValue(); queryJson.zz = Ext.getCmp('addzz').getValue(); queryJson.stationMaster = Ext.getCmp('addstationMaster').getValue(); queryJson.stationMasterPhoen = Ext.getCmp('addstationMasterPhoen').getValue(); // queryJson.insertTime = Ext.getCmp('addinsertTime').getValue(); //========================================================== var jsonstr = Ext.JSON.encode(queryJson); Ext.getCmp('addfm_queryJson').setValue(jsonstr); form.submit({ method: 'post', success: function (form, action) { Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) { clear_add_form(); myStore.reload(); // getCurrentData(); }); }, failure: function (form, action) { Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) { clear_add_form(); myStore.reload(); // }); } }); this.up('window').close(); } } }, { text: '关闭', iconCls: 'cancel_btn', handler: function () { clear_add_form(); this.up('window').close(); } }] }); var addfireInfoForm = Ext.create('Ext.form.Panel', { id: 'addfireInfoForm', labelWidth: 55, layout: "column", url: baseUrl + 'FireStationController/addFireStation', defaultType: 'textfield', bodyPadding: 15, items: [{ fieldLabel: '消防站名称', id: 'addfireSataionName', name: 'fireSataionName', allowBlank: false, blankText: "不能为空", anchor: '100%' }, { xtype: 'combo', fieldLabel: '单位名称', id: 'addfm_companyCode', name: 'company', displayField: 'owner_name', valueField: 'owner_id', allowBlank: false, blankText: "不能为空", editable: false, width: 330, store: CompanyStory }, { fieldLabel: '详细地址', allowBlank: false, blankText: "不能为空", id: 'addaddr', name: 'addr', hidden: true }, { fieldLabel: '记录编号', id: 'addid', name: 'id', hidden: true }, { fieldLabel: '值班电话', allowBlank: false, blankText: "不能为空", id: 'addphone', name: 'phone', xtype: 'textareafield', maxLength: 13, anchor: '100%' }, { fieldLabel: '详情地址', allowBlank: false, blankText: "不能为空", id: 'addaddr', name: 'area', maxLength: 120, anchor: '65%' }, addradiogroup, addradiogroup2, { fieldLabel: '所属区域', id: 'addarea', name: 'area', maxLength: 120, anchor: '65%' }, { fieldLabel: '水枪数量/只', id: 'addbaifirehosenozzle', allowBlank: false, blankText: "不能为空", name: 'baifirehosenozzle', maxLength: 50, anchor: '15%' }, { fieldLabel: '水带/条', id: 'addfirehose', allowBlank: false, blankText: "不能为空", name: 'firehose', maxLength: 50, anchor: '15%' }, { fieldLabel: '灭火器/个', allowBlank: false, blankText: "不能为空", id: 'addabc', name: 'abc', maxLength: 50, anchor: '15%' }, { fieldLabel: '防护服/件', allowBlank: false, blankText: "不能为空", id: 'addturnouts', name: 'turnouts', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防头盔/个', allowBlank: false, blankText: "不能为空", id: 'addfirehat', name: 'firehat', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防靴/双', id: 'addfirefightersboots', allowBlank: false, blankText: "不能为空", name: 'firefightersboots', maxLength: 50, anchor: '15%' }, { fieldLabel: '消防车/辆', id: 'addfirecar', name: 'firecar', maxLength: 50, anchor: '15%' }, { fieldLabel: '破拆工具/套', id: 'addentrytool', allowBlank: false, blankText: "不能为空", name: 'entrytool', maxLength: 50, anchor: '15%' }, { fieldLabel: '辖区支队', id: 'addzd', name: 'zd', maxLength: 50, anchor: '50%' }, { fieldLabel: '辖区大队', id: 'adddd', name: 'dd', maxLength: 50, anchor: '50%' }, { fieldLabel: '辖区中队', id: 'addzz', name: 'zz', maxLength: 50, anchor: '50%' }, { fieldLabel: '站长', id: 'addstationMaster', name: 'stationMaster', maxLength: 50, anchor: '25%' }, { fieldLabel: '站长电话', id: 'addstationMasterPhoen', name: 'stationMasterPhoen', anchor: '50%' }, { id: 'addfm_queryJson', name: 'queryJson', hidden: true }], buttons: [{ text: '提交', id: 'addconfirmBtn', 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('addid').getValue(); // queryJson.company = Ext.getCmp('addcompany').getValue(); queryJson.addr = Ext.getCmp('addaddr').getValue(); queryJson.status = Ext.getCmp('addstationStatus').getChecked()[0].boxLabel == '启用' ? 1 : 0; queryJson.type = Ext.getCmp('addstationType').getChecked()[0].boxLabel == '重点' ? 1 : 0; queryJson.firehose = Ext.getCmp('addfirehose').getValue(); //=============================================================== queryJson.phone = Ext.getCmp('addphone').getValue(); queryJson.fireSataionName = Ext.getCmp('addfireSataionName').getValue(); queryJson.companyCode = Ext.getCmp('addfm_companyCode').getValue(); // queryJson.type = Ext.getCmp('type').getValue(); queryJson.area = Ext.getCmp('addarea').getValue(); queryJson.baifirehosenozzle = Ext.getCmp('addbaifirehosenozzle').getValue(); queryJson.abc = Ext.getCmp('addabc').getValue(); queryJson.turnouts = Ext.getCmp('addturnouts').getValue(); queryJson.firefightersboots = Ext.getCmp('addfirefightersboots').getValue(); queryJson.entrytool = Ext.getCmp('addentrytool').getValue(); queryJson.firecar = Ext.getCmp('addfirecar').getValue(); queryJson.firehat = Ext.getCmp('addfirehat').getValue(); queryJson.zd = Ext.getCmp('addzd').getValue(); queryJson.dd = Ext.getCmp('adddd').getValue(); queryJson.zz = Ext.getCmp('addzz').getValue(); queryJson.stationMaster = Ext.getCmp('addstationMaster').getValue(); queryJson.stationMasterPhoen = Ext.getCmp('addstationMasterPhoen').getValue(); // queryJson.insertTime = Ext.getCmp('addinsertTime').getValue(); //========================================================== var jsonstr = Ext.JSON.encode(queryJson); Ext.getCmp('addfm_queryJson').setValue(jsonstr); form.submit({ method: 'post', success: function (form, action) { Ext.Msg.alert('操作成功', '已确认1条记录', function (btn, txt) { clear_add_form(); myStore.reload(); // getCurrentData(); }); }, failure: function (form, action) { Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) { clear_add_form(); myStore.reload(); // }); } }); this.up('window').close(); } } }, { text: '关闭', iconCls: 'cancel_btn', handler: function () { this.up('window').close(); } }] }); //=============================================== var showFireInfoWin = function (record) { $("#VInfoWin_Title").html(record.get('data')); Ext.getCmp('fireSataionName').setValue(record.get('fireSataionName')); Ext.getCmp('id').setValue(record.get('id')); Ext.getCmp('company').setValue(record.get('company')); Ext.getCmp('fm_companyCode').setValue(record.get('companyCode')); // var wia = Ext.getCmp('companyCode').getValue(); // alert(wia); Ext.getCmp('addr').setValue(record.get('addr')); Ext.getCmp('phone').setValue(record.get('phone')); Ext.getCmp('area').setValue(record.get('area')); Ext.getCmp('baifirehosenozzle').setValue(record.get('baifirehosenozzle')); Ext.getCmp('firehose').setValue(record.get('firehose')); Ext.getCmp('abc').setValue(record.get('abc')); Ext.getCmp('turnouts').setValue(record.get('turnouts')); Ext.getCmp('firehat').setValue(record.get('firehat')); Ext.getCmp('firefightersboots').setValue(record.get('firefightersboots')); Ext.getCmp('entrytool').setValue(record.get('entrytool')); Ext.getCmp('firecar').setValue(record.get('firecar')); Ext.getCmp('zd').setValue(record.get('zd')); Ext.getCmp('dd').setValue(record.get('dd')); Ext.getCmp('zz').setValue(record.get('zz')); Ext.getCmp('stationMaster').setValue(record.get('stationMaster')); Ext.getCmp('stationMasterPhoen').setValue(record.get('stationMasterPhoen')); Ext.getCmp('insertTime').setValue(record.get('insertTime')); vFileInfoWin.show(); // Ext.getCmp('uf_status').setValue(record.get('status')=='1'?'启用':'未启用'); // Ext.getCmp('uf_status').setValue(record.get('status')); if (record.get('type') == 1) { // checked:true Ext.getCmp('stationType').items.get(0).setValue(true); } else { Ext.getCmp('stationType').items.get(1).setValue(true); } if (record.get('status') == 1) { // checked:true Ext.getCmp('stationStatus').items.get(0).setValue(true); } else { Ext.getCmp('stationStatus').items.get(1).setValue(true); } } var detailWin = function () { Ext.create('Ext.window.Window', { title: '微型消防站器材详情', height: 405, width: 945, layout: 'fit', items: fireStationInfoForm, closable: false, modal: true, closeAction: 'hide' }).show(); //CompanyStory.reload(); } Ext.grid.PageRowNumberer = Ext.extend(Ext.grid.RowNumberer, { width: 50, text: '序号', renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { if (store.lastOptions.params != null) { var pageindex = store.lastOptions.params.start; return pageindex + rowIndex + 1; } else { return rowIndex + 1; } } }); //数据列表 var FireOptionPanel = Ext.create('Ext.grid.Panel', { // title: '数据测试', header: { height: 0, border: '0px solid #000000' }, titleCollapse: true, id: 'FireStationOptionListPanel', region: 'center', store: myStore, enableColumnResize:true, //selModel: sm, columns: [ new Ext.grid.PageRowNumberer(), // {header: '序号', dataIndex: 'id', width: '5%', menuDisabled: true, align: 'center', hidden: false,}, {header: 'id', dataIndex: 'id', hidden: true, menuDisabled: true}, {header: '微型消防站名称', dataIndex: 'fireSataionName', width: '24%', menuDisabled: true, align: 'center'}, {header: '所属单位', dataIndex: 'company', width: '24%', menuDisabled: true, align: 'center'}, {header: '地址', dataIndex: 'addr', width: '23%', menuDisabled: true, align: 'center'}, {header: '站长', dataIndex: 'stationMaster', width: '14%', menuDisabled: true, align: 'center'}, {header: '站长电话', dataIndex: 'stationMasterPhoen', width: '15%', menuDisabled: true, align: 'center'}, /*{ text: '操作',align: 'center', renderer: function(val,meta,rec) { // 为元素生成唯一id // alert(rec); var ids =rec.data.id; var id = Ext.id(); // console.log(ids); Ext.defer(function() { // var ids1 =ids; Ext.widget('button', { renderTo: id, text: '查看详情', scale: 'small', handler: function() { console.log(rec); detailWin(); } }); }, 50); return Ext.String.format('
', id); } }*/ ], columnLines: true, height: maxHeight, width: '100%', tbar: new Ext.create('Ext.toolbar.Toolbar', { items: [{ html: '电气火警报告列表' }, '->', { xtype: 'button', iconCls: 'back_btn', text: '返回', listeners: { click: function () { location.href = baseUrl + 'view/frontpage/map.jsp?&theme=' + theme + '&company_code=' + company_code; } } }, '-', { xtype: 'button', iconCls: 'filter_btn', text: '筛选', listeners: { click: filterwin } }, '-', { xtype: 'button', iconCls: 'append_btn', text: '新增', listeners: { click: addwin } }] }), bbar: new Ext.PagingToolbar({ store: myStore, id: 'FireStationListPageToolbar', 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); } } }); new Ext.create('Ext.panel.Panel', { width: '100%', id: 'FireAlarmPanel', layout: 'border', items: FireOptionPanel, renderTo: Ext.getBody() }); myStore.reload(); // getCurrentData(); $(window).resize(function () { body_resize(); }); body_resize(); });