var e=Object.defineProperty,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,o=(a,l,t)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[l]=t,r=(e,r)=>{for(var s in r||(r={}))l.call(r,s)&&o(e,s,r[s]);if(a)for(var s of a(r))t.call(r,s)&&o(e,s,r[s]);return e};import{d as s,a as i,w as p,E as u,y as m,f as d,z as n,p as c,u as f,B as j,e as v,F as _,G as b,J as y,l as x,ab as h,a$ as g}from"./index-ip5gDR6L.js";/* empty css            *//* empty css                  *//* empty css              *//* empty css            *//* empty css               *//* empty css                  *//* empty css               *//* empty css               *//* empty css              */import{a as V}from"./product-ti2LZz-w.js";import{E,a as w}from"./index-CxGOZAw2.js";import{E as O}from"./index-Ca1H-sCf.js";import{E as k}from"./index-D5xppMej.js";import{E as P}from"./index-DfrOVkw6.js";import{E as C,a as J}from"./index-Br3btmwp.js";import{E as S}from"./index-BY5Lb5w1.js";import{E as U}from"./index-opP5No9I.js";import{E as $}from"./index-BBSYL4g8.js";import{_ as z}from"./_plugin-vue_export-helper-BCo6x5W8.js";import"./use-form-common-props-BwBs_jod.js";import"./index-D-10FtUD.js";import"./index-CHAf6FpU.js";import"./index-fnD_mPvE.js";import"./use-form-item-BDb3ZgPk.js";import"./_initCloneObject-DwsgJamq.js";import"./index-C9KXwj2c.js";import"./index-DbRz3Zuu.js";import"./index-D1xXI5gl.js";import"./token-DWNpOE8r.js";import"./scroll-ChxXkPhM.js";import"./debounce-B9s63_mG.js";import"./index-Jz5GfFad.js";import"./vnode-6FKeug3R.js";import"./index-D-iZIej9.js";const I=z(s({__name:"product-search",props:{modelValue:{}},emits:["update:modelValue","search","reset"],setup(e,{emit:a}){const l=e,t=a,o=i([]),s=i(r({},l.modelValue));p(()=>l.modelValue,(e,a)=>{JSON.stringify(e)!==JSON.stringify(a)&&(s.value=r({},e))},{deep:!0});let z=null;p(s,e=>{z&&clearTimeout(z),z=setTimeout(()=>{t("update:modelValue",r({},e))},100)},{deep:!0});const I=e=>{return a=this,l=null,t=function*(){if(e&&!(o.value.length>0))try{const e=yield V({page:1,page_size:100});o.value=e.list}catch(a){o.value=[]}},new Promise((e,o)=>{var r=e=>{try{i(t.next(e))}catch(a){o(a)}},s=e=>{try{i(t.throw(e))}catch(a){o(a)}},i=a=>a.done?e(a.value):Promise.resolve(a.value).then(r,s);i((t=t.apply(a,l)).next())});var a,l,t},K=()=>{t("search",s.value)},N=()=>{s.value={name:void 0,category_id:void 0,status:void 0},t("reset")};return(a,l)=>{const t=u("ripple");return d(),m(f($),{class:"search-card",shadow:"never"},{default:n(()=>[c(f(E),{ref:"formRef",model:e.modelValue,"label-width":"80px"},{default:n(()=>[c(f(O),{gutter:20},{default:n(()=>[c(f(k),{span:6},{default:n(()=>[c(f(w),{label:"商品名称",prop:"name"},{default:n(()=>[c(f(P),{modelValue:s.value.name,"onUpdate:modelValue":l[0]||(l[0]=e=>s.value.name=e),placeholder:"请输入商品名称",clearable:"",onKeyup:j(K,["enter"])},null,8,["modelValue"])]),_:1})]),_:1}),c(f(k),{span:6},{default:n(()=>[c(f(w),{label:"商品分类",prop:"category_id"},{default:n(()=>[c(f(C),{modelValue:s.value.category_id,"onUpdate:modelValue":l[1]||(l[1]=e=>s.value.category_id=e),placeholder:"请选择商品分类",clearable:"",onVisibleChange:I},{default:n(()=>[(d(!0),v(_,null,b(o.value,e=>(d(),m(f(J),{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c(f(k),{span:6},{default:n(()=>[c(f(w),{label:"商品状态",prop:"status"},{default:n(()=>[c(f(C),{modelValue:s.value.status,"onUpdate:modelValue":l[2]||(l[2]=e=>s.value.status=e),placeholder:"请选择商品状态",clearable:""},{default:n(()=>[c(f(J),{value:1,label:"上架"}),c(f(J),{value:2,label:"下架"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),c(f(k),{span:6},{default:n(()=>[c(f(w),{"label-width":"0"},{default:n(()=>[c(f(S),null,{default:n(()=>[y((d(),m(f(U),{type:"primary",onClick:K},{default:n(()=>[c(f(h),{class:"mr-1"},{default:n(()=>[c(f(g))]),_:1}),l[3]||(l[3]=x(" 搜索 ",-1))]),_:1})),[[t]]),y((d(),m(f(U),{onClick:N},{default:n(()=>[...l[4]||(l[4]=[x("重置",-1)])]),_:1})),[[t]])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})}}}),[["__scopeId","data-v-d23b1593"]]);export{I as default};
