You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
3.7 KiB
1 line
3.7 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-782652f9"],{2764:function(t,e,i){},"58cf":function(t,e,i){"use strict";i("2764")},fec1:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},r=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticStyle:{width:"100%",height:"100%"}},[i("div",{staticClass:"chart"},[i("div",{staticClass:"bar",staticStyle:{width:"100%",height:"100%"},attrs:{id:"ConsumptionTrend"}})])])}],a=i("ca00"),o=i("0fea"),s=i("4ec3");function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function u(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){p(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function p(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var d={name:"ConsumptionTrend",props:{queryData:{type:Object,default:function(){return{}}},dayType:{type:String},rangeTime:{type:Array},userType:{type:String}},data:function(){return{chartInfo:null,queryParam:{userType:""},option:{legend:{show:!0,data:["广告主","二代"],bottom:12},grid:{top:"30",bottom:"40",left:"40",right:"40",containLabel:!0},xAxis:{type:"category",data:[]},yAxis:{type:"value"},series:[{name:"广告主",data:[],type:"line",itemStyle:{color:"#96daf9"},label:{show:!0,position:"top"}},{name:"二代",data:[],type:"line",itemStyle:{color:"#99f20d"},label:{show:!0,position:"top"}}]},platformList:[],urlApi:{userCount:"/smb/index/userCount"},dataSource:{columns:[],dataList:[{},{}]}}},created:function(){var t=this;this.initData(),window.onresize=Object(a["m"])((function(){t.chartInfo.resize()})),this.getDictCode()},watch:{chartInfo:function(t,e){t&&t.resize()},dayType:{handler:function(t){this.getUserCountList()},immediate:!1,deep:!0},rangeTime:{handler:function(t){this.getUserCountList()},immediate:!1,deep:!0},userType:{handler:function(t){this.getUserCountList()},immediate:!1,deep:!0}},methods:{initData:function(){var t=this;this.$nextTick((function(){var e=document.getElementById("ConsumptionTrend");t.chartInfo=t.echarts.init(e),t.chartInfo.setOption(t.option)}))},getUserCountList:function(){var t=this,e={dayType:this.dayType,startTime:this.rangeTime?this.rangeTime[0].format("YYYY-MM-DD"):"",endTime:this.rangeTime?this.rangeTime[1].format("YYYY-MM-DD"):"",userType:this.userType,platformType:this.queryData.platform||"",userId:this.queryData.userid||"",orgCode:this.queryData.orgTree||"",post:this.queryData.position||""};Object(o["i"])(this.urlApi.userCount,e).then((function(e){if(e.success){var i=e.result,n=i.advertiserList,r=i.agentList,a=i.days;t.option.series[0].data=n,t.option.series[1].data=r,t.option.xAxis.data=a,t.initData(),t.dataSource.columns=a.map((function(t,e){return{dataIndex:"date"+e,title:t}})),n.forEach((function(e,i){t.dataSource.dataList[0]["date"+i]=e})),r.forEach((function(e,i){t.dataSource.dataList[1]["date"+i]=e}))}}))},getDictCode:function(){var t=Object(s["t"])("account_category");this.platformList=t.map((function(t){return u(u({},t),{},{value:t.value})})),this.queryParam.userType=this.platformList[0].value,this.getUserCountList()},filterOption:function(t,e){return e.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0},handleQuery:function(){this.getUserCountList()}}},f=d,l=(i("58cf"),i("2877")),h=Object(l["a"])(f,n,r,!1,null,"3ab9a1bc",null);e["default"]=h.exports}}]); |