1 |
- import{i as h}from"./echarts.72dc8373.js";import{r as Z,a as ue,u as de,B as me}from"./index.b098562c.js";import{d as pe,r as n,ay as G,j as H,w as fe,Z as ye,A as ge,ai as d,aq as he,o as r,c as S,a as t,U as s,u as xe,D as _e,O as a,F as M,a8 as J,P as f,M as m,I as R,T as C,J as w,n as be}from"./vue.adf17aba.js";import{createCrudOptions as ve}from"./crud.eb777817.js";import"./elementPlus.4833989a.js";import{_ as Se}from"./index.vue_vue_type_script_setup_true_lang.945033c4.js";import{_ as Ce}from"./_plugin-vue_export-helper.c27b6911.js";import"./api.7415b519.js";import"./commonTabColumn.c5d53eee.js";const K="/api/ad_manage/summary/report/";function we(x){return Z({url:K+"total",method:"GET",params:x})}function Oe(x){return Z({url:K+"trend/daily",method:"GET",params:x})}const Te={class:"container-main"},Ae={class:"overview-tabs"},Pe={class:"home-container",style:{"margin-top":"0"}},ke={class:"home-card-item flex"},Ie={class:"flex-auto",style:{"margin-top":"-10px"}},De={class:"mt10"},Ne={class:"font30"},Le={style:{display:"inline-block","margin-right":"10px","margin-left":"3px"}},Re=pe({__name:"index",setup(x){const i=n(!0),O=n(!0),Q=ue(),{dateRange:c}=G(Q),W=de(),{profile:X}=G(W);n("Campaigns");const _=n({profileId:X.value.profile_id,dateRange:c});me({createCrudOptions:ve,context:_});const B=n("SP"),Y=[{value:"SP/SB/SD",label:"SP/SB/SD"},{value:"SP",label:"SP"},{value:"SB",label:"SB"},{value:"SD",label:"SD"},{value:"DSP",label:"DSP",disabled:!0}];async function z(){try{O.value=!0;const e=await we({startDate:c.value[0],endDate:c.value[1],profileId:_.value.profileId});l.homeOne[0].num1=e.data.Spend,l.homeOne[0].compareNum=e.data.prevSpend,l.homeOne[0].num2=e.data.gapSpend,l.homeOne[1].num1=e.data.TotalSales,l.homeOne[1].compareNum=e.data.prevTotalSales,l.homeOne[1].num2=e.data.gapTotalSales,l.homeOne[2].num1=e.data.TotalPurchases,l.homeOne[2].compareNum=e.data.prevTotalPurchases,l.homeOne[2].num2=e.data.gapTotalPurchases,l.homeOne[3].num1=e.data.ACOS,l.homeOne[3].compareNum=e.data.prevACOS,l.homeOne[3].num2=e.data.gapACOS}catch(e){console.log("获取数据失败:",e)}finally{O.value=!1}}let V;async function j(){try{i.value=!0;const e=await Oe({startDate:c.value[0],endDate:c.value[1],profileId:_.value.profileId});return V=e.data,await re(),e.data}catch(e){console.log("获取数据失败:",e)}finally{i.value=!1}}H(()=>{z(),j()}),fe(_,async()=>{try{i.value=!0,await F(),await z(),await j(),i.value=!1}catch(e){console.log(e)}},{deep:!0});const l=ye({homeOne:[{num1:"",compareNum:"",num2:"",cardTitle:"花费",num4:"fa fa-meetup",color2:"--next-color-primary-lighter",color3:"--el-color-primary"},{num1:"",compareNum:"",num2:"",cardTitle:"销售额",num4:"iconfont icon-ditu",color2:"--next-color-success-lighter",color3:"--el-color-success"},{num1:"",compareNum:"",num2:"",cardTitle:"订单数",num4:"iconfont icon-zaosheng",color2:"--next-color-warning-lighter",color3:"--el-color-warning"},{num1:"",compareNum:"",num2:"",cardTitle:"ACOS",num4:"fa fa-github-alt",color2:"--next-color-danger-lighter",color3:"--el-color-danger"}],myCharts:[],charts:{theme:"",bgColor:"",color:"#303133"}}),T=n();let b;const ee={title:{text:"花费 & 销售额"},dataset:{source:[]},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985"}}},legend:{selected:{},data:["花费","销售额"],show:!0},grid:{top:50,right:65,bottom:30,left:65},xAxis:{type:"category"},yAxis:[{type:"value",axisLine:{show:!0,lineStyle:{color:"#3a83f7"}}},{type:"value",splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:"#f19a37"}}}],series:[{name:"花费",yAxisIndex:0,encode:{x:"Name",y:"Spend"},type:"line",smooth:!0,itemStyle:{color:"#3a83f7"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(58, 131, 247, 0.5)"},{offset:.2,color:"rgba(58, 131, 247, 0.2)"},{offset:1,color:"rgba(58, 131, 247, 0)"}],global:!1}}},{name:"销售额",yAxisIndex:1,encode:{x:"Name",y:"TotalSales"},type:"line",smooth:!0,lineStyle:{type:"dashed"},itemStyle:{color:"#f19a37"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(241, 154, 55, 0.5)"},{offset:.2,color:"rgba(241, 154, 55, 0.2)"},{offset:1,color:"rgba(241, 154, 55, 0)"}],global:!1}}}]},E=n();let A;const oe={title:{text:"ACOS"},dataset:{source:[]},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985"}}},legend:{selected:{},data:["ACOS"],show:!0},grid:{top:50,right:65,bottom:30,left:65},xAxis:{type:"category"},yAxis:[{type:"value",axisLine:{show:!0,lineStyle:{color:"#3a83f7"}}}],series:[{name:"ACOS",yAxisIndex:0,encode:{x:"Name",y:"ACOS"},type:"line",smooth:!0,lineStyle:{type:"dashed"},legendHoverLink:!1,itemStyle:{color:"#3a83f7"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(58, 131, 247, 0.5)"},{offset:.2,color:"rgba(58, 131, 247, 0.2)"},{offset:1,color:"rgba(58, 131, 247, 0)"}],global:!1}}}]},U=n();let P;const te={title:{text:"点击成本 & 点击率"},dataset:{source:[]},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985"}}},legend:{selected:{},data:["点击成本","点击率"],show:!0},grid:{top:50,right:65,bottom:30,left:65},xAxis:{type:"category"},yAxis:[{type:"value",axisLine:{show:!0,lineStyle:{color:"#3a83f7"}}},{type:"value",splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:"#f19a37"}}}],series:[{name:"点击成本",yAxisIndex:0,encode:{x:"Name",y:"CPC"},type:"line",smooth:!0,itemStyle:{color:"#3a83f7"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(58, 131, 247, 0.5)"},{offset:.2,color:"rgba(58, 131, 247, 0.2)"},{offset:1,color:"rgba(58, 131, 247, 0)"}],global:!1}}},{name:"点击率",yAxisIndex:1,encode:{x:"Name",y:"CTR"},type:"line",smooth:!0,itemStyle:{color:"#f19a37"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(241, 154, 55, 0.5)"},{offset:.2,color:"rgba(241, 154, 55, 0.2)"},{offset:1,color:"rgba(241, 154, 55, 0)"}],global:!1}}}]},$=n();let k;const ae={title:{text:"订单数"},dataset:{source:[]},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985"}}},legend:{selected:{},data:["订单数"],show:!0},grid:{top:50,right:65,bottom:30,left:65},xAxis:{type:"category"},yAxis:[{type:"value",axisLine:{show:!0,lineStyle:{color:"#3a83f7"}}}],series:[{name:"订单数",yAxisIndex:0,encode:{x:"Name",y:"TotalPurchases"},type:"line",smooth:!0,lineStyle:{type:"dashed"},legendHoverLink:!1,itemStyle:{color:"#3a83f7"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(58, 131, 247, 0.5)"},{offset:.2,color:"rgba(58, 131, 247, 0.2)"},{offset:1,color:"rgba(58, 131, 247, 0)"}],global:!1}}}]},q=n();let I;const le={title:{text:"曝光量 & 点击量"},dataset:{source:[]},tooltip:{trigger:"axis",axisPointer:{label:{backgroundColor:"#6a7985"}}},legend:{selected:{},data:["曝光量","点击量"],show:!0},grid:{top:50,right:65,bottom:30,left:65},xAxis:{type:"category"},yAxis:[{type:"value",axisLine:{show:!0,lineStyle:{color:"#3a83f7"}}},{type:"value",splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:"#f19a37"}}}],series:[{name:"曝光量",yAxisIndex:0,encode:{x:"Name",y:"Impression"},type:"line",smooth:!0,itemStyle:{color:"#3a83f7"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(58, 131, 247, 0.5)"},{offset:.2,color:"rgba(58, 131, 247, 0.2)"},{offset:1,color:"rgba(58, 131, 247, 0)"}],global:!1}}},{name:"点击量",yAxisIndex:1,encode:{x:"Name",y:"Click"},type:"line",smooth:!0,itemStyle:{color:"#f19a37"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(241, 154, 55, 0.5)"},{offset:.2,color:"rgba(241, 154, 55, 0.2)"},{offset:1,color:"rgba(241, 154, 55, 0)"}],global:!1}}}]};function F(){T.value&&(b=h(T.value),A=h(E.value),P=h(U.value),k=h($.value),I=h(q.value))}function re(){be(()=>{[{chart:b,option:ee},{chart:A,option:oe},{chart:P,option:te},{chart:k,option:ae},{chart:I,option:le}].forEach(u=>{try{u.option.dataset.source=V,u.chart.setOption(u.option)}catch(N){console.error("设置图表选项失败:",N)}})})}function D(){b&&(b.resize(),A.resize(),P.resize(),k.resize(),I.resize())}return H(async()=>{F(),window.addEventListener("resize",D),setTimeout(()=>{D()},10)}),ge(()=>{window.removeEventListener("resize",D)}),(e,u)=>{const N=d("el-option"),se=d("el-select"),ne=d("Bottom"),ie=d("Top"),ce=d("el-icon"),y=d("el-col"),L=d("el-row"),g=d("el-card"),p=he("loading");return r(),S("div",null,[t("div",Te,[t("div",Ae,[s(Se,{modelValue:xe(c),"onUpdate:modelValue":u[0]||(u[0]=o=>_e(c)?c.value=o:null)},null,8,["modelValue"]),s(se,{modelValue:B.value,"onUpdate:modelValue":u[1]||(u[1]=o=>B.value=o),placeholder:"SP",style:{width:"200px"},"collapse-tags":"","collapse-tags-tooltip":"","max-collapse-tags":3},{default:a(()=>[(r(),S(M,null,J(Y,o=>s(N,{key:o.value,label:o.label,value:o.value,disabled:o.disabled},null,8,["label","value","disabled"])),64))]),_:1},8,["modelValue"])]),f((r(),S("div",Pe,[s(L,{gutter:15,class:"home-card-one mb15"},{default:a(()=>[(r(!0),S(M,null,J(l.homeOne,(o,v)=>(r(),m(y,{xs:24,sm:12,md:12,lg:6,xl:6,key:v,class:R({"home-media home-media-lg":v>1,"home-media-sm":v===1})},{default:a(()=>[t("div",ke,[t("div",{class:R(["flex-margin flex w100",` home-one-animation${v}`])},[t("div",Ie,[t("div",De,C(o.cardTitle),1),t("div",Ne,C(o.num1),1),t("div",Le,C(o.compareNum),1),s(ce,{style:w([{color:String(o.num2).includes("-")?"#59b939":"#e36f53"},{display:"inline-block","padding-top":"2px"}])},{default:a(()=>[String(o.num2).includes("-")?(r(),m(ne,{key:0})):(r(),m(ie,{key:1}))]),_:2},1032,["style"]),t("span",{class:"l-indent",style:w({color:String(o.num2).includes("-")?"#59b939":"#e36f53"})},C(o.num2)+"%",5)]),t("div",{class:"home-card-item-icon flex",style:w({background:`var(${o.color2})`})},[t("i",{class:R(["flex-margin font32",o.num4]),style:w({color:`var(${o.color3})`})},null,6)],4)],2)])]),_:2},1032,["class"]))),128))]),_:1})])),[[p,O.value]]),f((r(),m(g,{style:{"margin-top":"-5px"}},{default:a(()=>[t("div",{style:{height:"350px"},ref_key:"chartRefOne",ref:T},null,512)]),_:1})),[[p,i.value]]),s(L,{gutter:5,style:{"margin-top":"10px"}},{default:a(()=>[s(y,{span:12},{default:a(()=>[f((r(),m(g,null,{default:a(()=>[t("div",{style:{height:"350px"},ref_key:"chartRefAcos",ref:E},null,512)]),_:1})),[[p,i.value]])]),_:1}),s(y,{span:12},{default:a(()=>[f((r(),m(g,null,{default:a(()=>[t("div",{style:{height:"350px"},ref_key:"chartRefCPCandCTR",ref:U},null,512)]),_:1})),[[p,i.value]])]),_:1})]),_:1}),s(L,{gutter:5,style:{"margin-top":"10px"}},{default:a(()=>[s(y,{span:12},{default:a(()=>[f((r(),m(g,null,{default:a(()=>[t("div",{style:{height:"350px"},ref_key:"chartRefTotalPurchases",ref:$},null,512)]),_:1})),[[p,i.value]])]),_:1}),s(y,{span:12},{default:a(()=>[f((r(),m(g,null,{default:a(()=>[t("div",{style:{height:"350px"},ref_key:"chartRefImpandCli",ref:q},null,512)]),_:1})),[[p,i.value]])]),_:1})]),_:1})])])}}});const Ge=Ce(Re,[["__scopeId","data-v-37424b09"]]);export{Ge as default};
|