import{c as V}from"./api.22c9540d.js";import{u as Q}from"./usePagination.bcbe51f0.js";import{e as C}from"./emitter.c997c4ad.js";import{d as B,q as U,r as b,p as j,n as q,a8 as s,ae as A,H as E,o as I,E as N,G as o,a as n,M as t,u as r,K as R,L as i,t as T}from"./vue.95e072e2.js";const G={class:"relative flex gap-5 mb-5"},H=n("span",{class:"absolute left-7 font-bold text-xl mb-4 text-center",style:{color:"#464646"}},"搜索词-分析页-Query汇总",-1),K={class:"flex justify-center w-full items-center"},L=n("span",{class:"font-medium mr-1.5"},"类型 ",-1),M={style:{height:"100%",overflow:"auto"}},F={class:"font-medium"},J={class:"font-medium"},O={class:"font-medium"},W={class:"font-medium"},X={class:"font-medium"},Y={class:"mt-3.5 flex justify-end"},oe=B({__name:"QuerySummary",setup(Z){const{tableData:f,total:g,currentPage:_,pageSize:c,handlePageChange:w}=Q(m),u=U("filter"),d=b(!1),p=b("positive");j(()=>{C.all.clear()}),C.on("QueryCondition-sendRequest",()=>{m()});async function m(){d.value=!0;const v={date_start:u.value.reportDate[0],date_end:u.value.reportDate[1],report_range:u.value.reportType,layer_type:u.value.layerType,searchTerm_type:p.value,page:_.value,limit:c.value};try{const a=await V(v);g.value=a.total,f.value=a.data}catch(a){console.log("error:",a)}finally{d.value=!1,await q(),window.dispatchEvent(new Event("resize"))}}function x(){m()}return(v,a)=>{const h=s("el-option"),k=s("el-select"),l=s("el-table-column"),D=s("el-link"),z=s("el-table"),P=s("el-pagination"),y=s("el-card"),S=A("loading");return E((I(),N(y,{style:{border:"none"}},{default:o(()=>[n("div",G,[H,n("div",K,[L,t(k,{modelValue:p.value,"onUpdate:modelValue":a[0]||(a[0]=e=>p.value=e),onChange:x,style:{width:"130px"}},{default:o(()=>[t(h,{label:"positive",value:"positive"}),t(h,{label:"negative",value:"negative"})]),_:1},8,["modelValue"])])]),t(y,{shadow:"never"},{default:o(()=>[n("div",M,[t(z,{data:r(f),height:"600",stripe:"",style:{width:"100%"}},{default:o(()=>[t(l,{type:"index",width:"55"}),t(l,{prop:"Search_Query",label:"搜索词","min-width":"200"},{default:o(({row:e})=>[t(D,{underline:!1,target:"_blank",style:{color:"#5a6fc0"}},{default:o(()=>[R(i(e.Search_Query),1)]),_:2},1024)]),_:1}),t(l,{prop:"count",label:"出现次数",align:"center","min-width":"200"},{default:o(({row:e})=>[n("span",F,i(e.count),1)]),_:1}),t(l,{prop:"Impressions_Total_Count",label:"曝光次数",align:"center","min-width":"200"},{default:o(({row:e})=>[n("span",J,i(e.Impressions_Total_Count?e.Impressions_Total_Count:"--"),1)]),_:1}),t(l,{prop:"Clicks_Total_Count",label:"点击次数",align:"center","min-width":"200"},{default:o(({row:e})=>[n("span",O,i(e.Clicks_Total_Count?e.Clicks_Total_Count:"--"),1)]),_:1}),t(l,{prop:"Cart_Adds_Total_Count",label:"加购次数",align:"center","min-width":"200"},{default:o(({row:e})=>[n("span",W,i(e.Cart_Adds_Total_Count?e.Cart_Adds_Total_Count:"--"),1)]),_:1}),t(l,{prop:"Purchases_Total_Count",label:"购买次数",align:"center","min-width":"200"},{default:o(({row:e})=>[n("span",X,i(e.Purchases_Total_Count?e.Purchases_Total_Count:"--"),1)]),_:1})]),_:1},8,["data"])]),n("div",Y,[t(P,{"current-page":r(_),"onUpdate:currentPage":a[1]||(a[1]=e=>T(_)?_.value=e:null),"page-size":r(c),"onUpdate:pageSize":a[2]||(a[2]=e=>T(c)?c.value=e:null),"page-sizes":[10,20,30,50,100,200],layout:"sizes, prev, pager, next",total:r(g),onChange:r(w)},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})),[[S,d.value]])}}});export{oe as _};
