直播数据中心

25.e2cca502f6143183df0e.js 18KB

1
  1. webpackJsonp([25],{byoe:function(t,e){},ddPm:function(t,e){},puQZ:function(t,e){},stvC:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("woOf"),n=i.n(s),a=i("AQry"),o={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"host-dialog"},[i("el-dialog",{attrs:{visible:t.$parent.hostContrastShow},on:{"update:visible":function(e){return t.$set(t.$parent,"hostContrastShow",e)}}},[i("div",{staticClass:"operation_container",attrs:{slot:"title"},slot:"title"},[i("div",{staticClass:"flex"},[i("div",{staticClass:"commonInfoName",staticStyle:{"font-size":"24px"}},[t._v("主播数据对比")])])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"con-dialog"},[i("div",{staticClass:"flex-between posTop"},[i("div",{staticClass:"wid120"},[t._v("主播")]),t._v(" "),t._l(t.infoList,function(e,s){return i("div",{key:e.staff_id,staticClass:"staffDiv",style:{backgroundColor:t.$store.state.anchor_color_list[s]}},[t._v("\n "+t._s(e.staff_name)+"\n ")])})],2),t._v(" "),t._l(t.indicators,function(e,s){return i("div",{key:s},[i("div",{staticClass:"small_title"},[t._v("\n "+t._s("traffic"==s?"流量运营指标":"orderChange"==s?"成单转化指标":"hostExamine"==s?"主播考核":"putChange"==s?"投放转化消耗":"chargeback"==s?"退款数据":"")+"对比\n ")]),t._v(" "),t._l(e,function(e,s){return i("div",{key:s,staticClass:"item_con"},[i("div",{staticClass:"wid120"},[t._v("\n "+t._s(e.name)+"\n "),i("el-tooltip",{staticClass:"disinblock",attrs:{effect:"light",content:"退单率=退单数/订单总数",placement:"top"}},["退单率"==e.name?i("i",{staticClass:"el-icon-question"}):t._e()])],1),t._v(" "),t._l(t.infoList,function(s){return i("div",{key:s.staff_id,staticClass:"wid120 text-center",style:{color:s[e.field]==t.max_vals[e.field]&&s[e.field]?"#F59A24":""}},[t._v("\n "+t._s(s[e.field])),"order_back_rate"==e.field?i("span",[t._v("%")]):t._e()])})],2)})],2)})],2),t._v(" "),i("div",{staticClass:"text-center",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"small"},on:{click:function(e){t.$parent.hostContrastShow=!1}}},[t._v("关闭")]),t._v(" "),i("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.exportEvent}},[t._v("导出")])],1)])],1)},staticRenderFns:[]};var r={name:"hostLibrary",components:{hostContrast:i("VU/8")({name:"hostContrast",props:["hostIds","start_time","end_time"],data:function(){return{loading:!1,dialogTableVisible:!0,infoList:[],max_vals:{},indicators:{traffic:[{name:"直播时长",field:"live_duration"},{name:"观看人数",field:"total_user_count"},{name:"互动率",field:"interact_rate"},{name:"UV价值",field:"uv"},{name:"新增粉丝数",field:"fan_add"},{name:"转粉率",field:"fan_rate"},{name:"评论数",field:"comment_count"}],orderChange:[{name:"成交订单数",field:"order_count"},{name:"成交人数",field:"order_ucount"},{name:"销售额",field:"sell_money"},{name:"成交转化率",field:"view_order_rate"},{name:"客单价",field:"uprice"}],hostExamine:[{name:"小时成交额",field:"hour_sell_money"},{name:"关联直播",field:"live_count"},{name:"上播次数",field:"on_live_count"}],putChange:[{name:"投放消耗",field:"qc_cost"},{name:"投放销售额",field:"qc_sell_money"},{name:"投放订单数",field:"qc_order_count"},{name:"付费ROI",field:"roi"}],chargeback:[{name:"退款单数",field:"order_back"},{name:"退款金额",field:"refund_money"},{name:"退单率",field:"order_back_rate"}]}}},created:function(){this.init(1)},methods:{init:function(t){var e=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.liveEffectV2,{params:{start_date:this.start_time,end_date:this.end_time,page:t,page_size:10,if_pk:1,staff_list:this.hostIds}}).then(function(t){e.loading=!1,(t=t.data)&&0==t.errno?(e.infoList=t.rst.data.list,e.max_vals=t.rst.data.max_vals):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(){e.loading=!1})},exportEvent:function(){var t=this;if(0==this.infoList.length)return this.$message({message:"数据为空,不能导出!",type:"success"}),!1;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.liveEffectV2,{params:{start_date:this.start_time,end_date:this.end_time,page:1,page_size:10,if_pk:1,staff_list:this.hostIds}}).then(function(e){var i,s,n=[];(e=e.data)&&0==e.errno?(s="主播,直播时长,观看人数,互动率,UV价值,新增粉丝数,转粉率,评论数,成交订单数,成交人数,销售额,成交转化率,客单价,小时成交额,关联直播,上播次数,金牛消耗,金牛销售额,金牛订单数,付费ROI,退款单数,退款金额,退单率\n",i="主播数据对比",e.rst.data.list.forEach(function(t){n.push({staff_name:t.staff_name,live_duration:t.live_duration,total_user_count:t.total_user_count,interact_rate:t.interact_rate,uv:t.uv,fan_add:t.fan_add,fan_rate:t.fan_rate,comment_count:t.comment_count,order_count:t.order_count,order_ucount:t.order_ucount,sell_money:t.sell_money,view_order_rate:t.view_order_rate,uprice:t.uprice,hour_sell_money:t.hour_sell_money,live_count:t.live_count,on_live_count:t.on_live_count,qc_cost:t.qc_cost,qc_sell_money:t.qc_sell_money,qc_order_count:t.qc_order_count,roi:t.roi,order_back:t.order_back,refund_money:t.refund_money,order_back_rate:t.order_back_rate})}),t.$exportToExcel({th_arr:s,jsonData:n,name:i}).then(function(){t.loading=!1})):(t.loading=!1,t.$message({message:e.err,type:"warning"}))}).catch(function(e){t.loading=!1})}}},o,!1,function(t){i("ddPm"),i("puQZ")},"data-v-4de0972f",null).exports,selfDialog:a.a},data:function(){return{hostContrastShow:!1,btnLoading:!1,timeList:[{id:1,name:"昨日",start_time:this.$getDay(-1,!1),end_time:this.$getDay(-1,!1)},{id:7,name:"近7日",start_time:this.$getDay(-7,!1),end_time:this.$getDay(0,!1)},{id:30,name:"近30日",start_time:this.$getDay(-30,!1),end_time:this.$getDay(0,!1)}],time:[this.$getDay(-30,!1),this.$getDay(0,!1)],pickerTimes:{disabledDate:function(t){return t>Date.now()}},start_time:this.$getDay(-30,!1),end_time:this.$getDay(0,!1),key_word:"",infoList:[],sort_type:"sell_money",total:0,page:1,pages:1,page_size:20,loading:!1,renyuan_list:[],renyuan_val:"",renyuan_val_id:"",userInfo:{},tableKey:1,hostSelect:[],hostIds:[],partName:"hostLibrary",infoList_title:[],PKbox_show:!0,PKbox_circle_show:!1}},watch:{PKbox_circle_show:function(){return!!(this.hostSelect&&this.hostSelect.length>0)}},beforeUpdate:function(){var t=this;this.$nextTick(function(){t.$refs.tableref.doLayout()})},created:function(){this.userInfo=JSON.parse(this.$localSelfStore.getLocal("userInfo")),this.renyuan_val_id=this.userInfo.id,this.init_title(1,"sort"),this.init_renyuan()},methods:{goDetial:function(t){var e=1==t.plat_type?"/accountDetial/":"/accountDetialDou/",i=this.$router.resolve({path:e+t.seller_id});window.open(i.href,"_blank")},cleardata:function(){this.hostSelect=[],this.hostIds=[]},init:function(t){var e=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.host_Library,{params:{start_date:this.start_time,end_date:this.end_time,staff_id:0==this.userInfo.user_control?this.renyuan_val_id:this.renyuan_val,staff_role:1,sort_field:this.sort_type,page:t,page_size:this.page_size}}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?(e.infoList=t.rst.data.list,e.total=t.rst.pageInfo.total,e.pages=t.rst.pageInfo.pages,e.page=t.rst.pageInfo.page,e.tableKey+=1):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})},init_title:function(t,e){var i=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.search_config_checked,{params:{type:"LIVE_ANCHOR_LIST"}}).then(function(s){if((s=s.data)&&0==s.errno){if(i.infoList_title=s.rst,e){var n=!1;i.infoList_title.forEach(function(t){"sell_money"==t.key&&(n=!0)}),i.sort_type=n?"sell_money":i.infoList_title[0].key}i.init(t||1)}else 4002!=s.errno&&i.$message({message:s.err,type:"warning"})})},showContrast:function(){if(this.hostSelect.length<2)return this.$message({message:"PK需要最少2个主播",type:"info"}),!1;this.hostContrastShow=!0},deleHost:function(t){var e=this;this.hostSelect.forEach(function(i,s){t==i.id&&e.hostSelect.splice(s,1)}),this.hostIds.forEach(function(i,s){t==i&&e.hostIds.splice(s,1)})},goPk:function(t){return this.hostIds.indexOf(t.staff_id)>-1?(this.$message({message:"该主播已在PK列表",type:"info"}),!1):5==this.hostSelect.length?(this.$message({message:"最多添加5个主播",type:"info"}),!1):(this.hostIds.push(t.staff_id),void this.hostSelect.push({name:t.staff_name,id:t.staff_id}))},selfClick:function(){this.$refs.dialogChild.dialogFormVisible=!0,this.$refs.dialogChild.init("user")},gohostDetial:function(t){var e=this.$router.resolve({path:"/hostDetial/"+t.staff_id});window.open(e.href,"_blank")},sortEvent:function(t){if(this.infoList==[]||0==this.infoList.length)return this.$message({message:"暂无数据",type:"info"}),!1;this.sort_type=t,this.init_title(1)},changeInit:function(t){this.start_time=t.start_time,this.end_time=t.end_time,this.init_title(1),this.time=[t.start_time,t.end_time],this.cleardata()},timeChange:function(t){t&&0!=t.length&&(this.start_time=t[0],this.end_time=t[1],this.init_title(1),this.cleardata())},init_renyuan:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.userListForFilter,{params:{position_id:1}}).then(function(e){(e=e.data)&&0==e.errno?t.renyuan_list=e.rst:4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.$message({message:e,type:"warning"})})},handleCurrentChange:function(t){this.init_title(t)},exportEvent:function(){var t=this;if(0==this.infoList.length)return this.$message({message:"数据为空,不能导出!",type:"success"}),!1;this.btnLoading=!0,this.$axios.get(this.URL.BASEURL+this.URL.host_Library,{params:{start_date:this.start_time,end_date:this.end_time,staff_id:0==this.userInfo.user_control?this.renyuan_val_id:this.renyuan_val,staff_role:1,sort_field:this.sort_type,page:1,page_size:500}}).then(function(e){var i,s,a=[],o="";(e=e.data)&&0==e.errno?(t.infoList_title.forEach(function(t){o+=","+t.name}),s="主播,关联账号"+o+"\n",i="主播排行榜",e.rst.data.list.forEach(function(e,i){var s="";e.seller_info.forEach(function(t,i){var n=i==e.seller_info.length-1?" ":" | ";s=s+t.seller_name+n});var o={staff_name:e.staff_name,seller_info:s},r={},l={};t.infoList_title.forEach(function(t){r[t.key]=e[t.key]?e[t.key]:0,l=n()(o,r)}),a.push(l)}),t.$exportToExcel({th_arr:s,jsonData:a,name:i}).then(function(){t.btnLoading=!1})):(t.btnLoading=!1,t.$message({message:e.err,type:"warning"}))}).catch(function(e){t.btnLoading=!1})}}},l={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"situationPage"},[s("div",{staticClass:"operation_container"},[s("div",{staticClass:"flex"},[s("div",{staticClass:"commonInfoName"},[t._v("时间筛选")]),t._v(" "),s("ul",{staticClass:"commonTimeList flex"},[t._l(t.timeList,function(e,i){return s("li",{key:"time"+i,class:t.start_time==e.start_time&&t.end_time==e.end_time?"active":"",on:{click:function(i){return t.changeInit(e)}}},[t._v(t._s(e.name))])}),t._v(" "),s("li",{staticClass:"commonTime_container"},[t._v("\n "+t._s(t.time&&0!=t.time.length?t.time[0]+"  ~  "+t.time[1]:"开始时间  -  结束时间")+"\n "),s("i",{staticClass:"iconfont icon-rili_icon"}),t._v(" "),s("el-date-picker",{staticClass:"commonTime_picker",attrs:{size:"small",clearable:!1,"value-format":"yyyy-MM-dd",type:"daterange","picker-options":t.pickerTimes,"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.timeChange},model:{value:t.time,callback:function(e){t.time=e},expression:"time"}})],1)],2),t._v(" "),0!=t.userInfo.user_control?s("div",{staticClass:"flex"},[s("div",{staticClass:"commonInfoName",staticStyle:{"margin-left":"20px"}},[t._v("人员筛选")]),t._v(" "),s("el-select",{staticClass:"self_list_input__inner",staticStyle:{width:"140px"},attrs:{size:"small",filterable:"",clearable:"",placeholder:"人员筛选"},on:{change:function(e){t.init_title(1),t.cleardata()}},model:{value:t.renyuan_val,callback:function(e){t.renyuan_val=e},expression:"renyuan_val"}},t._l(t.renyuan_list,function(t,e){return s("el-option",{key:t.id,attrs:{label:t.real_name,value:t.id}})}),1)],1):t._e(),t._v(" "),s("div",{staticClass:"lMarauto"},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.btnLoading,expression:"btnLoading"}],staticClass:"selfBtn_detial rMar10",on:{click:t.exportEvent}},[t._v("\n 导出\n ")]),t._v(" "),s("div",{staticClass:"selfBtn_detial",on:{click:t.selfClick}},[t._v("自定义指标")])])])]),t._v(" "),s("div",{staticStyle:{"margin-right":"10px"}},[s("el-table",{key:"customTable"+t.tableKey,ref:"tableref",attrs:{data:t.infoList,height:"calc(100vh - 200px)"}},[s("el-table-column",{attrs:{fixed:"","min-width":"60","cell-class-name":"zhibo",prop:"start_time"},scopedSlots:t._u([{key:"header",fn:function(e){return[t._v("\n 排名\n ")]}},{key:"default",fn:function(e){return[s("div",[(t.page-1)*t.page_size+e.$index+1==1?s("img",{attrs:{src:i("UMSe"),width:"40px"}}):(t.page-1)*t.page_size+e.$index+1==2?s("img",{attrs:{src:i("P+ka"),width:"40px"}}):(t.page-1)*t.page_size+e.$index+1==3?s("img",{attrs:{src:i("60PX"),width:"40px"}}):s("span",{staticStyle:{display:"inline-block",width:"35px","text-align":"center"}},[t._v(t._s((t.page-1)*t.page_size+e.$index+1))])])]}}])}),t._v(" "),s("el-table-column",{attrs:{"min-width":"100","class-name":"self-column",prop:"live_duration",fixed:""},scopedSlots:t._u([{key:"header",fn:function(e){return[t._v("\n 主播\n ")]}},{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.staff_name?e.row.staff_name:"-")+"\n ")]}}])}),t._v(" "),s("el-table-column",{attrs:{"min-width":"200","class-name":"self-column ",fixed:""},scopedSlots:t._u([{key:"header",fn:function(e){return[t._v("\n 关联账号\n ")]}},{key:"default",fn:function(e){return t._l(e.row.seller_info,function(e,i){return s("div",{key:e.seller_id,staticClass:"usrBox flex",class:0==i?"":"tMar10",on:{click:function(i){return i.stopPropagation(),t.goDetial(e)}}},[s("img",{staticClass:"userImg",attrs:{src:e.head_url,alt:""}}),t._v(" "),s("el-tooltip",{attrs:{effect:"light",disabled:!(e.seller_name.length>9),content:e.seller_name,placement:"top"}},[s("div",{staticClass:"liveName clampOne"},[t._v(t._s(e.seller_name?e.seller_name:"-"))])])],1)})}}])}),t._v(" "),t._l(t.infoList_title,function(e,i){return s("el-table-column",{key:Math.random(),attrs:{"min-width":"120",prop:e.key,"class-name":"self-column"},scopedSlots:t._u([{key:"header",fn:function(i){return[s("div",{class:["common_select_td",t.sort_type==e.key?"common_selected_down":""],on:{click:function(i){1==e.support_sort&&t.sortEvent(e.key)}}},[s("span",{style:e.name.length>=6&&1==e.support_sort?"font-size:12px":"font-size:14px"},[t._v(t._s(e.name))]),t._v(" "),"roi"==e.key?s("span",[s("el-tooltip",{staticClass:"disinblock",attrs:{effect:"light",content:"投放ROI=投放产生的销售额/ 投放金额",placement:"top"}},[s("i",{staticClass:"el-icon-question"})])],1):t._e(),t._v(" "),1==e.support_sort?s("i",{staticClass:"el-icon-caret-bottom"}):t._e()])]}},{key:"default",fn:function(i){return t._l(Object.keys(i.row),function(n){return s("span",{class:t.sort_type==n?"common_selected":""},[n==e.key?s("span",[t._v("\n "+t._s(t.$NumberHandle(i.row[n]))),"率"==e.name.charAt(e.name.length-1)?s("span",[t._v("%")]):t._e()]):t._e()])})}}],null,!0)})}),t._v(" "),s("el-table-column",{attrs:{"class-name":"self-column",fixed:"right","min-width":"120",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("div",{staticClass:"opa-column"},[s("span",{staticClass:"opaBtn",class:t.hostIds.indexOf(e.row.staff_id)>-1?"bcg_dis":"",on:{click:function(i){return i.stopPropagation(),t.goPk(e.row)}}},[t._v("PK")]),t._v(" "),s("span",{staticClass:"opaBtn",on:{click:function(i){return i.stopPropagation(),t.gohostDetial(e.row)}}},[t._v("详情")])])]}}])})],2),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"bottom"},[s("el-pagination",{attrs:{background:"","current-page":Number(t.page),layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1)],1),t._v(" "),t.PKbox_circle_show?s("div",{staticClass:"PKbox_circle",on:{click:function(e){t.PKbox_show=!0,t.PKbox_circle_show=!1}}},[s("div",[t._v("主播PK")]),t._v(" "),s("div",{staticClass:"tMar10 text-center"},t._l(t.hostSelect,function(e,i){return s("span",{key:e.id,staticClass:"idx_circle",style:{marginLeft:0==i?"0px":""}},[t._v(t._s(i+1))])}),0)]):t._e(),t._v(" "),s("transition",{attrs:{name:"bounce"}},[t.hostSelect&&t.hostSelect.length>0&&t.PKbox_show?s("div",{staticClass:"PKbox"},[s("span",{staticClass:"packUp",on:{click:function(e){t.PKbox_show=!1,t.PKbox_circle_show=!0}}},[t._v("收起")]),t._v(" "),s("div",{staticClass:"title"},[t._v("\n 主播PK\n ")]),t._v(" "),s("div",{staticClass:"con"},t._l(t.hostSelect,function(e,i){return s("div",{key:e.id,staticClass:"host_div"},[s("span",{staticClass:"idx_css"},[t._v("\n "+t._s(i+1)+"\n ")]),t._v(" "),s("span",[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),s("i",{staticClass:"el-icon-error",on:{click:function(i){return t.deleHost(e.id)}}})])}),0),t._v(" "),s("div",{staticClass:"btn",on:{click:t.showContrast}},[t._v("\n PK\n ")])]):t._e()]),t._v(" "),t.hostContrastShow?s("hostContrast",{attrs:{hostIds:t.hostIds,start_time:t.start_time,end_time:t.end_time}}):t._e(),t._v(" "),s("selfDialog",{ref:"dialogChild",attrs:{propData:t.partName}})],1)},staticRenderFns:[]};var c=i("VU/8")(r,l,!1,function(t){i("byoe"),i("wD3m")},"data-v-032cf9b6",null);e.default=c.exports},wD3m:function(t,e){}});