1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-55377434"],{"272a":function(t,e,n){"use strict";n("def7")},8630:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{width:"100%",height:"100%"}},[n("el-card",{staticStyle:{width:"100%"},attrs:{shadow:"hover"}},[n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"space-between"},attrs:{slot:"header"},slot:"header"},[n("span",{staticClass:"echartBox_title",on:{click:t.toRtPage}},[t._v(t._s(t.name)+"(漏斗)")]),t._v(" "),n("div",[n("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"top"}},[n("template",{slot:"title"},[n("span",[t._v("拖移报表")])]),t._v(" "),n("el-button",{staticClass:"drageTag",attrs:{type:"warning",icon:"el-icon-rank",circle:""}})],2),t._v(" "),n("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"top"}},[n("template",{slot:"title"},[n("span",[t._v("切换成表格或者图表")])]),t._v(" "),n("el-button",{attrs:{type:"primary",icon:t.totable?"el-icon-s-data":"el-icon-s-grid",circle:""},on:{click:t.changeViewType}})],2),t._v(" "),n("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"top"}},[n("template",{slot:"title"},[n("span",[t._v("刷新")])]),t._v(" "),n("el-button",{attrs:{icon:"el-icon-refresh",circle:""},on:{click:t.go}})],2),t._v(" "),n("a-tooltip",{staticStyle:{cursor:"pointer"},attrs:{placement:"top"}},[n("template",{slot:"title"},[n("span",[t._v("下载表数据")])]),t._v(" "),n("el-button",{attrs:{type:"success",icon:"el-icon-download",circle:""},on:{click:t.download}})],2)],1)]),t._v(" "),n("a-spin",{attrs:{tip:"计算中...",spinning:t.spinning}},[n("div",{staticClass:"spin-content"},[t.funnelResShow?n("funnel-result",{ref:t.getRef,attrs:{"empty-text":"暂无结果,请调整查询条件","class-name":t.getRef,"show-charts":t.tocharts,"show-table":t.totable,"table-header":t.tableHeader,"group-data":t.groupData,"funnel-res":t.funnelRes},on:{go:t.go},model:{value:t.form.date,callback:function(e){t.$set(t.form,"date",e)},expression:"form.date"}}):t._e()],1)])],1)],1)},r=[],s=n("2d63"),i=(n("c5f6"),n("c80c")),o=(n("96cf"),n("3b8d")),c=(n("7f7f"),n("94b0")),u=n("c1df"),l=n.n(u),h={name:"Funnel",components:{FunnelResult:function(){return Promise.all([n.e("chunk-2d3eea4a"),n.e("chunk-1413a208")]).then(n.bind(null,"fd29"))}},props:{name:{type:String,default:""},data:{type:Object,default:{}},id:{type:String,default:""},filterDate:{type:Array,default:[]}},data:function(){return{spinning:!1,allAttrOptions:[],form:JSON.parse(this.data),tableHeader:[],groupData:[],funnelRes:[],funnelResShow:!0,prevCount:0,tocharts:!0,totable:!1}},computed:{getRef:function(){return"funnelRes"+this.id}},watch:{filterDate:{immediate:!0,handler:function(){this.filterDate.length>0&&(this.form.date=this.filterDate,Vue.set(this.form,"date",this.filterDate),this.go())}}},beforeMount:function(){0==this.filterDate.length&&(this.form.date=[l()().startOf("day").subtract(1,"days").format("YYYY-MM-DD"),l()().startOf("day").subtract(1,"days").format("YYYY-MM-DD")]),this.init()},methods:{download:function(){this.$refs[this.getRef].download(this.name)},init:function(){var t=Object(o["a"])(Object(i["a"])().mark((function t(){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getMetaEventList();case 2:return t.next=4,this.go();case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),toRtPage:function(){this.$router.push({path:"/behavior-analysis/funnel/"+this.id})},changeViewType:function(){var t=this;this.tocharts=!this.tocharts,this.totable=!this.totable,this.funnelResShow=!1,this.$nextTick((function(){t.funnelResShow=!0}))},getWashData:function(t){var e=[];for(var n in null!=t&&Math.max.apply(Math,t.map((function(t){return t.count}))),this.prevCount=0,this.form.zhibiaoArr){var a=Number(n)+1,r={level_desc:this.form.zhibiaoArr[n].eventNameDisplay,level_index:a,showTitle:"步骤".concat(a,":").concat(this.form.zhibiaoArr[n].eventNameDisplay),count:0,conversionScale:0,washScale:100,lostScale:100,succScale:0,max:100};if(null!=t){var i,o=Object(s["a"])(t);try{for(o.s();!(i=o.n()).done;){var c=i.value;c.level_index!=a||(1==a?(r.count=c.count,r.succScale=100,r.lostScale=0,r.ui=c.ui):(r.count=c.count,r.ui=c.ui,r.succScale=(100*Number(c.count/this.prevCount)).toFixed(2),r.lostScale=(100-r.succScale).toFixed(2)),this.prevCount=c.count)}}catch(l){o.e(l)}finally{o.f()}}e.push(r)}for(var u in e)e[u].conversionScale=(100*Number(e[u].count/e[0].count)).toFixed(2),e[u].washScale=(100-parseFloat(e[u].conversionScale)).toFixed(2),u!=Number(e.length)-1&&(e[u].succScale=e[Number(u)+1].succScale,e[u].lostScale=e[Number(u)+1].lostScale);return e},getMetaEventList:function(){var t=Object(o["a"])(Object(i["a"])().mark((function t(){var e,n,a,r,o,u;return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(c["c"])({appid:this.$store.state.baseData.EsConnectID});case 2:if(e=t.sent,0==e.code){t.next=6;break}return this.$message({type:"error",offset:60,message:e.msg}),t.abrupt("return");case 6:if(n=e.data.attributeMap,a={label:"事件",options:[]},n.hasOwnProperty("2")){r=Object(s["a"])(n["2"]);try{for(r.s();!(o=r.n()).done;)u=o.value,a.options.push({value:u.attribute_name,label:""==u.show_name?u.attribute_name:u.show_name})}catch(i){r.e(i)}finally{r.f()}}this.allAttrOptions=a;case 10:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getGroupByLable:function(t){var e,n=Object(s["a"])(this.allAttrOptions.options);try{for(n.s();!(e=n.n()).done;){var a=e.value;if(a.value==t)return a.label}}catch(r){n.e(r)}finally{n.f()}},go:function(){var t=Object(o["a"])(Object(i["a"])().mark((function t(){var e,n,a,r,o,u,l=this;return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.spinning=!0,this.funnelResShow=!1,e=this.form,e["appid"]=this.$store.state.baseData.EsConnectID,t.next=6,Object(c["b"])(e);case 6:if(n=t.sent,0==n.code){t.next=14;break}return this.$message({type:"error",offset:60,message:n.msg}),this.funnelRes=[],this.groupData=[],this.spinning=!1,this.$nextTick((function(){l.funnelResShow=!0})),t.abrupt("return");case 14:for(a in this.funnelRes=this.getWashData(n.data.groupData["总体"]),n.data.groupData)n.data.groupData[a]=this.getWashData(n.data.groupData[a]);this.groupData=n.data.groupData,this.tableHeader=[this.form.groupBy.length>0?this.getGroupByLable(this.form.groupBy[0]):"总体"],r=Object(s["a"])(this.funnelRes);try{for(r.s();!(o=r.n()).done;)u=o.value,this.tableHeader.push(u.showTitle)}catch(i){r.e(i)}finally{r.f()}this.spinning=!1,this.$nextTick((function(){l.funnelResShow=!0}));case 22:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}},f=h,p=(n("272a"),n("2877")),d=Object(p["a"])(f,a,r,!1,null,"15cd9f09",null);e["default"]=d.exports},"94b0":function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return l})),n.d(e,"h",(function(){return h})),n.d(e,"a",(function(){return f})),n.d(e,"k",(function(){return p})),n.d(e,"j",(function(){return d})),n.d(e,"i",(function(){return b}));var a=n("b775"),r="/api/analysis/";function s(t){return Object(a["a"])({url:r+"GetConfigs",method:"post",data:t})}function i(t){return Object(a["a"])({url:r+"LoadPropQuotas",method:"post",data:t})}function o(t){return Object(a["a"])({url:r+"GetValues",method:"post",data:t})}function c(t){return Object(a["a"])({url:r+"FunnelList",method:"post",data:t})}function u(t){return Object(a["a"])({url:r+"RetentionList",method:"post",data:t})}function l(t){return Object(a["a"])({url:r+"TraceList",method:"post",data:t})}function h(t){return Object(a["a"])({url:r+"UserAttrList",method:"post",data:t})}function f(t){return Object(a["a"])({url:r+"EventList",method:"post",data:t})}function p(t){return Object(a["a"])({url:r+"UserList",method:"post",data:t})}function d(t){return Object(a["a"])({url:r+"UserEventDetailList",method:"post",data:t})}function b(t){return Object(a["a"])({url:r+"UserEventCountList",method:"post",data:t})}},def7:function(t,e,n){}}]); |