chunk-6336ca74.49104b24.js 18 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6336ca74"],{"0325":function(e,t,a){var i,s,o;(function(n,l){s=[t,a("4d28")],i=l,o="function"===typeof i?i.apply(t,s):i,void 0===o||(e.exports=o)})(0,(function(e,t){var a=function(e){"undefined"!==typeof console&&console&&console.error&&console.error(e)};if(t){var i=["#C1232B","#27727B","#FCCE10","#E87C25","#B5C334","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD","#D7504B","#C6E579","#F4E001","#F0805A","#26C0C0"],s={color:i,title:{textStyle:{fontWeight:"normal",color:"#27727B"}},visualMap:{color:["#C1232B","#FCCE10"]},toolbox:{iconStyle:{normal:{borderColor:i[0]}}},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#27727B",type:"dashed"},crossStyle:{color:"#27727B"},shadowStyle:{color:"rgba(200,200,200,0.3)"}}},dataZoom:{dataBackgroundColor:"rgba(181,195,52,0.3)",fillerColor:"rgba(181,195,52,0.2)",handleColor:"#27727B"},categoryAxis:{axisLine:{lineStyle:{color:"#27727B"}},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1},splitArea:{show:!1},splitLine:{lineStyle:{color:["#ccc"],type:"dashed"}}},timeline:{itemStyle:{color:"#27727B"},lineStyle:{color:"#27727B"},controlStyle:{color:"#27727B",borderColor:"#27727B"},symbol:"emptyCircle",symbolSize:3},line:{itemStyle:{borderWidth:2,borderColor:"#fff",lineStyle:{width:3},emphasis:{borderWidth:0}},symbol:"circle",symbolSize:3.5},candlestick:{itemStyle:{color:"#c1232b",color0:"#b5c334"},lineStyle:{width:1,color:"#c1232b",color0:"#b5c334"},areaStyle:{color:"#c1232b",color0:"#27727b"}},graph:{itemStyle:{color:"#c1232b"},linkStyle:{color:"#b5c334"}},map:{itemStyle:{color:"#f2385a",areaColor:"#ddd",borderColor:"#eee"},areaStyle:{color:"#fe994e"},label:{color:"#c1232b"}},gauge:{axisLine:{lineStyle:{color:[[.2,"#B5C334"],[.8,"#27727B"],[1,"#C1232B"]]}},axisTick:{splitNumber:2,length:5,lineStyle:{color:"#fff"}},axisLabel:{textStyle:{color:"#fff"}},splitLine:{length:"5%",lineStyle:{color:"#fff"}},title:{offsetCenter:[0,-20]}}};t.registerTheme("infographic",s)}else a("ECharts is not Loaded")}))},"795a":function(e,t,a){"use strict";a("dc3c")},8967:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordere:!1}},[t("div",{staticClass:"table-operator"},[t("a-radio-group",{style:{marginBottom:"30px"},attrs:{"button-style":"solid"},model:{value:e.pageMode,callback:function(t){e.pageMode=t},expression:"pageMode"}},[t("a-radio-button",{attrs:{value:1}},[e._v("行为分析")]),t("a-radio-button",{attrs:{value:2},on:{click:function(t){return e.chooseTab(2)}}},[e._v("留存分析")]),t("a-radio-button",{attrs:{value:3},on:{click:function(t){return e.chooseTab(3)}}},[e._v("页面分析")])],1)],1),t("div",{staticClass:"title"},[e._v("行为数据")]),t("div",{staticClass:"componentsTag"},[t("a-radio-group",{style:{marginBottom:"30px"},attrs:{"button-style":"solid"},model:{value:e.componentsTag,callback:function(t){e.componentsTag=t},expression:"componentsTag"}},[t("a-radio-button",{attrs:{value:1},on:{click:function(t){return e.chooseComponentsTag(1)}}},[e._v("指标对比")]),t("a-radio-button",{attrs:{value:2},on:{click:function(t){return e.chooseComponentsTag(2)}}},[e._v("时间对比")])],1)],1),t("div",{staticClass:"componentsBox"},[1==e.componentsTag?t("IndexComparison"):e._e(),2==e.componentsTag?t("TimeComparison"):e._e()],1)])},s=[],o=function(){var e=this,t=e._self._c;return t("a-spin",{attrs:{spinning:e.isLoading}},[t("div",{staticClass:"downBox"},[t("p",{staticClass:"downTitle",on:{click:function(t){t.stopPropagation(),e.showSelBox=!0}}},[e._v("可选择多个指标")]),e.showSelBox?t("div",{staticClass:"selDataBox"},[e._l(e.tables,(function(a,i){return t("div",{key:i,staticClass:"selDataList"},[t("p",{class:{selDataItem:!0,sel:a.sel},on:{click:function(t){return t.stopPropagation(),e.selTables(i)}}},[e._v(e._s(a.zh))])])})),t("a-button",{staticClass:"selButton",attrs:{type:"primary"},on:{click:e.confirmTables}},[e._v("确定")])],2):e._e()]),t("div",{staticClass:"SelectItemList"},e._l(e.selTablesData,(function(a,i){return t("div",{key:i,staticClass:"SelectItem"},[t("span",{staticClass:"name"},[e._v(e._s(a.zh))]),t("span",{staticClass:"ant",on:{click:function(t){return e.closeSelTables(i)}}},[t("a-icon",{attrs:{type:"close"}})],1)])})),0),t("div",{staticClass:"timeSelectContent"},[t("div",{staticClass:"timeBoxLeft"},[t("a-select",{staticStyle:{width:"130px"},attrs:{"default-value":e.timeSelectType},on:{change:e.changeSelect}},[t("a-select-option",{attrs:{value:1}},[e._v("最近7天")]),t("a-select-option",{attrs:{value:2}},[e._v("最近30天")]),t("a-select-option",{attrs:{value:3}},[e._v("自定义时间")])],1),1==e.timeSelectType||2==e.timeSelectType?t("span",{staticClass:"selTimeText"},[e._v(e._s(e.startText)+" 至 "+e._s(e.endText))]):e._e(),3==e.timeSelectType?t("a-range-picker",{staticClass:"inputW220",attrs:{placeholder:["开始时间","结束时间"],allowClear:!1,disabledDate:e.disabledDate},on:{change:e.changeCustomTime},model:{value:e.customTime,callback:function(t){e.customTime=t},expression:"customTime"}}):e._e()],1),t("div",{staticClass:"rightBox"},[t("a-button",{staticClass:"m20",attrs:{type:"primary"},on:{click:e.exportData}},[e._v("导出")]),t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.modeType,callback:function(t){e.modeType=t},expression:"modeType"}},[t("a-radio-button",{attrs:{value:1},on:{click:function(t){return e.chooseModeType(1)}}},[e._v("按日")]),t("a-radio-button",{attrs:{value:2},on:{click:function(t){return e.chooseModeType(2)}}},[e._v("按周")]),t("a-radio-button",{attrs:{value:3},on:{click:function(t){return e.chooseModeType(3)}}},[e._v("按月")])],1)],1)]),t("div",{staticClass:"echartsBody"},[t("div",{staticStyle:{width:"100%",height:"500px"},attrs:{id:"main"}})])])},n=[],l=(a("9f29"),a("b505"),a("a2bf"),a("0528"),a("cb8e")),c=(a("9b2d"),a("2f42")),r=a.n(c),m=a("4d28"),u=a.n(m),d=(a("0325"),{components:{},data:function(){return{isLoading:!1,showSelBox:!1,queryParam:{},customTime:[],startText:"",endText:"",tables:[],selTablesData:[],timeSelectType:2,modeType:1}},created:function(){this.getData()},mounted:function(){var e=this;document.addEventListener("click",(function(t){e.showSelBox&&(e.showSelBox=!1,e.changeSelData())})),window.onresize=function(){var e=u.a.init(document.getElementById("main"),"infographic");e.resize()}},beforeDestroy:function(){window.onresize=null},methods:{disabledDate:function(e){return e&&(e<r()().subtract(91,"days")||e>r()().subtract(1,"days"))},exportData:function(){var e=this,t={type:this.timeSelectType,grain_size:this.modeType};if(3==this.timeSelectType){var a=new Date(this.customTime[0]).getTime()/1e3,i=new Date(this.customTime[1]).getTime()/1e3;t.start=a,t.end=i}l["b"](t).then((function(t){var a=document.createElement("a");a.href=t.data.file,a.setAttribute("download",t.data.filename),a.click(),a=null,e.$message.success(t.message)})).finally((function(){e.isLoading=!1}))},getData:function(){var e=this;if(this.queryParam.type=this.timeSelectType,this.queryParam.grain_size=this.modeType,3==this.timeSelectType){var t=new Date(this.customTime[0]).getTime()/1e3,a=new Date(this.customTime[1]).getTime()/1e3;this.queryParam.start=t,this.queryParam.end=a}this.isLoading=!0,l["a"](this.queryParam).then((function(t){if(e.tables=t.data.table||[],e.selTablesData.length<=0)e.defaultSelected();else{for(var a=[],i=0;i<e.tables.length;i++){for(var s=e.tables[i],o=0;o<e.selTablesData.length;o++){var n=e.selTablesData[o];s.id==n.id&&(e.$set(s,"sel",!0),a.push(s))}if(a.length==e.selTablesData.length)break}e.selTablesData=a}e.changeEcharts();var l=t.data.start,c=t.data.end;e.customTime=[l,c],e.startText=l,e.endText=c,e.isLoading=!1})).finally((function(){e.isLoading=!1}))},defaultSelected:function(){this.tables.length>0&&(this.$set(this.tables[0],"sel",!0),this.selTablesData=[],this.selTablesData.push(this.tables[0]))},selTables:function(e){var t=this.tables[e];this.$set(t,"sel",!t.sel)},confirmTables:function(){this.showSelBox=!1,this.changeSelData()},changeSelData:function(){this.selTablesData=this.tables.filter((function(e){return e.sel})),this.selTablesData.length<=0&&(this.$message.error("至少勾选一个指标",1.5),this.defaultSelected()),this.changeEcharts()},closeSelTables:function(e){if(this.selTablesData.length<=1)this.$message.error("请至少勾选一个指标",1.5);else{for(var t=this.selTablesData[e],a=0;a<this.tables.length;a++){var i=this.tables[a];if(i.id==t.id){i.sel=!1;break}}this.selTablesData.splice(e,1),this.changeEcharts()}},changeSelect:function(e){this.timeSelectType=e,3!=this.timeSelectType&&this.getData()},changeCustomTime:function(e){this.customTime=e,this.getData()},chooseModeType:function(e){e!=this.modeType&&(this.modeType=e,this.getData())},changeEcharts:function(){var e=this;this.$nextTick((function(){e.myEcharts()}))},myEcharts:function(){for(var e=[],t=this.tables[0].lines[0].fields,a=0;a<t.length;a++){var i=t[a],s=i.refdate;e.push(s)}var o=[],n=[];this.selTablesData.forEach((function(e){o.push(e.zh);var t=e.lines[0].fields,a=[];t.forEach((function(e){a.push(e.value)})),n.push({name:e.zh,type:"line",smooth:!0,hoverAnimation:!1,symbolSize:7,areaStyle:{normal:{opacity:.2}},itemStyle:{normal:{lineStyle:{width:1.3}}},data:a})}));var l=u.a.init(document.getElementById("main"),"infographic"),c="5%",r="5%";1==this.modeType&&(r="3%",c="3%");var m={tooltip:{trigger:"axis"},legend:{data:o,y:"bottom"},grid:{left:r,right:c},xAxis:{type:"category",boundaryGap:!1,data:e,axisLabel:{color:"#1a1b1c"}},yAxis:{type:"value"},series:n};m&&l.setOption(m,!0)}}}),h=d,p=(a("a436"),a("829d")),T=Object(p["a"])(h,o,n,!1,null,"e07d5396",null),f=T.exports,b=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"downBox"},[t("p",{staticClass:"downTitle",on:{click:function(t){t.stopPropagation(),e.showSelBox=!0}}},[e._v(e._s(e.tables.length>0?e.selTablesItem.zh:"请选择指标"))]),e.showSelBox?t("div",{staticClass:"selDataBox"},e._l(e.tables,(function(a,i){return t("div",{key:i,staticClass:"selDataList"},[t("p",{class:{selDataItem:!0,sel:e.selTablesItem&&a.id==e.selTablesItem.id},on:{click:function(t){return t.stopPropagation(),e.selTables(i)}}},[e._v(e._s(a.zh))])])})),0):e._e()]),t("div",{staticClass:"timeSelectContent"},[t("div",{staticClass:"timeBoxLeft"},[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":e.timeSelectType},on:{change:e.changeSelect}},[t("a-select-option",{attrs:{value:1}},[e._v("最近7天")]),t("a-select-option",{attrs:{value:2}},[e._v("最近30天")]),t("a-select-option",{attrs:{value:3}},[e._v("自定义")])],1),1==e.timeSelectType||2==e.timeSelectType?t("span",{staticClass:"selTimeText"},[e._v(e._s(e.startText)+" 至 "+e._s(e.endText))]):e._e(),3==e.timeSelectType?t("a-range-picker",{staticClass:"picker inputW220",attrs:{placeholder:["开始时间","结束时间"],allowClear:!1,disabledDate:e.disabledDate},on:{change:e.changeCustomTime},model:{value:e.customTime,callback:function(t){e.customTime=t},expression:"customTime"}}):e._e(),t("span",{staticClass:"contrastText"},[e._v("对比")]),t("a-select",{staticStyle:{width:"140px"},attrs:{"default-value":e.compTimeType},on:{change:e.changeCompTimeType}},[t("a-select-option",{attrs:{value:1}},[e._v("该时间段前7天")]),t("a-select-option",{attrs:{value:2}},[e._v("该时间段前14天")]),t("a-select-option",{attrs:{value:3}},[e._v("该时间段前30天")]),t("a-select-option",{attrs:{value:4}},[e._v("自定义")])],1),1==e.compTimeType||2==e.compTimeType||3==e.compTimeType?t("span",{staticClass:"selTimeText"},[e._v(e._s(e.compStartText)+" 至 "+e._s(e.compEndText))]):e._e(),4==e.compTimeType?t("a-range-picker",{staticClass:"picker inputW220",attrs:{placeholder:["开始时间","结束时间"],allowClear:!1,disabledDate:e.disabledDate},on:{change:e.changeCompTime},model:{value:e.compTime,callback:function(t){e.compTime=t},expression:"compTime"}}):e._e()],1),t("div",{staticClass:"rightBox"},[t("a-button",{staticClass:"m20",attrs:{type:"primary"},on:{click:e.exportData}},[e._v("导出")]),t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.modeType,callback:function(t){e.modeType=t},expression:"modeType"}},[t("a-radio-button",{attrs:{value:1},on:{click:function(t){return e.chooseModeType(1)}}},[e._v("按日")]),t("a-radio-button",{attrs:{value:2},on:{click:function(t){return e.chooseModeType(2)}}},[e._v("按周")]),t("a-radio-button",{attrs:{value:3},on:{click:function(t){return e.chooseModeType(3)}}},[e._v("按月")])],1)],1)]),e._m(0)])},y=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"echartsBody"},[t("div",{staticStyle:{width:"100%",height:"600px"},attrs:{id:"main"}})])}],g=(a("e330"),{components:{},data:function(){return{isLoading:!1,showSelBox:!1,tables:[],selTablesItem:null,timeSelectType:2,compTimeType:1,modeType:1,queryParam:{},customTime:[],startText:"",endText:"",compTime:[],compStartText:"",compEndText:""}},created:function(){this.getData()},mounted:function(){var e=this;document.addEventListener("click",(function(t){e.showSelBox&&(e.showSelBox=!1)})),window.onresize=function(){var e=u.a.init(document.getElementById("main"),"infographic");e.resize()}},beforeDestroy:function(){window.onresize=null},methods:{disabledDate:function(e){return e&&(e<r()().subtract(91,"days")||e>r()().subtract(1,"days"))},exportData:function(){var e=this,t={};t.type=this.timeSelectType,t.grain_size=this.modeType,t.comp_type=this.compTimeType,3==this.timeSelectType&&(t.start=this.getTimeNumber(this.customTime[0]),t.end=this.getTimeNumber(this.customTime[1])),4==this.compTimeType&&(t.comp_start=this.getTimeNumber(this.compTime[0]),t.comp_end=this.getTimeNumber(this.compTime[1])),l["b"](t).then((function(t){var a=document.createElement("a");a.href=t.data.file,a.setAttribute("download",t.data.filename),a.click(),a=null,e.$message.success(t.message)})).finally((function(){e.isLoading=!1}))},getData:function(){var e=this;this.queryParam.type=this.timeSelectType,this.queryParam.grain_size=this.modeType,this.queryParam.comp_type=this.compTimeType,3==this.timeSelectType&&(this.queryParam.start=this.getTimeNumber(this.customTime[0]),this.queryParam.end=this.getTimeNumber(this.customTime[1])),4==this.compTimeType&&(this.queryParam.comp_start=this.getTimeNumber(this.compTime[0]),this.queryParam.comp_end=this.getTimeNumber(this.compTime[1])),this.isLoading=!0,l["a"](this.queryParam).then((function(t){if(e.tables=t.data.table||[],e.tables.length<=0&&(e.selTablesItem=null),e.selTablesItem&&"{}"!=JSON.stringify(e.selTablesItem))for(var a=0;a<e.tables.length;a++){var i=e.tables[a];if(i.id==e.selTablesItem.id){e.$set(i,"sel",!0),e.selTablesItem=i;break}}else e.defaultSelected();e.changeEcharts();var s=t.data.start,o=t.data.end;e.customTime=[s,o],e.startText=s,e.endText=o;var n=t.data.comp_start,l=t.data.comp_end;e.compTime=[n,l],e.compStartText=n,e.compEndText=l,e.isLoading=!1})).finally((function(){e.isLoading=!1}))},getTimeNumber:function(e){return new Date(e).getTime()/1e3},defaultSelected:function(){this.selTablesItem=this.tables[0]||{}},selTables:function(e){var t=this.tables[e];this.selTablesItem=t,this.showSelBox=!1,this.changeEcharts()},changeSelect:function(e){this.timeSelectType=e,3!=this.timeSelectType&&this.getData()},changeCompTimeType:function(e){this.compTimeType=e,4!=this.compTimeType&&this.getData()},changeCustomTime:function(e){this.customTime=e,this.getData()},changeCompTime:function(e){this.compTime=e,this.getData()},chooseModeType:function(e){e!=this.modeType&&(this.modeType=e,this.getData())},changeEcharts:function(){var e=this;this.$nextTick((function(){e.myEcharts()}))},myEcharts:function(){var e=this,t=[],a=[],i=[],s=0,o=this.selTablesItem.lines||[];o.forEach((function(o,n){var l="";l=0==n?e.startText+"至"+e.endText:e.compStartText+"至"+e.compEndText;var c=l+e.selTablesItem.zh;t.push(c),0==n&&(i=o.fields,s=n),o.fields.length>i.length&&(i=o.fields,s=n);var r=[];o.fields.forEach((function(e){r.push(e.value)})),a.push({name:c,type:"line",smooth:!0,hoverAnimation:!1,areaStyle:{normal:{opacity:.2}},itemStyle:{normal:{lineStyle:{width:1.3}}},symbolSize:7,data:r})}));var n=[];i&&i.forEach((function(e){n.push(e.refdate)}));var l=u.a.init(document.getElementById("main"),"infographic");l.resize();var c="5%",r="5%";1==this.modeType&&(r="3%",c="3%");var m=["#3290FA","#30B958"],d={color:m,tooltip:{trigger:"axis",formatter:function(t){var a=e.selTablesItem.zh;return t.forEach((function(i,o){var n=i.dataIndex,l=e.selTablesItem.lines[o]||{};1==t.length&&(l=e.selTablesItem.lines[s]||{});var c=l.fields[n]||{},r=c.refdate;a+='\n <div>\n <span style="background:'.concat(i.color,';display: inline-block;width: 6px;height: 6px;margin-right: 4px;margin-bottom: 2px;"></span>\n ').concat(r,": ").concat(i.data,"\n </div>")})),a}},legend:{data:t,y:"bottom"},grid:{left:r,right:c},xAxis:{type:"category",boundaryGap:!1,data:n,axisLabel:{color:"#1a1b1c"}},yAxis:{type:"value"},series:a};d&&l.setOption(d,!0)}}}),v=g,x=(a("795a"),Object(p["a"])(v,b,y,!1,null,"5f26bacb",null)),S=x.exports,C={components:{IndexComparison:f,TimeComparison:S},data:function(){return{pageMode:1,componentsTag:1}},methods:{chooseTab:function(e){var t=2==e?"./retained":"./page";this.$router.push(t)},chooseComponentsTag:function(e){e!=this.componentsTag&&(this.componentsTag=e)}}},_=C,D=(a("c226"),Object(p["a"])(_,i,s,!1,null,"09020190",null));t["default"]=D.exports},a436:function(e,t,a){"use strict";a("d312")},b97a:function(e,t,a){},c226:function(e,t,a){"use strict";a("b97a")},cb8e:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"e",(function(){return n})),a.d(t,"f",(function(){return l})),a.d(t,"c",(function(){return c})),a.d(t,"d",(function(){return r})),a.d(t,"b",(function(){return m}));var i=a("b775"),s={behaviorTrend:"/analysis.behavior/behaviorTrend",pageVisit:"/analysis.page/pageVisit",retainData:"/analysis.retain/retainData",exportPage:"/analysis.page/export",exportRetain:"/analysis.retain/exportRetainData",exportBehaviorTrend:"/analysis.behavior/exportBehaviorTrend"};function o(e){return Object(i["b"])({url:s.behaviorTrend,method:"get",params:e})}function n(e){return Object(i["b"])({url:s.pageVisit,method:"get",params:e})}function l(e){return Object(i["b"])({url:s.retainData,method:"get",params:e})}function c(e){return Object(i["b"])({url:s.exportPage,method:"get",params:e})}function r(e){return Object(i["b"])({url:s.exportRetain,method:"post",data:e})}function m(e){return Object(i["b"])({url:s.exportBehaviorTrend,method:"post",data:e})}},d312:function(e,t,a){},dc3c:function(e,t,a){}}]);