import{c9 as S,h as w,u as C,v as y}from"./index-Cy4uayzW.js";import{U as d,a2 as i,ad as p,af as h,a3 as k,ae as I,G as q,a5 as x,F as D,f,w as m}from"./vue-vendor-CxLCUzY4.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";const{createMessage:B}=C(),F={name:"JOnlineSearchSelect",props:{placeholder:{type:String,default:"",required:!1},value:{type:String,required:!1},fieldId:{type:String,required:!0}},emits:["update:value"],setup(s,{emit:u}){let t=f(""),a=f([]);m(()=>s.value,e=>{e?t.value=e:t.value=void 0},{immediate:!0}),m(()=>s.fieldId,()=>{l()},{immediate:!0});const c=y(r,800);function r(e=""){let g={keyword:e},v="/online/cgreport/api/getReportDictList?fieldId="+s.fieldId;w.get({url:v,params:g},{isTransformResponse:!1}).then(n=>{n.success?n.result&&n.result.length>0?a.value=n.result:a.value=[]:B.warning(n.message)})}function o(e){u("update:value",e),(!e||e=="")&&l()}function l(){a.value=[],r()}return{selectOptions:a,handleSearch:c,handleChange:o,selected:t}}};function O(s,u,t,a,c,r){const o=d("a-select-option"),l=d("a-select");return i(),p(l,{value:a.selected,placeholder:t.placeholder,"show-search":"","default-active-first-option":!1,"show-arrow":!0,"filter-option":!1,"not-found-content":null,onSearch:a.handleSearch,onChange:a.handleChange,allowClear:""},{default:h(()=>[(i(!0),k(D,null,I(a.selectOptions,e=>(i(),p(o,{key:e.value},{default:h(()=>[q(x(e.text),1)]),_:2},1024))),128))]),_:1},8,["value","placeholder","onSearch","onChange"])}const M=S(F,[["render",O]]);export{M as default};
