import{b as y,p as B,k as D,o as w,c as x,K as F,L as I,f as i,a as k,j as h,A as C,l as v,Z as P,aM as S}from"./index.4d3e3847.js";import{B as O}from"./basic-form.114da3ff.js";import{u as g}from"./hooks.428ba1c3.js";import{b as E}from"./useNav.afbe69e0.js";function G(p){var a,t;const s={};for(const e of p){const f=e.type==="checkbox",o=e.type==="date_picker",l=e.type==="range";if(e.type==="input_group"){const r=((t=(a=e.otherOptions)==null?void 0:a.inputGroupOptions[0])==null?void 0:t.value)||"";s[e.field]="",s[e.type_field]=r}else s[e.field]=f||o||l?[]:""}return s}const H={formConfig:{type:Object,required:!0}},N={class:"w-99/100"},R={class:"bg-white pl-4 pt-4 page-search"},V={style:{width:"100%"},flex:"","gap-2":""},K=y({__name:"page-search",props:H,emits:["searchBtnClick","resetBtnClick"],setup(p,{emit:s}){const a=p,{searchParams:t={}}=E(),e=G(a.formConfig.formItems),f=a.formConfig.isHide,o=B({...t.basic?t.basic:e});function l(){o.value={...e},s("resetBtnClick")}function _(){s("searchBtnClick",o.value)}if(t.basic){const{formConfig:r}=a,{formItems:n}=r;n.forEach(c=>{const{field:u,otherOptions:b={}}=c,{startProp:m,endProp:d}=b;(m||d)&&(o.value[u]=[t.basic[m],t.basic[d]],delete o.value[m],delete o.value[d])})}return(r,n)=>{const c=D("el-button");return w(),x("div",N,[F(k("div",R,[h(i(O),S(r.formConfig,{"form-data":o.value,"onUpdate:form-data":n[0]||(n[0]=u=>o.value=u)}),{action:C(()=>[k("div",V,[h(c,{type:"primary",icon:i(g)("search"),onClick:_},{default:C(()=>[v(" \u641C\u7D22 ")]),_:1},8,["icon"]),h(c,{icon:i(g)("refresh"),onClick:l},{default:C(()=>[v(" \u91CD\u7F6E ")]),_:1},8,["icon"]),P(r.$slots,"action")])]),_:3},16,["form-data"])],512),[[I,!i(f)]])])}}});export{K as _};
