张卓
2022-09-29 4ef1c909df36c48f7f040e9ec408fc15e6745e71
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d8936f2c"],{"06a9":function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.handleClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[a("el-tab-pane",{attrs:{name:"first"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("i",{staticClass:"el-icon-pie-chart"}),a("b",[t._v(" 城市优良天统计")])]),t._v(" "),a("div",{staticClass:"topSelect"},[a("div",{staticStyle:{display:"flex"}},[a("el-radio-group",{staticStyle:{"margin-left":"20px"},model:{value:t.dateRadio,callback:function(e){t.dateRadio=e},expression:"dateRadio"}},[a("el-radio-button",{attrs:{label:"年报"}}),t._v(" "),a("el-radio-button",{attrs:{label:"自定义"}})],1),t._v(" "),"MouthPicker1"===t.dataType?a("MouthPicker1",{staticStyle:{"padding-left":"0","margin-left":"10px",width:"160px"},attrs:{value1:t.currentYearD},on:{sendPickerChild:t.showPickerChild}}):a("CustomPicker1",{staticStyle:{"padding-left":"0","margin-left":"10px",width:"400px"},attrs:{value1:t.currentTimeD},on:{sendPickerChild:t.showPickerChild}}),t._v(" "),a("RegionCity",{staticStyle:{"margin-left":"10px"},on:{regionCode:t.regionData}})],1),t._v(" "),a("div",[a("el-button",{attrs:{type:"primary"},on:{click:t.getAllData}},[t._v("查询")])],1)]),t._v(" "),a("div",{staticStyle:{"max-height":"800px","overflow-y":"auto"}},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:12,sm:12,md:12,lg:12,xl:12}},[a("div",{staticClass:"grid-content bg-purple-light"}),t._v(" "),a("PieChartNew",{attrs:{datas:t.pieData,height:"500px"}})],1),t._v(" "),a("el-col",{attrs:{xs:12,sm:12,md:12,lg:12,xl:12}},[a("div",{staticClass:"grid-content bg-purple"}),t._v(" "),a("BarChart",{attrs:{datas:t.barData.data,datas1:t.barData.time,height:"500px"}})],1)],1),t._v(" "),a("el-row",{staticStyle:{"margin-top":"20px","border-top":"1px solid #ccc"},attrs:{gutter:10}},[a("el-col",{attrs:{xs:12,sm:12,md:12,lg:12,xl:12}},[a("div",{staticClass:"grid-content bg-purple-light"}),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.pieTableData,border:""}},[a("el-table-column",{attrs:{prop:"time",label:"时间",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"excellent",label:"优",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"good",label:"良",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"mild",label:"轻度污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"middle",label:"中度污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"serious",label:"重度污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"server",label:"严重污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"total",label:"合计",align:"center"}})],1)],1),t._v(" "),a("el-col",{staticStyle:{"padding-bottom":"50px"},attrs:{xs:12,sm:12,md:12,lg:12,xl:12}},[a("div",{staticClass:"grid-content bg-purple"}),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.barTableData,border:""}},[a("el-table-column",{attrs:{prop:"time",label:"时间",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"excellent",label:"优",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"good",label:"良",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"mild",label:"轻度污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"middle",label:"中度污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"serious",label:"重度污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"server",label:"严重污染",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"total",label:"合计",align:"center"}})],1)],1)],1)],1)]),t._v(" "),a("el-tab-pane",{attrs:{name:"second"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("i",{staticClass:"el-icon-tickets"}),a("b",[t._v(" 城市优良天数对比")])]),t._v(" "),a("ContrastCity",{ref:"contrastCity"})],1),t._v(" "),a("el-tab-pane",{attrs:{name:"third"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("i",{staticClass:"el-icon-crop"}),t._v(" "),a("b",[t._v("优良天变化率分析")])]),t._v(" "),a("ChangeAnalysis",{ref:"changeAnalysis"})],1),t._v(" "),a("el-tab-pane",{attrs:{name:"fourth"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("i",{staticClass:"el-icon-news"}),a("b",[t._v(" 达标天数统计分析")])]),t._v(" "),a("QualifiedDaysAnalysis",{ref:"qualifiedDaysAnalysis"})],1)],1)],1)},n=[],i=(a("6b54"),a("ac6a"),a("d6c1")),o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width},attrs:{id:"myBarChart"}})},l=[],s=(a("28a5"),a("7f7f"),a("313e")),c=a.n(s),u={props:{datas:{type:Array,default:function(){return[]}},datas1:{type:Array,default:function(){return[]}},className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"300px"}},data:function(){return{chart:null}},watch:{datas:function(t){this.initChart()},datas1:function(t){this.initChart()}},mounted:function(){var t=this;this.$nextTick((function(){t.initChart()}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=document.getElementById("myBarChart"),e=c.a.init(t);this.chart=e,this.chart.setOption({title:{text:"城市优良天统计饼图",show:!1},tooltip:{trigger:"item",backgroundColor:"rgba(255,255,255,.8)",color:"gray",borderWidth:"1",borderColor:"#d9d9d9",formatter:function(t){var e=t.name;return e+"<br/>"+t.seriesName+": "+t.value+"天<br/>占比:"+t.data.data0},textStyle:{color:"#808080"}},legend:{x:"center",y:"bottom",padding:[10,0,0,0],formatter:function(t){return t.split(":")[0]}},toolbox:{feature:{saveAsImage:{}}},color:["#00e400","#ffff00","#ff7e00","#ff0000","#99004c","#7e0023"],grid:{top:10,left:"2%",right:"2%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:this.datas1,axisTick:{alignWithLabel:!0}}],yAxis:[{type:"value",axisTick:{show:!1}}],series:this.datas},!0)}}},d=u,h=a("2877"),p=Object(h["a"])(d,o,l,!1,null,null,null),g=p.exports,f=a("3dd4"),b=a("0c01"),m=a("33f4"),y=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"ccc"},[a("div",{staticClass:"topContrast"},[a("div",{staticStyle:{display:"flex",height:"60px",padding:"20px 15px 0px 15px"}},[a("el-radio-group",{staticStyle:{"margin-left":"20px"},model:{value:t.contrastDateRadio,callback:function(e){t.contrastDateRadio=e},expression:"contrastDateRadio"}},[a("el-radio-button",{attrs:{label:"月"}}),t._v(" "),a("el-radio-button",{attrs:{label:"年"}})],1),t._v(" "),a(t.dataType,{tag:"component",staticStyle:{"padding-left":"0","margin-left":"10px",width:"180px","margin-right":"10px",height:"0px"},attrs:{value1:t.currentDate},on:{sendPickerChild:t.showPickerChild}}),t._v(" "),a("el-radio-group",{model:{value:t.contrastCityRadio,callback:function(e){t.contrastCityRadio=e},expression:"contrastCityRadio"}},[a("el-radio-button",{attrs:{label:"省内城市"}}),t._v(" "),a("el-radio-button",{attrs:{label:"市区城市"}}),t._v(" "),a("el-radio-button",{attrs:{label:"2+26城市"}})],1),t._v(" "),"city"===t.contrastCurrentCity?a("RegionCity",{staticStyle:{"margin-left":"10px"},on:{regionCode:t.regionDataCity}}):"province"===t.contrastCurrentCity?a("RegionProvince",{staticStyle:{"margin-left":"10px"},on:{regionCode:t.regionDataProvince}}):t._e(),t._v(" "),a("el-button",{staticStyle:{"margin-left":"200px"},attrs:{type:"primary"},on:{click:t.getData}},[t._v("查询")])],1)]),t._v(" "),a("div",[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:8,sm:6,md:4,lg:2,xl:1}},[a("div",{staticClass:"grid-content bg-purple",staticStyle:{"margin-top":"30px"}})]),t._v(" "),a("el-col",{attrs:{xs:5,sm:4,md:4,lg:8,xl:8}},[a("div",{staticClass:"leftChart",style:{height:"400px"},attrs:{id:"leftChart"}})]),t._v(" "),a("el-col",{attrs:{xs:3,sm:6,md:10,lg:12,xl:13}},[a("div",{staticClass:"rightChart",attrs:{id:"rightChart"}})]),t._v(" "),a("el-col",{attrs:{xs:8,sm:6,md:4,lg:2,xl:2}},[a("div",{staticClass:"grid-content bg-purple-light"})])],1)],1)])},v=[],D=(a("55dd"),a("e012")),C=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-cascader",{staticStyle:{flex:"1"},attrs:{placeholder:"选择省",options:t.options,clearable:""},model:{value:t.newRegion,callback:function(e){t.newRegion=e},expression:"newRegion"}})],1)},x=[],w=(a("c5f6"),{data:function(){return{form:{name:"",region:"",date1:"",date2:"",delivery:!1,type:[],resource:"",desc:""},options:[],newRegion:""}},watch:{newRegion:function(t,e){this.$emit("regionCode",t[this.newRegion.length-1])}},created:function(){var t=this,e=new Promise((function(e,a){t.$request({url:"/organization/getMapPath",method:"get",params:{organizationId:t.$store.state.orgId}}).then((function(a){for(var r=a.data,n=0;n<r.length;n++)t.options.push({value:r[n].provinceCode,label:r[n].provinceName});e()})).catch((function(t){console.log("请求Region失败"),console.log(t)}))}));e.then((function(){t.newRegion=Number(t.$store.state.regionCode.toString().substr(0,2)+"0000")}))}}),k=w,_=(a("dd66"),Object(h["a"])(k,C,x,!1,null,"50d52d0c",null)),P=_.exports,S={components:{DatePicker1:D["a"],MouthPicker1:f["a"],RegionProvince:P,RegionCity:m["a"]},props:{},data:function(){return{contrastDateRadio:"月",contrastCityRadio:"省内城市",contrastCurrentCity:"province",dataType:"DatePicker1",currentDate:"",regionCode:this.$store.state.regionCode,contrastData:[],regionDefaultCity:this.$store.state.regionCode.toString().substr(0,2)+"0000",regionDefaultProvince:this.$store.state.regionCode.toString().substr(0,2)+"0000"}},computed:{},watch:{contrastDateRadio:function(t,e){"月"===t?(this.dataType="DatePicker1",this.currentMonth()):(this.dataType="MouthPicker1",this.currentYear())},contrastCityRadio:function(t,e){this.contrastCurrentCity="省内城市"===t?"province":"市区城市"===t?"city":"28"}},created:function(){this.currentMonth()},monted:function(){},methods:{showPickerChild:function(t){this.currentDate=t},currentTime:function(){var t=new Date,e=t.getMonth()<9?"0"+(t.getMonth()+1):t.getMonth()+1;t.getDate(),t.getDate();this.currentDate=t.getFullYear()+"-"+e},currentMonth:function(){var t=new Date,e=t.getMonth()+1,a=t.getFullYear()+"-"+e;this.currentDate=a.toString()},currentYear:function(){var t=new Date,e=t.getFullYear();this.currentDate=e.toString()},getData:function(){var t=this,e={};"月"===this.contrastDateRadio?e.month=this.currentDate:e.year=this.currentDate,"city"===this.contrastCurrentCity?(e.regionCode=this.regionDefaultCity,this.$request({url:"aqi/queryAreaPollutionLevel",method:"get",params:e}).then((function(e){t.contrastData=e.data,t.initCharts()})).catch((function(t){console.log(t)}))):"province"===this.contrastCurrentCity?(e.regionCode=this.regionDefaultProvince,this.$request({url:"aqi/queryProvinceCitiesPollutionLevel",method:"get",params:e}).then((function(e){t.contrastData=e.data,t.initCharts()})).catch((function(t){console.log(t)}))):this.$request({url:"aqi/qeury28CitiesPollutionLevel",method:"get",params:e}).then((function(e){t.contrastData=e.data,t.initCharts()})).catch((function(t){console.log(t)}))},initCharts:function(){var t="",e="";if("月"===this.contrastDateRadio){var a=this.currentDate.split("-");e=a[0]+"年"+a[1]+"月"}else e=this.currentDate+"年";t=e+"城市优良天数排序";for(var r=e+"城市优良天数对比",n=[],i=0;i<this.contrastData.length;i++)null!=this.contrastData[i]&&n.push({name:this.contrastData[i].regionName,value:this.contrastData[i].excellentWeatherDays+this.contrastData[i].goodWeatherDays,excellentDay:this.contrastData[i].excellentWeatherDays,goodDay:this.contrastData[i].goodWeatherDays,mildDay:this.contrastData[i].mildWeatherDays,middleDay:this.contrastData[i].middleWeatherDays,seriousDay:this.contrastData[i].seriousWeatherDays,serverDay:this.contrastData[i].serverWeatherDays});n.sort((function(t,e){return t.value-e.value}));var o,l,c=n.map((function(t){return t.name})),u=n.map((function(t){return t.value})),d=n.map((function(t){return t.excellentDay})),h=n.map((function(t){return t.goodDay})),p=n.map((function(t){return t.mildDay})),g=n.map((function(t){return t.middleDay})),f=n.map((function(t){return t.seriousDay})),b=n.map((function(t){return t.serverDay})),m=document.getElementById("leftChart"),y=s["init"](m);window.screen.availHeight>=1040?(o=650,l=this.contrastData.length>20?13:this.contrastData.length>10?20:30):(o=470,l=this.contrastData.length>20?8:this.contrastData.length>10?12:20),y.resize({height:o});var v={color:["#649AD6"],title:{text:t,x:"center",padding:[30,0,0,0]},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{x:"center",y:"bottom",padding:[20,0,0,0]},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitLine:{show:!1}},yAxis:{splitLine:{show:!1},type:"category",data:c},series:[{name:"优良",type:"bar",label:{show:!0},barWidth:l,barCategoryGap:"2",data:u}]};y.setOption(v);var D=document.getElementById("rightChart"),C=s["init"](D),x={color:["#65dd77","#fcdf56","#fd7c43","#fc5656","#fc5689","#cd3a3a"],title:{text:r,x:"center",padding:[30,0,0,0]},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{x:"center",y:"bottom",padding:[20,0,0,0]},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitLine:{show:!1}},yAxis:{type:"category",data:c},series:[{name:"优",type:"bar",stack:"total",barWidth:l,barCategoryGap:"2",label:{show:!0},data:d},{name:"良",type:"bar",stack:"total",barWidth:l,barCategoryGap:"2",label:{show:!0},emphasis:{focus:"series"},data:h},{name:"轻度污染",type:"bar",stack:"total",barWidth:l,barCategoryGap:"2",label:{show:!0},emphasis:{focus:"series"},data:p},{name:"中度污染",type:"bar",stack:"total",barWidth:l,barCategoryGap:"2",label:{show:!0},emphasis:{focus:"series"},data:g},{name:"严重污染",type:"bar",stack:"total",barWidth:l,barCategoryGap:"2",label:{show:!0},emphasis:{focus:"series"},data:f},{name:"重度污染",type:"bar",barWidth:"8",barCategoryGap:"2",stack:"total",label:{show:!0},emphasis:{focus:"series"},data:b}]};C.resize({height:o}),C.setOption(x)},regionDataCity:function(t){t&&(this.regionDefaultCity=t)},regionDataProvince:function(t){t&&(this.regionDefaultProvince=t)}}},T=S,A=(a("63e1"),Object(h["a"])(T,y,v,!1,null,null,null)),R=A.exports,q=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"topChangeAnalysis"},[a("div",{staticStyle:{display:"flex",height:"60px",padding:"20px 15px 0px 15px"}},[a("MouthPicker",{staticStyle:{"padding-left":"0","margin-left":"10px",width:"160px"},attrs:{value1:t.currentDate},on:{sendPickerChild:t.showPickerChild}}),t._v(" "),a("RegionCityCX",{staticStyle:{"margin-left":"10px"},on:{regionCode:t.regionData}}),t._v(" "),a("el-button",{staticStyle:{"margin-left":"200px"},attrs:{type:"primary"},on:{click:t.getData}},[t._v("查询")]),t._v(" "),a("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary"},on:{click:t.exportData}},[t._v("导出")])],1),t._v(" "),a("div",{staticClass:"content",staticStyle:{margin:"30px 15px 20px 20px"}},[a("el-table",{attrs:{id:"mytable",data:t.tableData,border:"","cell-style":t.columnStyle,"header-cell-style":t.headerColumnStyle}},t._l(t.tableColumnHeader,(function(t,e){return a("el-table-column",{key:e,attrs:{label:t.headerColumn,prop:t.title}})})),1)],1)])},M=[],O=(a("34ef"),a("a481"),a("456d"),a("53ca")),N=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-cascader",{ref:"getCityName",staticStyle:{flex:"1"},attrs:{placeholder:"选择省/市",options:t.options,clearable:""},on:{change:t.getName},model:{value:t.newRegion,callback:function(e){t.newRegion=e},expression:"newRegion"}})],1)},$=[],E={data:function(){return{form:{name:"",region:"",date1:"",date2:"",delivery:!1,type:[],resource:"",desc:""},options:[],newRegion:[],cityName:""}},watch:{newRegion:function(t,e){this.$emit("regionCode",[t[this.newRegion.length-1],this.cityName])}},created:function(){var t=this,e=new Promise((function(e,a){t.$request({url:"/organization/getMapPath",method:"get",params:{organizationId:t.$store.state.orgId}}).then((function(a){for(var r=a.data,n=0;n<r.length;n++){t.options.push({value:r[n].provinceCode,label:r[n].provinceName}),t.options[n].children=[];for(var i=0;i<r[n].cities.length;i++)t.options[n].children.push({value:r[n].cities[i].cityCode,label:r[n].cities[i].cityName})}e()})).catch((function(t){console.log("请求Region失败"),console.log(t)}))}));e.then((function(){for(var e in t.newRegion=[Number(t.$store.state.regionCode.toString().substr(0,2)+"0000"),Number(t.$store.state.regionCode.toString().substr(0,4)+"00")],t.options)for(var a in t.options[e].children)t.newRegion[1]===t.options[e].children[a].value&&(t.cityName=t.options[e].children[a].label)}))},methods:{getName:function(){""!==this.cityName&&(this.cityName=void 0===this.$refs["getCityName"].getCheckedNodes()[0]?this.cityName:this.$refs["getCityName"].getCheckedNodes()[0].label)}}},B=E,I=(a("b7c3"),Object(h["a"])(B,N,$,!1,null,"1d419563",null)),Y=I.exports,L=a("1146"),W=a.n(L),j=a("1088"),F=a.n(j),z={components:{MouthPicker:f["a"],RegionCityCX:Y},data:function(){return{regionDefault:this.$store.state.regionCode,currentDate:"",tableData:[],tableColumnHeader:[],cityName:""}},created:function(){this.currentYear()},methods:{headerColumnStyle:function(t){t.row,t.column,t.rowIndex,t.columnIndex;return"background:#EAEAEA;text-align:center"},columnStyle:function(t){var e=t.row,a=(t.column,t.rowIndex,t.columnIndex),r="",n="";if(2===a&&null!==e.percent){if(r=e.percent.substr(0,1))switch(r){case"+":n="color:red;font-weight:bold;";break;case"-":n="color:green;font-weight:bold;";break}(r="天"===e.percent.substr(-1,1))&&(n="color:green;font-weight:bold;")}return n+"font-family:微软雅黑;text-align:center;"},getTableColumnHeader:function(){this.tableColumnHeader=[{headerColumn:"项目",title:"title"},{headerColumn:this.cityName,title:"concentration"},{headerColumn:"同比",title:"percent"},{headerColumn:"全省排名",title:"provinceRange"},{headerColumn:"2+26城市排名",title:"twentyEightCitiesRange"},{headerColumn:"省内通道城市排名",title:"provinceChannelRange"}]},showPickerChild:function(t){Object(O["a"])(t)===Array?this.currentTimeD=t:this.currentYearD=t,this.currentDate=t},getData:function(){var t=this;this.$request({url:"aqi/queryPollutionLevelAnalysis",methods:"get",params:{year:this.currentDate,cityCode:this.regionDefault}}).then((function(e){t.tableData=[];var a=Object.keys(e.data).map((function(t){var a=e.data[t];return a.title="fineDays"===t?"优良天数":"compositeIndex"===t?"综合指数":"PM2_5"===t?"PM2.5":t,a}));a.sort((function(t,e){var a=["优良天数","PM2.5","PM10","NO2","SO2","CO","O3","综合指数"];return a.indexOf(t["title"])-a.indexOf(e["title"])})),t.tableData=a}))},exportData:function(){for(var t=W.a.utils.table_to_sheet(document.querySelector("#mytable")),e=6,a=0;a<e;a++)t["!cols"][a]={wpx:130};var r=[];for(var n in t){var i={sz:13,bold:!1,color:{rgb:"000000"}};-1===n.indexOf("!")&&(-1!==n.indexOf("C")&&("C2"===n?"+"===t[n].v.toString().substr(0,1)?i={sz:13,bold:!1,color:{rgb:"65dd77"}}:"-"===t[n].v.toString().substr(0,1)&&(i={sz:13,bold:!1,color:{rgb:"CD3A3A"}}):"+"===t[n].v.toString().substr(0,1)?i={sz:13,bold:!1,color:{rgb:"CD3A3A"}}:"-"===t[n].v.toString().substr(0,1)&&(i={sz:13,bold:!1,color:{rgb:"65dd77"}})),t[n].s={font:i,border:{top:{style:"thin"},bottom:{style:"thin"},left:{style:"thin"},right:{style:"thin"}},alignment:{horizontal:"center",vertical:"center",wrap_text:!0}});var o=n.replace(/[^0-9]/gi,"");if("1"===o){for(var l={},s=0;s<this.tableColumnHeader.length;s++)if(this.tableColumnHeader[s].headerColumn===t[n].v){var c=n.replace(/[^a-z]+/gi,"");l.key=c,l.code=this.tableColumnHeader[s].headerColumn;break}l.key&&r.push(l)}}var u=this.currentDate+this.cityName+"优良天变化率分析数据导出.xlsx",d=this.sheet2blob(t);this.openDownloadDialog(d,u)},sheet2blob:function(t,e){e=e||"sheet1";var a={SheetNames:[e],Sheets:{}};a.Sheets[e]=t;var r={bookType:"xlsx",bookSST:!1,type:"binary"},n=F.a.write(a,r),i=new Blob([o(n)],{type:"application/octet-stream"});function o(t){for(var e=new ArrayBuffer(t.length),a=new Uint8Array(e),r=0;r!==t.length;++r)a[r]=255&t.charCodeAt(r);return e}return i},openDownloadDialog:function(t,e){"object"===Object(O["a"])(t)&&t instanceof Blob&&(t=URL.createObjectURL(t));var a,r=document.createElement("a");r.href=t,r.download=e||"",window.MouseEvent?a=new MouseEvent("click"):(a=document.createEvent("MouseEvents"),a.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)),r.dispatchEvent(a)},regionData:function(t){this.regionDefault=t[0],this.cityName=t[1],this.tableColumnHeader=[],this.getTableColumnHeader()},currentYear:function(){var t=new Date,e=t.getFullYear();this.currentDate=e.toString()}}},H=z,G=Object(h["a"])(H,q,M,!1,null,null,null),X=G.exports,Q=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"topChangeAnalysis"},[a("div",{staticStyle:{display:"flex",height:"60px",padding:"20px 15px 0px 15px"}},[a("MouthPicker",{staticStyle:{"padding-left":"0","margin-left":"10px",width:"160px"},attrs:{value1:t.currentDate},on:{sendPickerChild:t.showPickerChild}}),t._v(" "),a("RegionCityCX",{staticStyle:{"margin-left":"10px"},on:{regionCode:t.regionData}}),t._v(" "),a("el-button",{staticStyle:{"margin-left":"100px"},attrs:{type:"primary"},on:{click:t.getData}},[t._v("查询")])],1),t._v(" "),a("div",{staticClass:"content",staticStyle:{margin:"30px 15px 20px 20px"}},[a("el-table",{attrs:{id:"mytable",data:t.tableData,border:"","cell-style":t.columnStyle,"header-cell-style":t.headerColumnStyle}},[a("el-table-column",{attrs:{label:"月份",prop:"month"}}),t._v(" "),a("el-table-column",{attrs:{label:"AQI达标天数"}},[a("el-table-column",{attrs:{label:"天数",prop:"aqiComplianceDays"}}),t._v(" "),a("el-table-column",{attrs:{label:"同期",prop:"comAqiComplianceDays"}})],1),t._v(" "),a("el-table-column",{attrs:{label:"AQI达标率"}},[a("el-table-column",{attrs:{label:"达标率",prop:"aqiCompliancePer"}}),t._v(" "),a("el-table-column",{attrs:{label:"同期",prop:"comAqiCompliancePer"}})],1),t._v(" "),a("el-table-column",{attrs:{label:"污染物超标天数"}},[a("el-table-column",{attrs:{label:"PM2.5",prop:"PM2_5Days"}}),t._v(" "),a("el-table-column",{attrs:{label:"PM10",prop:"PM10Days"}}),t._v(" "),a("el-table-column",{attrs:{label:"SO2",prop:"SO2Days"}}),t._v(" "),a("el-table-column",{attrs:{label:"NO2",prop:"NO2Days"}}),t._v(" "),a("el-table-column",{attrs:{label:"CO",prop:"CODays"}}),t._v(" "),a("el-table-column",{attrs:{label:"03",prop:"O3Days"}})],1),t._v(" "),a("el-table-column",{attrs:{label:"首要污染物天数"}},[a("el-table-column",{attrs:{label:"PM2.5",prop:"PM2_5FirstDays"}}),t._v(" "),a("el-table-column",{attrs:{label:"PM10",prop:"PM10FirstDays"}}),t._v(" "),a("el-table-column",{attrs:{label:"SO2",prop:"SO2FirstDays"}}),t._v(" "),a("el-table-column",{attrs:{label:"NO2",prop:"NO2FirstDays"}}),t._v(" "),a("el-table-column",{attrs:{label:"CO",prop:"COFirstDays"}}),t._v(" "),a("el-table-column",{attrs:{label:"03",prop:"O3FirstDays"}})],1)],1)],1)])},U=[],J={components:{MouthPicker:f["a"],RegionCityCX:Y},data:function(){return{regionDefault:this.$store.state.regionCode,currentDate:"",tableData:[]}},created:function(){this.currentYear()},methods:{headerColumnStyle:function(t){t.row,t.column,t.rowIndex,t.columnIndex;return"background:#EAEAEA;text-align:center;border-color: #D3D3D3"},columnStyle:function(t){var e=t.row,a=t.column,r=(t.rowIndex,t.columnIndex),n="",i="";for(var o in e)if(o===a.property){var l=a.property;if("month"!==l&&"aqiComplianceDays"!==l&&"comAqiComplianceDays"!==l&&"aqiCompliancePer"!==l&&"comAqiCompliancePer"!==l){var s=e[o].replace("天","");null!==s&&(s>=0&&s<=4?i="background:#65dd77;color:#007400":s>4&&s<10?i="background:#fcdf56;color:#868600":s>=10&&s<=14?i="background:#fd7c43;color:#844100":s>15&&s<=19?i="background:#fc5656;color:#790000":s>19&&s<=24?i="background:#fc5689;color:#14000a":s>24&&s<=31&&(i="background:#cd3a3a;"))}}return 1===r&&null!==e.aqiComplianceDays&&(n=e.aqiComplianceDays.replace("天",""),i=this.getAqiDaysBackground(n)),2===r&&null!==e.comAqiComplianceDays&&(n=e.comAqiComplianceDays.replace("天",""),i=this.getAqiDaysBackground(n)),3===r&&null!==e.aqiCompliancePer&&(n=e.aqiCompliancePer.replace("%",""),i=this.getAqiRateBackground(n)),4===r&&null!==e.comAqiCompliancePer&&(n=e.comAqiCompliancePer.replace("%",""),i=this.getAqiRateBackground(n)),i+"font-family:微软雅黑;text-align:center;"},getAqiDaysBackground:function(t){var e="";return t>=0&&t<=4?e="background:#cd3a3a;":t>=5&&t<=9?e="background:#fc5689;color:#14000a":t>=10&&t<=14?e="background:#fc5656;color:#790000":t>=15&&t<=19?e="background:#fd7c43;color:#844100":t>=20&&t<=24?e="background:#fcdf56;color:#868600":t>=25&&t<=31&&(e="background:#65dd77;color:#007400"),e+"font-weight:bold;"},getAqiRateBackground:function(t){var e="";return t>=80&&t<=100?e="background:#65dd77;color:#007400":t>=60&&t<80?e="background:#fcdf56;color:#868600":t>=50&&t<60?e="background:#fd7c43;color:#844100":t>=20&&t<50?e="background:#fc5656;color:#790000":t>=10&&t<20?e="background:#fc5689;color:#14000a":t>=0&&t<10&&(e="background:#cd3a3a;"),e+"font-weight:bold;"},showPickerChild:function(t){Object(O["a"])(t)===Array?this.currentTimeD=t:this.currentYearD=t,this.currentDate=t},getData:function(){var t=this;this.$request({url:"aqi/queryComplianceDaysAnalysis",methods:"get",params:{year:this.currentDate,cityCode:this.regionDefault}}).then((function(e){t.tableData=[],t.tableData=e.data}))},regionData:function(t){this.regionDefault=t[0]},currentYear:function(){var t=new Date,e=t.getFullYear();this.currentDate=e.toString()}}},K=J,V=Object(h["a"])(K,Q,U,!1,null,null,null),Z=V.exports,tt={components:{PieChartNew:i["a"],BarChart:g,MouthPicker1:f["a"],CustomPicker1:b["a"],RegionCity:m["a"],ContrastCity:R,ChangeAnalysis:X,QualifiedDaysAnalysis:Z},props:{},data:function(){return{activeName:"first",dateRadio:"年报",dataType:"MouthPicker1",currentTimeD:[],currentYearD:"",pieData:[],barData:{data:[],time:[]},pieTableData:[],barTableData:[],regionDefault:this.$store.state.regionCode,currentDate:"",w160:!0,w400:!1}},computed:{},watch:{dateRadio:function(t,e){"年报"===t?(this.dataType="MouthPicker1",this.currentYear(),this.w160=!0,this.w400=!1):(this.dataType="CustomPicker1",this.currentTime(),this.w160=!this.w160,this.w400=!this.w400)}},created:function(){this.currentYear(),this.currentTime(),this.getAllData()},mounted:function(){},beforeCreate:function(){},beforeMount:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},activated:function(){},methods:{getAllData:function(){this.getPieData(),this.getBarData(),this.getBarTableData()},getPieData:function(){var t=this;this.pieData=[],this.pieTableData=[],this.$request({url:"/aqi/queryPieChartOfPollutionLevel",method:"get",params:{regionCode:this.regionDefault,startDate:"MouthPicker1"===this.dataType?null:this.currentTimeD[0],endDate:"MouthPicker1"===this.dataType?null:this.currentTimeD[1],year:"MouthPicker1"===this.dataType?this.currentYearD:""}}).then((function(e){var a=e.data.values;if(a){for(var r=0;r<a.length;r++)t.pieData.push({name:"",value:""}),t.pieData[r].name=t.pollutionLevel(a[r].pollution)+": "+a[r].proportion,t.pieData[r].value=a[r].days;for(var n=0,i=0,o=0;o<2;o++)t.pieTableData.push({time:"",excellent:"",good:"",mild:"",middle:"",serious:"",server:"",total:""});a.forEach((function(e){"0"===e.pollution?(t.pieTableData[0].excellent=e.days,t.pieTableData[1].excellent=e.proportion):"1"===e.pollution?(t.pieTableData[0].good=e.days,t.pieTableData[1].good=e.proportion):"2"===e.pollution?(t.pieTableData[0].mild=e.days,t.pieTableData[1].mild=e.proportion):"3"===e.pollution?(t.pieTableData[0].middle=e.days,t.pieTableData[1].middle=e.proportion):"4"===e.pollution?(t.pieTableData[0].serious=e.days,t.pieTableData[1].serious=e.proportion):(t.pieTableData[0].server=e.days,t.pieTableData[1].server=e.proportion),n+=e.days,i+=parseFloat(e.proportion)})),t.pieTableData[0].total=n,t.pieTableData[1].total=i.toFixed()+"%",t.pieTableData[0].time=parseInt(e.data.time)+"年天数",t.pieTableData[1].time=parseInt(e.data.time)+"年占比"}else t.$message.warning("当前时间没有数据")}))},getBarData:function(){var t=this;this.barData={data:[],time:[]},this.$request({url:"/aqi/queryBarChartOfPollutionLevel",method:"get",params:{regionCode:this.regionDefault,startDate:"MouthPicker1"===this.dataType?null:this.currentTimeD[0],endDate:"MouthPicker1"===this.dataType?null:this.currentTimeD[1],year:"MouthPicker1"===this.dataType?this.currentYearD:""}}).then((function(e){var a=e.data.values;if(a){t.barData.time=e.data.time;for(var r=0;r<a.length;r++){t.barData.data.push({name:"",data:[],type:"bar",stack:"vistors",barWidth:"60%"});for(var n=0;n<a[r].days.length;n++)t.barData.data[r].data.push({value:0,data0:0}),t.barData.data[r].name=t.pollutionLevel(a[r].pollution.toString()),t.barData.data[r].data[n].value=a[r].days[n],t.barData.data[r].data[n].data0=a[r].proportion[n]}}else console.log("柱状图没有数据")}))},getBarTableData:function(){var t=this;this.barTableData=[],this.$request({url:"/aqi/queryBarChatTableOfPollutionLevel",methods:"post",params:{regionCode:this.regionDefault,startDate:"MouthPicker1"===this.dataType?null:this.currentTimeD[0],endDate:"MouthPicker1"===this.dataType?null:this.currentTimeD[1],year:"MouthPicker1"===this.dataType?this.currentYearD:""}}).then((function(e){t.barTableData=e.data}))},pollutionLevel:function(t){var e="";switch(t){case"0":e="优";break;case"1":e="良";break;case"2":e="轻度污染";break;case"3":e="中度污染";break;case"4":e="重度污染";break;case"5":e="严重污染"}return e},handleClick:function(t,e){"1"===t.index?this.$refs.contrastCity.getData():"2"===t.index?this.$refs.changeAnalysis.getData():"3"===t.index&&this.$refs.qualifiedDaysAnalysis.getData()},showPickerChild:function(t){this.currentDate=t},currentTime:function(){var t=new Date,e=t.getMonth()<9?"0"+(t.getMonth()+1):t.getMonth()+1,a=t.getDate()<=9?"0"+t.getDate():t.getDate(),r=t.getFullYear()+"-"+e+"-"+a;this.currentTimeD=[r,r]},currentYear:function(){var t=new Date,e=t.getFullYear();this.currentYearD=e.toString()},regionData:function(t){this.regionDefault=t}}},et=tt,at=(a("fb63"),Object(h["a"])(et,r,n,!1,null,"21d7d68c",null));e["default"]=at.exports},"0b35":function(t,e,a){},15:function(t,e){},16:function(t,e){},17:function(t,e){},"2f21":function(t,e,a){"use strict";var r=a("79e5");t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},"33f4":function(t,e,a){"use strict";var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-cascader",{staticStyle:{flex:"1"},attrs:{placeholder:"选择省/市",options:t.options,clearable:""},model:{value:t.newRegion,callback:function(e){t.newRegion=e},expression:"newRegion"}})],1)},n=[],i=(a("6b54"),a("c5f6"),{data:function(){return{form:{name:"",region:"",date1:"",date2:"",delivery:!1,type:[],resource:"",desc:""},options:[],newRegion:[]}},watch:{newRegion:function(t,e){this.$emit("regionCode",t[this.newRegion.length-1])}},created:function(){var t=this,e=new Promise((function(e,a){t.$request({url:"/organization/getMapPath",method:"get",params:{organizationId:t.$store.state.orgId}}).then((function(a){for(var r=a.data,n=0;n<r.length;n++){t.options.push({value:r[n].provinceCode,label:r[n].provinceName}),t.options[n].children=[];for(var i=0;i<r[n].cities.length;i++)t.options[n].children.push({value:r[n].cities[i].cityCode,label:r[n].cities[i].cityName})}e()})).catch((function(t){console.log("请求Region失败"),console.log(t)}))}));e.then((function(){t.newRegion=[Number(t.$store.state.regionCode.toString().substr(0,2)+"0000"),Number(t.$store.state.regionCode.toString().substr(0,4)+"00")]}))}}),o=i,l=(a("a65e"),a("2877")),s=Object(l["a"])(o,r,n,!1,null,"33b14dc4",null);e["a"]=s.exports},"3edc":function(t,e,a){},"456d":function(t,e,a){var r=a("4bf8"),n=a("0d58");a("5eda")("keys",(function(){return function(t){return n(r(t))}}))},"55dd":function(t,e,a){"use strict";var r=a("5ca1"),n=a("d8e8"),i=a("4bf8"),o=a("79e5"),l=[].sort,s=[1,2,3];r(r.P+r.F*(o((function(){s.sort(void 0)}))||!o((function(){s.sort(null)}))||!a("2f21")(l)),"Array",{sort:function(t){return void 0===t?l.call(i(this)):l.call(i(this),n(t))}})},"5eda":function(t,e,a){var r=a("5ca1"),n=a("8378"),i=a("79e5");t.exports=function(t,e){var a=(n.Object||{})[t]||Object[t],o={};o[t]=e(a),r(r.S+r.F*i((function(){a(1)})),"Object",o)}},"63e1":function(t,e,a){"use strict";a("0b35")},6597:function(t,e,a){},a65e:function(t,e,a){"use strict";a("ed94")},b095:function(t,e,a){},b7c3:function(t,e,a){"use strict";a("b095")},d6c1:function(t,e,a){"use strict";var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width},attrs:{id:"myPieChart"}})},n=[],i=(a("7f7f"),a("28a5"),a("313e")),o=a.n(i),l={props:{datas:{type:Array,default:[]},className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"240px"},save:{type:Boolean,default:!0}},data:function(){return{chart:null}},watch:{datas:function(t,e){this.initChart()}},mounted:function(){this.initChart()},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart:function(){var t=document.getElementById("myPieChart"),e=o.a.init(t);this.chart=e,this.chart.setOption({title:{text:"城市优良天统计柱状图",show:!1},tooltip:{trigger:"item",backgroundColor:"rgba(255,255,255,.8)",color:"gray",borderWidth:"1",borderColor:"#d9d9d9",formatter:function(t){var e=t.name.split(":")[0],a=t.name.split(":")[1];return e+"<br/>天数: "+t.value+"天<br/>占比:"+a},textStyle:{color:"#808080"}},toolbox:{feature:{saveAsImage:{show:this.save}}},color:["#00e400","#ffff00","#ff7e00","#ff0000","#99004c","#7e0023"],series:[{name:"",type:"pie",radius:"70%",center:["55%","50%"],data:this.datas,label:{normal:{show:!0,textStyle:{fontSize:12,color:"#808080"}},emphasis:{show:!0}},labelLine:{normal:{smooth:.2,length:9,length2:18}},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]},!0)}}},s=l,c=a("2877"),u=Object(c["a"])(s,r,n,!1,null,null,null);e["a"]=u.exports},dd66:function(t,e,a){"use strict";a("6597")},ed94:function(t,e,a){},fb63:function(t,e,a){"use strict";a("3edc")}}]);