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