12 |
- import{E as e,n as a,v as A,m as l}from"../element-plus/element-plus.DqqeXZzT.js";import{h as t,_ as s,f as n}from"../../assets/index-DYMYfyXS.js";import{r as i,Y as r,d as o,E as u,c as d,L as c,u as p,a as m,T as v,K as g,B as _,U as y,a9 as h,o as k,J as b,R as E,S as j,Q as w,O as Q,ba as f,b8 as x}from"../@vue/@vue.lccsL1Mu.js";import{A as U}from"../api/api.BtQEnbVN.js";import{_ as B}from"../Echarts/Echarts.D2RVNpV7.js";import"../lodash-es/lodash-es.LxYfApIs.js";import"../async-validator/async-validator.DSgsWN2H.js";import"../@vueuse/@vueuse.D2YafqsA.js";import"../dayjs/dayjs.D4rZQhfm.js";import"../axios/axios.CUN3se9v.js";import"../@ctrl/@ctrl.D2oWfImC.js";import"../@popperjs/@popperjs.D3lHDW-0.js";import"../escape-html/escape-html.J6B7JOz4.js";import"../normalize-wheel-es/normalize-wheel-es.Erkn7R64.js";import"../vue-router/vue-router.D86bYXwF.js";import"../pinia/pinia.DodrAXQg.js";import"../vue-demi/vue-demi.Dq6ymT-8.js";import"../pinia-plugin-persist/pinia-plugin-persist.Cjrd7Wf_.js";import"../@element-plus/@element-plus.BWbqilIf.js";import"../echarts/echarts.C_nC9ACL.js";import"../tslib/tslib.DduEQve-.js";import"../zrender/zrender.XYf_pgl8.js";const C=()=>{const a=i(!1),A=i("t_day"),l=r([{label:"今天",value:"t_day"},{label:"昨天",value:"l_day"},{label:"本周",value:"t_week"},{label:"上周",value:"l_week"},{label:"本月",value:"t_month"},{label:"上月",value:"l_month"},{label:"过去7天",value:"l_7day"},{label:"过去30天",value:"l_30day"}]),s=r({list:[{name:"消耗",key:"cost",unit:"元"},{name:"展示数",key:"view_count"},{name:"千次展示均价(CPM)",key:"thousand_display_price",unit:"元"},{name:"点击数",key:"valid_click_count"},{name:"点击率",key:"ctr"},{name:"转化数",key:"conversions_count"},{name:"转化成本",key:"conversions_cost",unit:"元"},{name:"转化率",key:"conversions_rate"},{name:"激活数",key:"activated_count"},{name:"激活率",key:"activated_rate"},{name:"激活成本",key:"activated_cost",unit:"元"},{name:"付费数",key:"app_checkout_count"},{name:"付费成本",key:"app_checkout_cost",unit:"元"},{name:"付费率",key:"app_checkout_rate"}]});return{getOverviewEvent:()=>{var l;a.value=!0,(l={time_type:A.value},new Promise((async(a,A)=>{const s=await t.get("/api/home/overview",l);0==s.errNo?a(s.rst):(e.error(s.errMsg),A())}))).then((e=>{a.value=!1,s.list.forEach((a=>{a.value=e[a.key].value,a.ring_rate=e[a.key].ring_rate,a.trend=e[a.key].trend}))})).catch((()=>{a.value=!1}))},overviewLoading:a,overviewData:s,time_type:A,timeTypeList:l}},T=({overviewList:a})=>{const A=i(!1),l=i("t_day"),s=i(),n=i(),o=i([]),u=r({option:{},heights:"320px",select_1_value:"cost",select_2_value:"conversions_count"}),d=()=>{let e=[],A={trend1_name:"",trend2_name:"",trend1:[],trend2:[],data:[]},l=[];o.value.forEach((a=>{e.push(a.time),A.trend1.push(a[u.select_1_value]),A.trend2.push(a[u.select_2_value])})),a.forEach((e=>{e.key==u.select_1_value&&(A.trend1_name=e.name+(e.unit?`(${e.unit})`:"")),e.key==u.select_2_value&&(A.trend2_name=e.name+(e.unit?`(${e.unit})`:""))})),A.data.push({name:A.trend1_name,type:"line",smooth:!0,itemStyle:{color:"#bfdaff"},data:A.trend1}),l.push({name:A.trend1_name,type:"value",splitNumber:4,nameTextStyle:{align:A.trend1_name.length>7?"center":"right"}}),"no"!=u.select_2_value&&(A.data.push({name:A.trend2_name,type:"line",smooth:!0,yAxisIndex:1,itemStyle:{color:"#f9b65d"},data:A.trend2}),l.push({name:A.trend2_name,type:"value",alignTicks:!0,splitNumber:4,nameTextStyle:{align:A.trend2_name.length>7?"center":"left"}})),u.option=((e,a,A)=>({tooltip:{trigger:"axis",position:function(e){return[e[0],"10%"]}},grid:{left:"7%",right:"7%"},xAxis:{type:"category",boundaryGap:!1,data:a,axisTick:{show:!1},axisLine:{show:!0,lineStyle:{color:"#cccccc"}},axisLabel:{color:"#666"}},yAxis:e,series:A}))(l,e,A.data)};return{getProjectTrend:()=>{var a;A.value=!0,(a={time_type:l.value},new Promise((async(A,l)=>{const s=await t.get("/api/home/dataTrend",a);0==s.errNo?A(s.rst):(e.error(s.errMsg),l())}))).then((e=>{o.value=e,d(),A.value=!1})).catch((()=>{A.value=!1}))},getProjecList:async()=>{let a=await t.get(U.project_list,{});a&&"0"==a.errNo?s.value=a.rst:e.error(a.errMsg)},getTrend:d,trendLoading:A,time_type_trend:l,projectList:s,project_id:n,trendInfo:u}},V=e=>(f("data-v-691cad9b"),e=e(),x(),e),I={class:"block-container"},S={class:"flex_between"},N=V((()=>m("div",{class:"title"},"广告数据概览",-1))),F={class:"overview-container"},R={class:"overview-item"},W={class:"overview-title"},L={key:0},z={class:"overview-data"},J={class:"overview-db"},M=E(" 环比 "),K={key:0,src:"data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAACSgAwAEAAAAAQAAACQAAAAA+INbXQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAQpJREFUWAntlbENwjAQRe9CCihYBCcNCzAIImQEFkF0tBQwAixAi6gAUTFESE0OG2HJQoj44oro0vhif389/5wcAHkkAUlAEpAEWp4AAUR3pealShemDj0uhhgYgFIlK+2RvX3W/cs516ZVU9/GQF9gLEMQVCOgHzDBUGwgD5ggKFYTMmAM1MT0l9ljCX1GlrgcpFNtahvYxz8rkyT3EVpNbAufEWPcVRXNkLBj9Ig0JIKxu1cnskTAm5kjpEcURVt3va5m95BrWAzSsYbauHNY4ah/Pe3dOU7N+mQc46ZaAapLThL6u4RY99Dn6fRtdNT/9QMg9F5rBAV04+unTt4lAUlAEpAE2pTAE8pWR8U+ByEjAAAAAElFTkSuQmCC",class:"icon",alt:""},O={key:1,src:"data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAACSgAwAEAAAAAQAAACQAAAAA+INbXQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAATJJREFUWAntlD1OAzEQhd84S8EFqCFpoAXRQEjSp6JESIiau0RQUfITihwjykbhFGwOABWiTTzYKyVWIuSV7WaRxs3anvHz8zerAWQIASEgBIRAvQlQir39ce9QNXgIwm6pw/ytwJcfnelXrG4We9CeU0qfAHQKXqkQlowjs4o2pFZSdfmKoapKCKF/RyioD7VmZ3u8yK6gqFG+lOkY4OuNVzMeoVCUe5qXlC1Gxfn750aOZxHUh1jv9E0TfHB9Z92A3BWEu3WcCKyzHxN8cgn+WdBPPW9PXpkx9Eu6qM2dt/MXt1M9CypZKcdQB3n32Tz+xidvhN+Ki8mtIap9eduxcENWocJUrBkrHWfIYyrFTJqhP0ylmrGS6cOUr5l3B828c29LmS4oCkJACAgBIVBvAr9gU1UNF2Ep6QAAAABJRU5ErkJggg==",class:"icon",alt:""},P={class:"block-container tMar15"},Y={class:"flex_between"},X=V((()=>m("div",{class:"title"},"项目分析",-1))),D={class:"flex"},G={class:"trendLegend"},H={class:"flex"},q=V((()=>m("div",{class:"icon"},null,-1))),Z={class:"flex"},$=V((()=>m("div",{class:"icon",style:{"background-color":"#f9b65d","margin-left":"20px"}},null,-1))),ee=s(o({__name:"index",setup(e){const{getOverviewEvent:t,overviewData:s,time_type:i,timeTypeList:r,overviewLoading:o}=C(),{getProjecList:f,getProjectTrend:x,getTrend:U,trendLoading:V,time_type_trend:ee,projectList:ae,project_id:Ae,trendInfo:le}=T({overviewList:s.list});return u((()=>{t(),x(),f()})),(e,u)=>{const f=l,C=a,T=A;return k(),d(y,null,[c((k(),d("div",I,[m("div",S,[N,m("div",null,[v(C,{modelValue:p(i),"onUpdate:modelValue":u[0]||(u[0]=e=>_(i)?i.value=e:null),placeholder:"请选择",style:{width:"140px"},onChange:u[1]||(u[1]=e=>p(t)())},{default:g((()=>[(k(!0),d(y,null,h(p(r),(e=>(k(),b(f,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])]),m("div",F,[(k(!0),d(y,null,h(p(s).list,(e=>(k(),d("div",R,[m("div",W,[E(j(e.name),1),e.unit?(k(),d("span",L,"("+j(e.unit)+")",1)):w("",!0)]),m("div",z,j(e.value?p(n)(e.value):"-"),1),m("div",J,[M,m("div",{class:Q(["db lMar3 flex","rise"==e.trend?"c-red":"drop"==e.trend?"c-green":""])},["rise"==e.trend?(k(),d("img",K)):w("",!0),"drop"==e.trend?(k(),d("img",O)):w("",!0),E(" "+j(e.ring_rate?e.ring_rate:"-"),1)],2)])])))),256))])])),[[T,p(o)]]),c((k(),d("div",P,[m("div",Y,[X,m("div",D,[v(C,{modelValue:p(Ae),"onUpdate:modelValue":u[2]||(u[2]=e=>_(Ae)?Ae.value=e:null),placeholder:"全部项目",clearable:"",style:{width:"160px"},onChange:u[3]||(u[3]=e=>p(x)()),class:"rMar5"},{default:g((()=>[(k(!0),d(y,null,h(p(ae),(e=>(k(),b(f,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"]),v(C,{modelValue:p(ee),"onUpdate:modelValue":u[4]||(u[4]=e=>_(ee)?ee.value=e:null),placeholder:"请选择",style:{width:"140px"},onChange:u[5]||(u[5]=e=>p(x)())},{default:g((()=>[(k(!0),d(y,null,h(p(r),(e=>(k(),b(f,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])]),m("div",G,[m("div",H,[q,v(C,{modelValue:p(le).select_1_value,"onUpdate:modelValue":u[6]||(u[6]=e=>p(le).select_1_value=e),size:"small",placeholder:"请选择",style:{width:"140px"},onChange:u[7]||(u[7]=e=>p(U)())},{default:g((()=>[(k(!0),d(y,null,h(p(s).list,(e=>(k(),b(f,{key:e.key,label:e.name,value:e.key},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])]),m("div",Z,[$,v(C,{modelValue:p(le).select_2_value,"onUpdate:modelValue":u[8]||(u[8]=e=>p(le).select_2_value=e),size:"small",placeholder:"请选择",style:{width:"140px"},onChange:u[9]||(u[9]=e=>p(U)())},{default:g((()=>[(k(!0),d(y,null,h([{name:"无",key:"no"}].concat(p(s).list),(e=>(k(),b(f,{key:e.key,label:e.name,value:e.key},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])]),v(B,{options:p(le).option,height:p(le).heights},null,8,["options","height"])])),[[T,p(V)]])],64)}}}),[["__scopeId","data-v-691cad9b"]]);export{ee as default};
|