import{d as c,a as _,r as g}from"./elementPlus.4833989a.js";import{e as T}from"./emitter.bff31cdd.js";import{_ as k,a as B}from"./index.vue_vue_type_script_setup_true_lang.99b91657.js";import{_ as O}from"./lodash.d9f7faa7.js";import{d as U,r as v,B as L,E as S,j,w as x,ai as r,o as y,M as b,O as i,a as t,U as n,u as l,T as A,S as M}from"./vue.adf17aba.js";const E={class:"flex flex-wrap gap-7"},H=t("span",{class:"font-bold mr-2",style:{color:"#303133"}},"层级类型:",-1),Q=t("span",{class:"font-bold mr-2",style:{color:"#303133"}},"报告类型:",-1),I=t("span",{class:"font-bold mr-2",style:{color:"#303133"}},"搜索词:",-1),$={class:"font-bold mr-2",style:{color:"#303133"}},q=t("span",{class:"font-bold mr-2",style:{color:"#303133"}},"报告日期:",-1),K={class:"flex gap-3.5"},P=U({__name:"QueryCondition",setup(R){const d=v([c().subtract(2,"week").day(0).format("YYYY-MM-DD"),c().subtract(1,"week").day(6).format("YYYY-MM-DD")]),u=v([c().subtract(2,"month").startOf("month").format("YYYY-MM-DD"),c().subtract(0,"month").startOf("month").format("YYYY-MM-DD")]),p=v("ASIN"),e=L("filter");S(()=>{f()}),j(()=>{V()}),x([d,u],()=>{f()}),x(()=>e.value.layerType,s=>{s==="asin_view"?p.value="ASIN":s==="brand_view"?p.value="Brand":(p.value="ASIN",e.value.variable="")});const C=O.throttle(()=>{T.emit("QueryCondition-sendRequest")},3e3);function V(){C()}function D(){e.value.layerType="asin_view",e.value.searchTerm="",e.value.reportType="MONTHLY",e.value.variable=""}function f(){let s=[];e.value.reportType==="MONTHLY"?s=u.value:s=d.value,T.emit("QueryCondition-dateChange",s)}return(s,o)=>{const m=r("el-option"),h=r("el-select"),Y=r("el-input"),w=r("el-button"),N=r("el-card");return y(),b(N,{"body-class":"flex justify-between gap-3.5",shadow:"hover",style:{border:"none","margin-bottom":"10px"}},{default:i(()=>[t("div",E,[t("div",null,[H,n(h,{modelValue:l(e).layerType,"onUpdate:modelValue":o[0]||(o[0]=a=>l(e).layerType=a),style:{width:"130px"}},{default:i(()=>[n(m,{label:"Asin View",value:"asin_view"}),n(m,{label:"Brand View",value:"brand_view"})]),_:1},8,["modelValue"])]),t("div",null,[Q,n(h,{modelValue:l(e).reportType,"onUpdate:modelValue":o[1]||(o[1]=a=>l(e).reportType=a),style:{width:"100px"},onChange:f},{default:i(()=>[n(m,{label:"月度",value:"MONTHLY"}),n(m,{label:"周度",value:"WEEKLY"})]),_:1},8,["modelValue"])]),t("div",null,[I,n(Y,{modelValue:l(e).searchTerm,"onUpdate:modelValue":o[2]||(o[2]=a=>l(e).searchTerm=a),"prefix-icon":l(_),style:{width:"180px"}},null,8,["modelValue","prefix-icon"])]),t("div",null,[t("span",$,A(p.value)+":",1),n(Y,{modelValue:l(e).variable,"onUpdate:modelValue":o[3]||(o[3]=a=>l(e).variable=a),"prefix-icon":l(_),style:{width:"180px"}},null,8,["modelValue","prefix-icon"])]),t("div",null,[q,l(e).reportType==="MONTHLY"?(y(),b(k,{key:0,modelValue:u.value,"onUpdate:modelValue":o[4]||(o[4]=a=>u.value=a)},null,8,["modelValue"])):(y(),b(B,{key:1,modelValue:d.value,"onUpdate:modelValue":o[5]||(o[5]=a=>d.value=a)},null,8,["modelValue"]))])]),t("div",K,[n(w,{icon:l(_),plain:"",type:"primary",onClick:V},{default:i(()=>[M("查询")]),_:1},8,["icon"]),n(w,{icon:l(g),color:"#0891b2",plain:"",round:"",type:"warning",onClick:D},{default:i(()=>[M("重置")]),_:1},8,["icon"])])]),_:1})}}});export{P as _};
