import{u as U,a as $,B as q,b as j}from"./index.8a64ecdf.js";import"./elementPlus.58179425.js";import{d as E,r as p,ak as v,al as F,j as G,w as O,a8 as r,o as f,c as w,a as A,M as s,u as t,t as H,G as a,F as b,$ as h,B as J,a1 as K,E as W,J as z,K as d,L as l}from"./vue.95e072e2.js";import{g as Q,a as X,b as Y,c as Z,d as ee}from"./crud.35ffaca3.js";import ae from"./dataTendency.5ffba862.js";import{BaseColumn as se}from"./commonTabColumn.00155e2b.js";import{D as te}from"./index.eed780e8.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.8dd19552.js";import{_ as oe}from"./_plugin-vue_export-helper.c27b6911.js";import"./echarts.72dc8373.js";import"./enum.b537673d.js";import"./index.9f6b84b8.js";import"./index.df979911.js";const re={class:"overview-tabs"},ne=E({__name:"index",setup(ce){const i=p("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}],u=p("dataTendency"),C=U(),k=$(),{dateRange:n}=v(k),{profile:B}=v(C),m=p({dateRange:n,profileId:B.value.profile_id,campaignType:i.value}),{crudBinding:D,crudRef:S,crudExpose:g}=q({createCrudOptions:ee,context:m}),V=F(),x=p(!1),I=_=>{V.push({name:"CampaignDetail",query:{campaignId:_.campaignId,tagsViewName:_.campaignName}})};return G(async()=>{g.doRefresh()}),O(m,async()=>{g.doRefresh()},{deep:!0}),(_,o)=>{const M=r("el-option"),L=r("el-select"),N=r("el-tabs"),T=r("el-progress"),P=r("el-link"),R=r("fs-crud");return f(),w(b,null,[A("div",re,[s(le,{modelValue:t(n),"onUpdate:modelValue":o[0]||(o[0]=e=>H(n)?n.value=e:null)},null,8,["modelValue"]),s(L,{modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=e=>i.value=e),placeholder:"SP",style:{width:"200px"},"collapse-tags":"","collapse-tags-tooltip":"","max-collapse-tags":3},{default:a(()=>[(f(),w(b,null,h(y,e=>s(M,{label:e.label,value:e.value,disabled:e.disabled},null,8,["label","value","disabled"])),64))]),_:1},8,["modelValue"])]),s(t(j),{class:"fs-page-custom",style:{"margin-top":"-11px"}},{default:a(()=>[s(R,J({ref_key:"crudRef",ref:S},t(D)),K({"header-middle":a(()=>[s(N,{modelValue:u.value,"onUpdate:modelValue":o[2]||(o[2]=e=>u.value=e),class:"chart-tabs",type:"border-card"},{default:a(()=>[u.value==="dataTendency"?(f(),W(ae,{key:0,query:m.value,fetchCard:t(Q),fetchLine:t(X),"fetch-line-month":t(Y),"fetch-line-week":t(Z)},null,8,["query","fetchCard","fetchLine","fetch-line-month","fetch-line-week"])):z("",!0)]),_:1},8,["modelValue"])]),cell_percentTimeInBudget:a(e=>[s(T,{percentage:e.row.percentTimeInBudget>0?e.row.percentTimeInBudget*100:0},null,8,["percentage"])]),cell_campaignName:a(e=>[s(P,{type:"primary",underline:!1,onClick:c=>I(e.row)},{default:a(()=>[d(l(e.row.campaignName),1)]),_:2},1032,["onClick"])]),cell_MissedImpressions:a(e=>[d(l(e.row.MissedImpressionsLower??"0")+" ~ "+l(e.row.MissedImpressionsUpper??"0"),1)]),cell_MissedClicks:a(e=>[d(l(e.row.MissedClicksLower??"0")+" ~ "+l(e.row.MissedClicksUpper??"0"),1)]),cell_MissedSales:a(e=>[d(l(e.row.MissedSalesLower??"0")+" ~ "+l(e.row.MissedSalesUpper??"0"),1)]),_:2},[h(Object.keys(t(se)),e=>({name:`cell_${e}`,fn:a(c=>[s(te,{field:e,value:c.row[e],"prev-val":c.row[`prev${e}`],"gap-val":c.row[`gap${e}`],"date-range":t(n),"show-compare":x.value},null,8,["field","value","prev-val","gap-val","date-range","show-compare"])])}))]),1040)]),_:1})],64)}}});const Ce=oe(ne,[["__scopeId","data-v-ac86430e"]]);export{Ce as default};
