(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-64c6"],{"+6h0":function(t,e,i){"use strict";var a=i("FAQi");i.n(a).a},"9kPm":function(t,e,i){"use strict";e.a={data:function(){return{showTable:!0}},methods:{mixinSortFn:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"ascending";if("[object Array]"!==Object.prototype.toString.call(t))return[];if(!e)return t;t.sort(function(t,a){if(t[e]===a[e])return 0;var o=isNaN(Number(t[e]))||isNaN(Number(a[e]))?t[e]<a[e]:Number(t[e])<Number(a[e]);return"descending"===i?o?1:-1:o?-1:1})}}}},AfsK:function(t,e,i){"use strict";i.r(e);var a=i("31UX"),o=i("9kPm"),n=i("MT78"),s=i.n(n),r=i("JgLm"),l={name:"CustomerRecordModeStatistics",mixins:[a.a,o.a],data:function(){return{loading:!1,showType:"pie",postParams:{},axisOption:null,pieOption:null,list:[],fieldList:[{field:"category",name:"跟进方式"},{field:"recordNum",name:"个数"},{field:"proportion",name:"占比（%）"}]}},computed:{},mounted:function(){this.initPie(),this.initAxis()},methods:{showTypeChange:function(t){this.showType=t,this.refreshChartInfo()},refreshChartInfo:function(){"pie"!=this.showType?(this.axisOption.series[0].type=this.showType,this.chartObj.setOption(this.axisOption,!0)):this.chartObj.setOption(this.pieOption,!0)},getDataList:function(t){var e=this;this.postParams=t,Object(r.n)(t).then(function(t){e.loading=!1,e.list=t.data||[];for(var i=[],a=[],o=[],n=0;n<e.list.length;n++){var s=e.list[n];i.push({name:s.category,value:s.proportion}),a.push(s.recordNum),o.push(s.category)}e.pieOption.legend.data=o,e.pieOption.series[0].data=i,e.axisOption.xAxis[0].data=o,e.axisOption.series[0].data=a,e.refreshChartInfo()}).catch(function(){e.loading=!1})},getSummaries:function(t){var e=t.columns,i=t.data,a=[];return e.forEach(function(t,e){if(0!==e){var o=i.map(function(e){return Number(e[t.property])});o.every(function(t){return isNaN(t)})?a[e]="N/A":(a[e]=o.reduce(function(t,e){var i=Number(e);return isNaN(i)?t:t+e},0),2===e&&(a[e]=a[e]>0?"100.00":"0.00"))}else a[e]="合计"}),a},initAxis:function(){this.chartObj=s.a.init(document.getElementById("axismain")),this.axisOption={color:["#6ca2ff"],toolbox:this.toolbox,tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{top:"40px",left:"30px",right:"30px",bottom:"40px",containLabel:!0,borderColor:"#fff"},xAxis:[{type:"category",data:[],axisTick:{alignWithLabel:!0,lineStyle:{width:0}},axisLabel:{color:"#333"},axisLine:{lineStyle:{color:"#333"}},splitLine:{show:!1}}],yAxis:[{type:"value",name:"",axisTick:{alignWithLabel:!0,lineStyle:{width:0}},axisLabel:{color:"#333",formatter:"{value}个"},axisLine:{lineStyle:{color:"#333"}},splitLine:{show:!1}}],series:[{name:"",type:"bar",barMaxWidth:15,data:[]}]}},initPie:function(){this.pieOption={color:this.chartColors,toolbox:this.toolbox,tooltip:{trigger:"item",formatter:"{b} : {c}% "},legend:{type:"scroll",bottom:"0",x:"center",data:[]},series:[{name:"",type:"pie",radius:"55%",stillShowZeroSum:!1,center:["40%","50%"],data:[],itemStyle:{emphasis:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}},exportClick:function(){this.requestExportInfo(r.o,this.postParams)}}},c=(i("+6h0"),i("KHd+")),u=Object(c.a)(l,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"main-container"},[i("filtrate-handle-view",{staticClass:"filtrate-bar",attrs:{"show-custom-select":!0,"custom-default":t.showType,"custom-options":[{name:"饼状图",value:"pie"},{name:"柱状图",value:"bar"}],title:"客户跟进方式分析","module-type":"customer"},on:{load:function(e){t.loading=!0},change:t.getDataList,typeChange:t.showTypeChange}}),t._v(" "),i("div",{staticClass:"content"},[t._m(0),t._v(" "),i("div",{staticClass:"table-content"},[i("div",{staticClass:"handle-bar"},[i("el-button",{staticClass:"export-btn",on:{click:t.exportClick}},[t._v("导出")])],1),t._v(" "),t.showTable?i("el-table",{attrs:{data:t.list,"summary-method":t.getSummaries,height:"400","show-summary":"",stripe:"",border:"","highlight-current-row":""},on:{"sort-change":function(e){var i=e.prop,a=e.order;return t.mixinSortFn(t.list,i,a)}}},t._l(t.fieldList,function(t,e){return i("el-table-column",{key:e,attrs:{prop:t.field,label:t.name,sortable:"custom",align:"center","header-align":"center","show-overflow-tooltip":""}})})):t._e()],1)])],1)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"axis-content"},[e("div",{attrs:{id:"axismain"}})])}],!1,null,"50af9746",null);u.options.__file="CustomerRecordModeStatistics.vue";e.default=u.exports},FAQi:function(t,e,i){}}]);