import{u as U,a as $,B as q,b as j}from"./index.373e4c1e.js";import"./elementPlus.c5b0e04f.js";import{d as E,r as c,al as v,am as F,j as G,w as O,a9 as r,o as f,c as b,a as A,M as s,u as t,t as J,G as a,F as w,a0 as h,B as K,a2 as W,E as z,J as H,K as d,L as l}from"./vue.65d9dadc.js";import{g as Q,a as X,b as Y,c as Z,d as ee}from"./crud.a752d981.js";import ae from"./dataTendency.375c730a.js";import{BaseColumn as se}from"./commonTabColumn.a4869ec6.js";import{D as te}from"./index.74ced524.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.0c3456ea.js";import{_ as oe}from"./_plugin-vue_export-helper.c27b6911.js";import"./echarts.72dc8373.js";import"./enum.b537673d.js";import"./index.78cddcae.js";import"./index.4dc9403e.js";const re={class:"overview-tabs"},ne=E({__name:"index",setup(pe){const i=c("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=c("dataTendency"),C=U(),k=$(),{dateRange:n}=v(k),{profile:B}=v(C),m=c({dateRange:n,profileId:B.value.profile_id,campaignType:i.value}),{crudBinding:D,crudRef:S,crudExpose:g}=q({createCrudOptions:ee,context:m}),V=F(),x=c(!1);G(async()=>{g.doRefresh()});const M=_=>{V.push({name:"CampaignDetail",query:{campaignId:_.campaignId,tagsViewName:_.campaignName}})};return O(m,async()=>{g.doRefresh()},{deep:!0}),(_,o)=>{const I=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(),b(w,null,[A("div",re,[s(le,{modelValue:t(n),"onUpdate:modelValue":o[0]||(o[0]=e=>J(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(),b(w,null,h(y,e=>s(I,{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,K({ref_key:"crudRef",ref:S},t(D)),W({"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(),z(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"])):H("",!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:p=>M(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(p=>[s(te,{field:e,value:p.row[e],"prev-val":p.row[`prev${e}`],"gap-val":p.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-50071b07"]]);export{Ce as default};
