| 1 |
import{K as g,f as n,y as i,j as u,v as r,G as h,x as d,F as b,C as x,k as B,A as m}from"./vue.esm-bundler.js?ver=1.7.0";const V={class:"input-append"},j={__name:"Products",props:{form:{type:Object},field:{type:Object},value:{type:Object},fieldKey:{type:String}},setup(l){const f=g().ctx,s=n([]),a=n(""),c=n(null),v=o=>{if(o==="")return!1;a.value=!0,clearTimeout(c.value),c.value=setTimeout(()=>{f.$get("products/searchVariantByName",{name:o}).then(e=>{s.value=e.products}).catch(e=>{}).finally(()=>{a.value=!1})},500)};return(o,e)=>{const p=i("el-option"),y=i("el-select");return r(),u("div",V,[h(y,{modelValue:l.value[l.fieldKey],"onUpdate:modelValue":e[0]||(e[0]=t=>l.value[l.fieldKey]=t),multiple:"",placeholder:l.field.placeholder,filterable:"",remote:"","reserve-keyword":!1,"remote-method":v,loading:a.value},{loading:d(()=>e[1]||(e[1]=[m("svg",{class:"circular",viewBox:"0 0 50 50"},[m("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})],-1)])),default:d(()=>[(r(!0),u(b,null,x(s.value,t=>(r(),B(p,{key:t.id,label:t.variation_title,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","loading"])])}}};export{j as default}; |