(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21e539"],{d4a4:function(e,t,a){"use strict";a.r(t);var n=a("7a23"),o=a("85b1"),l={props:{url:String,keywordName:String,valueName:{require:!1,type:String,default:"id"},disabled:Boolean,param:{require:!1,type:Object,default:()=>({})},itemKey:{type:String},showKey:{type:String}},setup(e,{emit:t}){const a=e;let l=0;const{proxy:c}=Object(n["getCurrentInstance"])(),i=Object(n["reactive"])({data:[],value:[],fetching:!1}),r=Object(o["a"])(e=>{l+=1;const t=l;i.data=[],i.fetching=!0;const n=Object.assign({look_type:"all"},a.param);n[a.keywordName]=e||"",c.$post(a.url,n).then(e=>{if(t===l)if(Array.isArray(e)){const t=e.map(e=>{let t=a.showKey||a.keywordName,n=a.showKey?`${e[a.keywordName]}(${e[a.showKey]})`:""+e[t],o={label:n,value:""+e[a.valueName]};if(a.itemKey)if(a.itemKey.includes(",")){let t=a.itemKey.split(",");t.forEach(t=>{o[t]=e[t]})}else o[a.itemKey]=e[a.itemKey];return o});i.data=t,i.fetching=!1}else{const t=e.data.map(e=>{let t=a.showKey||a.keywordName,n=a.showKey?`${e[a.keywordName]}(${e[a.showKey]})`:""+e[t],o={label:n,value:""+e[a.valueName]};if(a.itemKey)if(a.itemKey.includes(",")){let t=a.itemKey.split(",");t.forEach(t=>{o[t]=e[t]})}else o[a.itemKey]=e[a.itemKey];return o});i.data=t,i.fetching=!1}})},500);r("");const s=e=>{t("update:value",e),t("onSelect",e);let a=i.data.find(t=>t.value==e);a&&t("getItem",a)};return Object(n["watch"])(i.value,()=>{i.data=[],i.fetching=!1}),(t,a)=>{const o=Object(n["resolveComponent"])("a-spin"),l=Object(n["resolveComponent"])("a-select");return Object(n["openBlock"])(),Object(n["createBlock"])(l,{value:Object(n["unref"])(i).value,"onUpdate:value":a[1]||(a[1]=e=>Object(n["unref"])(i).value=e),placeholder:"请选择",style:{width:"100%"},onSelect:s,"filter-option":!1,disabled:e.disabled,"not-found-content":Object(n["unref"])(i).fetching?void 0:null,showSearch:"",options:Object(n["unref"])(i).data,"allow-clear":"",onSearch:Object(n["unref"])(r)},Object(n["createSlots"])({_:2},[Object(n["unref"])(i).fetching?{name:"notFoundContent",fn:Object(n["withCtx"])(()=>[Object(n["createVNode"])(o,{size:"small"})])}:void 0]),1032,["value","disabled","not-found-content","options","onSearch"])}}};const c=l;t["default"]=c}}]);