(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-40f55f4b"],{"0cc3":function(t,n,e){},"496a":function(t,n,e){"use strict";e.r(n);var a=function(){var t=this,n=t._self._c;return n("div",{staticClass:"ids-comp-tenants-contract-amount"},[n("div",{staticStyle:{"margin-top":"10px","border-top":"1px solid #CCCCCC"}}),n("div",{staticClass:"contentText",staticStyle:{height:"25px"}},[n("div",{staticClass:"thisYear",attrs:{id:"tenantsContractAmount_thisYear"},on:{click:t.tenantsContractAmountThisYear}},[t._v("今年")]),n("div",{staticClass:"lastYear",attrs:{id:"tenantsContractAmount_lastYear"},on:{click:t.tenantsContractAmountLastYear}},[t._v("去年")])]),n("div",{staticStyle:{height:"160px"},attrs:{id:"tenantsContractAmount"}}),n("div",{staticStyle:{"font-family":"PingFangSC-Medium","font-size":"16px",color:"#1F1F1F","text-align":"center"}},[t._v(t._s(t.title))])])},s=[],i=e("313e"),o=e.n(i),r=e("4532"),c=e("aed0"),l={name:"IDS-CompTenantsContractAmount",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=r["a"].vm.getBossAllTenants()},mounted:function(){$("#tenantsContractAmount_thisYear").css({"border-bottom":"2px solid deepskyblue"}),$("#tenantsContractAmount_lastYear").css({"border-bottom":"none"}),this.initChart()},beforeDestroy:function(){this.chart.dispose(),this.chart=null},methods:{tenantsContractAmountThisYear:function(){$("#tenantsContractAmount_thisYear").css({"border-bottom":"2px solid deepskyblue"}),$("#tenantsContractAmount_lastYear").css({"border-bottom":"none"}),this.timeLimit="thisYear",this.refreshData()},tenantsContractAmountLastYear:function(){$("#tenantsContractAmount_thisYear").css({"border-bottom":"none"}),$("#tenantsContractAmount_lastYear").css({"border-bottom":"2px solid deepskyblue"}),this.timeLimit="lastYear",this.refreshData()},initChart:function(){this.chart=o.a.init(document.getElementById("tenantsContractAmount"),"macarons"),this.refreshData()},refreshData:function(){var t=this,n=this.tenantsList.map((function(t){return t.tenant_id})),e={tenants:n.join(","),timeLimit:this.timeLimit};r["a"].vm.fetchBossTenantsContractAmount({authorization:{Authorization:"Bearer "+r["a"].vm.getUserToken()},data:e,vm:r["a"].vm}).then((function(){var n,e,a,s,i,o,c=r["a"].vm.getBossTenantsContractAmount();for("thisYear"===t.timeLimit?n=(new Date).getMonth():"lastYear"===t.timeLimit&&(n=11),t.series=[],t.legend=[],e=0;e<c.length;e++){o=[];var l=t.tenantsList.find((function(t){return t.tenant_id===c[e].tenant_id}));for(c[e].tenant_name=l.tenant_name,a=0;a<=n;a++)o[a]=0;for(a=0;a<c[e].value.length;a++)i=c[e].value[a].date,s=parseInt(i.substr(i.length-2,2)),o[s-1]=c[e].value[a].value;t.legend[e]=c[e].tenant_name,t.series[e]={name:c[e].tenant_name,type:"line",smooth:!1,stock:c[e].tenant_id,data:o}}t.setOptions()})).catch((function(t){t.type="error",t.prefix="boss:",c["a"].showTips(e.vm,t)}))},setOptions:function(){this.chart.clear(),this.chart.setOption({tooltip:{trigger:"axis",formatter:function(t,n,e){for(var a="",s=0;s<t.length;s++){var i=t[s],o=i.name,r=i.value,c=i.seriesName,l='<i style="display:inline-block;width:10px;height:10px;background:'+i.color+';margin-right: 5px;border-radius: 50%;}"></i> ';0===s&&(a+=o+"<br/>"),a+=l+c+"："+r.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})}}},m=l,u=(e("e611"),e("2877")),h=Object(u["a"])(m,a,s,!1,null,"1d961db9",null);n["default"]=h.exports},e611:function(t,n,e){"use strict";e("0cc3")}}]);