var i=(a,o,l)=>new Promise((t,r)=>{var d=s=>{try{n(l.next(s))}catch(f){r(f)}},u=s=>{try{n(l.throw(s))}catch(f){r(f)}},n=s=>s.done?t(s.value):Promise.resolve(s.value).then(d,u);n((l=l.apply(a,o)).next())});import{j as C,a as g,b4 as _,p as S,m as F,l as A,ed as b,r as m,aa as y,O as D,o as U,e as E,i as I}from"./index.ae52ebae.js";import{f as w}from"./busHospitalApi.8fb6d18a.js";import"./params.cdcdde57.js";const N=g({name:"HospitalSelect",components:{Select:_},setup(){S(()=>i(this,null,function*(){yield n(o,!0)}));const a=F(),o={current:0,size:999},l=A(),t=l.getUserInfo,{refreshPage:r}=b(),d=m([]),u=m("");function n(e,p){return i(this,null,function*(){let h=yield w(e);h.records&&(d.value=h.records.map(v=>({value:v.id,label:v.name})),t.tenantId!=""&&p&&(u.value="\u9A7C\u4EBA\u533B\u7597\u5668\u68B0\u6709\u9650\u516C\u53F8",c({value:1,label:"\u9A7C\u4EBA\u533B\u7597\u5668\u68B0\u6709\u9650\u516C\u53F8"})))})}const s=e=>{n({search:!0,size:20,includes:["tenant_id","name"],wheres:[{column:"name",value:e}]},!1)},f=(e,p)=>{c(p)};y(()=>a.path,e=>i(this,null,function*(){u.value==null&&e!="/info/infoDeviceReg"&&e!="/redirect/%2Finfo%2FinfoDeviceReg"&&e!="/redirect/%2Finfo%2FinfoDeviceUse"&&e!="/redirect/%2Faccount%2Fsetting"&&e!="/info/infoDeviceUse"&&e!="/account/setting"&&(t.tenantId&&t.tenantName?(u.value=t.tenantName||"",c({value:t.tenantId,label:t.tenantName})):(u.value="\u9A7C\u4EBA\u533B\u7597\u5668\u68B0\u6709\u9650\u516C\u53F8",c({value:1,label:"\u9A7C\u4EBA\u533B\u7597\u5668\u68B0\u6709\u9650\u516C\u53F8"})),yield n(o,!1))}));const B=e=>i(this,null,function*(){a.path,e==null&&a.path!="/info/infoDeviceReg"&&a.path!="/info/infoDeviceUse"&&a.path!="/account/setting"&&a.path!="/login"?(u.value="\u9A7C\u4EBA\u533B\u7597\u5668\u68B0\u6709\u9650\u516C\u53F8",c({value:1,label:"\u9A7C\u4EBA\u533B\u7597\u5668\u68B0\u6709\u9650\u516C\u53F8"}),yield n(o,!1)):(c({value:null,label:""}),yield n(o,!1))});function c(e){return i(this,null,function*(){t.tenantId=e.value,t.tenantName=e.label,l.setUserInfo(t),yield r()})}return{selectVal:u,options:d,handleSearch:s,handleSelect:f,handleChange:B}}}),R={class:"!mt-2"};function $(a,o,l,t,r,d){const u=D("Select");return U(),E("div",R,[I(u,{value:a.selectVal,"onUpdate:value":o[0]||(o[0]=n=>a.selectVal=n),style:{width:"280px"},"show-search":"",options:a.options,allowClear:"",placeholder:"\u8BF7\u8F93\u5165\u533B\u9662","not-found-content":null,"filter-option":!1,onSearch:a.handleSearch,onSelect:a.handleSelect,onChange:a.handleChange},null,8,["value","options","onSearch","onSelect","onChange"])])}var j=C(N,[["render",$],["__scopeId","data-v-27d669c0"]]);export{j as default};