(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7ad8"],{"81Zw":function(e,t,a){},9004:function(e,t,a){"use strict";a.r(t);var n=a("FyfS"),i=a.n(n),r=a("UXik"),s=a("qpgI");function c(e){var t=new Date(e);return t.setHours(0,0,0,0),new Date(t)}Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var a in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+a+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[a]:("00"+t[a]).substr((""+t[a]).length)));return e};a("qr4n");var o={name:"AlarmStaticsByDept",data:function(){return{chartSettings:{labelMap:{deptName:"权属单位",alarmDevices:"报警设备数",alarmTimes:"报警次数"}},extend:{series:{label:{show:!0,position:"top"},itemStyle:{normal:{barBorderRadius:[3,3,0,0]}},barMaxWidth:35}},listQuery:{deviceType:"",beginTime:"",endTime:""},timeRange:[],deviceTypeList:[],showDeviceType:!0,chartData:{columns:["deptName","alarmDevices","alarmTimes"],rows:[]},dataEmpty:!1,loading:!0}},mounted:function(){this.fetchDeviceType(),this.fetchData()},methods:{fetchData:function(){var e=this;console.log("fetchData"),this.listQuery.beginTime=this.timeRange[0],this.listQuery.endTime=this.timeRange[1],this.listLoading=!0,Object(r.a)(this.listQuery).then(function(t){e.chartData.rows=t.data;var a=Math.max.apply(Math,t.data.map(function(e){return e.alarmTimes}));e.extend.yAxis=a<10?{max:10}:{},e.listLoading=!1})},fetchDeviceType:function(){var e=this;this.loading=!0,Object(s.h)().then(function(t){e.deviceTypeList=[];var a=e.$store.getters.deviceTypes,n=!0,r=!1,s=void 0;try{for(var c,o=i()(t.data);!(n=(c=o.next()).done);n=!0){var l=c.value;-1!==a.indexOf(l.value)&&e.deviceTypeList.push(l)}}catch(e){r=!0,s=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw s}}e.deviceTypeList.length<=1&&(e.showDeviceType=!1),e.loading=!1})},changeDate:function(e){var t=void 0,a=void 0;"today"===e?(t=c((new Date).getTime()),a=new Date,this.timeRange=[t,a]):"yesterday"===e?(t=c((new Date).getTime()-864e5),a=c((new Date).getTime())):"sevendays"===e?(t=c((new Date).getTime()-6048e5),a=new Date):"lastmonth"===e&&(t=c((new Date).getTime()-2592e6),a=new Date),this.timeRange=[t.Format("yyyy-MM-dd hh:mm:ss"),a.Format("yyyy-MM-dd hh:mm:ss")],this.fetchData()}}},l=(a("fOH8"),a("KHd+")),u=Object(l.a)(o,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"chart-container"},[a("el-row",{staticClass:"chart-tools"},[a("el-col",{attrs:{span:21}},[a("span",{staticClass:"chart-tool-button",on:{click:function(t){e.changeDate("today")}}},[e._v("今日")]),e._v(" "),a("span",{staticClass:"chart-tool-button",on:{click:function(t){e.changeDate("yesterday")}}},[e._v("昨日")]),e._v(" "),a("span",{staticClass:"chart-tool-button",on:{click:function(t){e.changeDate("sevendays")}}},[e._v("最近7日")]),e._v(" "),a("span",{staticClass:"chart-tool-button",on:{click:function(t){e.changeDate("lastmonth")}}},[e._v("最近30日")]),e._v(" "),a("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd HH:mm:ss",size:"mini"},on:{change:e.fetchData},model:{value:e.timeRange,callback:function(t){e.timeRange=t},expression:"timeRange"}})],1),e._v(" "),a("el-col",{attrs:{span:3}},[a("el-select",{directives:[{name:"show",rawName:"v-show",value:e.showDeviceType,expression:"showDeviceType"}],attrs:{size:"mini",placeholder:"设备类型",clearable:""},on:{change:e.fetchData},model:{value:e.listQuery.deviceType,callback:function(t){e.$set(e.listQuery,"deviceType",t)},expression:"listQuery.deviceType"}},e._l(e.deviceTypeList,function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})}))],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12,offset:6}},[a("div",{staticClass:"chart-title"},[e._v("按权属单位统计报警情况")])])],1),e._v(" "),a("div",{staticClass:"chart-body"},[a("ve-histogram",{attrs:{loading:e.loading,data:e.chartData,settings:e.chartSettings,extend:e.extend,"data-empty":e.dataEmpty}})],1)],1)])},[],!1,null,"02dd7b6a",null);u.options.__file="alarmStaticsByDept.vue";var d={name:"AlarmStatics",components:{AlarmStaticsByDept:u.exports},data:function(){return{activeName:"byDept"}},methods:{handleClick:function(e,t){"wellcover"===e.name?this.$refs.bydept.fetchData():"liquid"===e.name&&this.$refs.byarea.fetchData()}}},m=(a("pY6x"),Object(l.a)(d,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container"},[a("el-tabs",{attrs:{type:"card"},on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[e.hasPerm("/statics/alarmsByDept")?a("el-tab-pane",{attrs:{label:"按权属单位",name:"byDept"}},[a("alarm-statics-by-dept",{ref:"bydept"})],1):e._e(),e._v(" "),e.hasPerm("/statics/alarmsByArea")?a("el-tab-pane",{attrs:{label:"按区域",name:"byArea"}},[e._v("\n 按区域统计报警\n ")]):e._e()],1)],1)},[],!1,null,"768948c0",null));m.options.__file="alarmStatics.vue";t.default=m.exports},UXik:function(e,t,a){"use strict";a.d(t,"c",function(){return i}),a.d(t,"b",function(){return r}),a.d(t,"a",function(){return s});var n=a("t3Un");function i(e){return Object(n.a)({url:"statics/deviceStaticsByType",method:"get",params:e})}function r(e){return Object(n.a)({url:"statics/deviceStaticsByDept",method:"get",params:e})}function s(e){return Object(n.a)({url:"statics/alarmsByDept",method:"get",params:e})}},X50M:function(e,t,a){},fOH8:function(e,t,a){"use strict";var n=a("X50M");a.n(n).a},pY6x:function(e,t,a){"use strict";var n=a("81Zw");a.n(n).a},qpgI:function(e,t,a){"use strict";a.d(t,"e",function(){return s}),a.d(t,"h",function(){return c}),a.d(t,"g",function(){return o}),a.d(t,"a",function(){return l}),a.d(t,"j",function(){return u}),a.d(t,"d",function(){return d}),a.d(t,"c",function(){return m}),a.d(t,"b",function(){return p}),a.d(t,"i",function(){return h}),a.d(t,"f",function(){return v});var n=a("t3Un"),i=a("Qyje"),r=a.n(i);function s(e){return Object(n.a)({url:"device/list",method:"get",params:e})}function c(e){return Object(n.a)({url:"device/type",method:"get",params:e})}function o(e){return Object(n.a)({url:"device/model",method:"get",params:{deviceType:e}})}function l(e){return Object(n.a)({url:"device/add",method:"post",params:e})}function u(e){return Object(n.a)({url:"device/update",method:"post",params:e})}function d(e){return Object(n.a)({url:"device/delete",method:"post",params:{ids:e},paramsSerializer:function(e){return r.a.stringify(e,{indices:!1})}})}function m(e){var t=new FormData;return t.append("file",e),Object(n.a)({url:"device/batchImport",method:"post",timeout:24e4,headers:{"Content-Type":"multipart/form-data"},data:t})}function p(e){return Object(n.a)({url:"device/batchExport",method:"get",timeout:12e4,params:e,responseType:"blob"})}function h(e){return Object(n.a)({url:"busDeviceInfo/listNoBind",method:"get",params:{carId:e}})}function v(e){return Object(n.a)({url:"device/getDeviceListByType",method:"get",params:{deviceType:e}})}},qr4n:function(e,t,a){}}]);