(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0a87559c"],{afcf:function(t,e,n){"use strict";n("b66f")},b66f:function(t,e,n){},c6dd:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ids-comp-tenants-contract-need-provide"},[e("div",{staticStyle:{"margin-top":"10px","border-top":"1px solid #CCCCCC"}}),e("div",{staticClass:"contentText",staticStyle:{height:"25px"}},[e("div",{staticClass:"thisYear",attrs:{id:"tenantsContractNeedProvide_thisYear"},on:{click:t.tenantsContractNeedProvideThisYear}},[t._v("今年")]),e("div",{staticClass:"lastYear",attrs:{id:"tenantsContractNeedProvide_lastYear"},on:{click:t.tenantsContractNeedProvideLastYear}},[t._v("去年")])]),e("div",{staticStyle:{height:"160px"},attrs:{id:"tenantsContractNeedProvide"}}),e("div",{staticStyle:{"font-family":"PingFangSC-Medium","font-size":"16px",color:"#1F1F1F","text-align":"center"}},[t._v(t._s(t.title))])])},i=[],s=n("313e"),r=n.n(s),o=n("4532"),d=n("aed0"),c={name:"IDS-CompTenantsContractNeedProvide",props:{title:String,default:"厂商待供合同方量趋势与同比(单位:万方)"},data:function(){return{tenantsList:[],chart:null,timeLimit:"thisYear",legend:[],series:[],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]}},created:function(){console.log("调试代码"),this.tenantsList=o["a"].vm.getBossAllTenants()},mounted:function(){$("#tenantsContractNeedProvide_thisYear").css({"border-bottom":"2px solid deepskyblue"}),$("#tenantsContractNeedProvide_lastYear").css({"border-bottom":"none"}),this.initChart()},beforeDestroy:function(){this.chart.dispose(),this.chart=null},methods:{tenantsContractNeedProvideThisYear:function(){$("#tenantsContractNeedProvide_thisYear").css({"border-bottom":"2px solid deepskyblue"}),$("#tenantsContractNeedProvide_lastYear").css({"border-bottom":"none"}),this.timeLimit="thisYear",this.refreshData()},tenantsContractNeedProvideLastYear:function(){$("#tenantsContractNeedProvide_thisYear").css({"border-bottom":"none"}),$("#tenantsContractNeedProvide_lastYear").css({"border-bottom":"2px solid deepskyblue"}),this.timeLimit="lastYear",this.refreshData()},initChart:function(){this.chart=r.a.init(document.getElementById("tenantsContractNeedProvide"),"macarons"),this.refreshData()},refreshData:function(){var t=this,e=this.tenantsList.map((function(t){return t.tenant_id})),n={tenants:e.join(","),timeLimit:this.timeLimit};o["a"].vm.fetchBossTenantsContractNeedProvide({authorization:{Authorization:"Bearer "+o["a"].vm.getUserToken()},data:n,vm:o["a"].vm}).then((function(){var e,n,a,i,s,r,d=o["a"].vm.getBossTenantsContractNeedProvide();for("thisYear"===t.timeLimit?e=(new Date).getMonth():"lastYear"===t.timeLimit&&(e=11),t.series=[],t.legend=[],n=0;n<d.length;n++){r=[];var c=t.tenantsList.find((function(t){return t.tenant_id===d[n].tenant_id}));for(d[n].tenant_name=c.tenant_name,a=0;a<=e;a++)r[a]=0;for(a=0;a<d[n].value.length;a++)s=d[n].value[a].date,i=parseInt(s.substr(s.length-2,2)),r[i-1]=d[n].value[a].value;t.legend[n]=d[n].tenant_name,t.series[n]={name:d[n].tenant_name,type:"line",smooth:!1,stock:d[n].tenant_id,data:r}}t.setOptions()})).catch((function(t){t.type="error",t.prefix="boss:",d["a"].showTips(n.vm,t)}))},setOptions:function(){this.chart.clear(),this.chart.setOption({tooltip:{trigger:"axis",formatter:function(t,e,n){for(var a="",i=0;i<t.length;i++){var s=t[i],r=s.name,o=s.value,d=s.seriesName,c='<i style="display:inline-block;width:10px;height:10px;background:'+s.color+';margin-right: 5px;border-radius: 50%;}"></i> ';0===i&&(a+=r+"<br/>"),a+=c+d+"："+o.toFixed(2)+"万方<br/>"}return a}},legend:{top:"7%",data:this.legend},grid:{top:"30%",left:"4%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:this.months},yAxis:{type:"value"},series:this.series})}}},l=c,h=(n("afcf"),n("2877")),m=Object(h["a"])(l,a,i,!1,null,"6c31930a",null);e["default"]=m.exports}}]);