import{d as _,o as E,a as L}from"./elementPlus.4833989a.js";import{_ as w}from"./WeightTable.vue_vue_type_script_setup_true_lang.ffa1b5c3.js";import{e as O}from"./emitter.bff31cdd.js";import{_ as C}from"./lodash.d9f7faa7.js";import{_ as I}from"./FeatureWordTable.vue_vue_type_script_setup_true_lang.0cb3c279.js";import{m as K}from"./marketplaceIdMap.53975691.js";import{d as U,r as y,G as $,j as N,ai as d,o as p,c as D,U as n,O as u,a as s,u as t,F as W,a8 as B,M as Y,D as b,S as j}from"./vue.adf17aba.js";import"./usePagination.26f71951.js";import"./api.f7e03949.js";import"./index.ad3efb29.js";import"./echarts.72dc8373.js";import"./useElTableData.076dc1a9.js";import"./requestCode.a7f226d1.js";const F={class:"py-2 px-2.5"},R={class:"flex flex-wrap gap-7"},S=s("span",{class:"font-bold mr-2",style:{color:"#303133"}},"关键词:",-1),H=s("span",{class:"font-bold mr-2",style:{color:"#303133"}},"市场ID:",-1),P=s("span",{class:"font-bold mr-2",style:{color:"#303133"}},"报告类型:",-1),Q=s("span",{class:"font-bold mr-2",style:{color:"#303133"}},"报告日期:",-1),q={class:"flex gap-3.5"},de=U({__name:"index",setup(z){const a=y(V()),r=y(a.value[0]),l=y({searchTerm:"zosi",marketIds:"ATVPDKIKX0DER",reportType:"WEEKLY",reportDate:a});$("filter",l),N(()=>{v()});function V(){const c=_().subtract(1,"month").startOf("month").day(0),m=c.add(6,"day");return[c.format("YYYY-MM-DD"),m.format("YYYY-MM-DD")]}function f(){if(l.value.reportType==="WEEKLY")a.value[0]=r.value,a.value[1]=_(r.value).add(6,"day").format("YYYY-MM-DD");else if(l.value.reportType==="MONTHLY"){const i=_(r.value);a.value[0]=i.startOf("month").format("YYYY-MM-DD"),a.value[1]=i.endOf("month").format("YYYY-MM-DD")}}const k=C.throttle(()=>{O.emit("QueryPage-query")},3e3);function v(){k()}return(i,o)=>{const c=d("el-input"),m=d("el-option"),M=d("el-select"),h=d("el-date-picker"),T=d("el-config-provider"),x=d("el-button"),g=d("el-card");return p(),D("div",F,[n(g,{"body-class":"flex justify-between gap-3.5",shadow:"hover",style:{border:"none","margin-bottom":"10px"}},{default:u(()=>[s("div",R,[s("div",null,[S,n(c,{modelValue:t(l).searchTerm,"onUpdate:modelValue":o[0]||(o[0]=e=>t(l).searchTerm=e),style:{width:"180px"}},null,8,["modelValue"])]),s("div",null,[H,n(M,{modelValue:t(l).marketIds,"onUpdate:modelValue":o[1]||(o[1]=e=>t(l).marketIds=e),style:{width:"180px"}},{default:u(()=>[(p(!0),D(W,null,B(t(K),e=>(p(),Y(m,{label:e.Country,value:e.MarketplaceId,key:e.MarketplaceId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),s("div",null,[P,n(M,{modelValue:t(l).reportType,"onUpdate:modelValue":o[2]||(o[2]=e=>t(l).reportType=e),style:{width:"100px"},onChange:f},{default:u(()=>[n(m,{label:"月度",value:"MONTHLY"}),n(m,{label:"周度",value:"WEEKLY"})]),_:1},8,["modelValue"])]),s("div",null,[Q,t(l).reportType==="WEEKLY"?(p(),Y(T,{key:0,locale:t(E)},{default:u(()=>[n(h,{modelValue:t(r),"onUpdate:modelValue":o[3]||(o[3]=e=>b(r)?r.value=e:null),clearable:!1,"disabled-date":e=>e>new Date,format:`${t(a)[0]} To ${t(a)[1]}`,type:"week","value-format":"YYYY-MM-DD",onChange:f},null,8,["modelValue","disabled-date","format"])]),_:1},8,["locale"])):(p(),Y(h,{key:1,modelValue:t(r),"onUpdate:modelValue":o[4]||(o[4]=e=>b(r)?r.value=e:null),clearable:!1,"disabled-date":e=>e>new Date,format:`${t(a)[0]} To ${t(a)[1]}`,type:"month","value-format":"YYYY-MM-DD",onChange:f},null,8,["modelValue","disabled-date","format"]))])]),s("div",q,[n(x,{icon:t(L),plain:"",type:"primary",onClick:v},{default:u(()=>[j("查询")]),_:1},8,["icon"])])]),_:1}),n(w),n(I)])}}});export{de as default};
