var b=(_,d,o)=>new Promise((c,m)=>{var p=t=>{try{n(o.next(t))}catch(e){m(e)}},u=t=>{try{n(o.throw(t))}catch(e){m(e)}},n=t=>t.done?c(t.value):Promise.resolve(t.value).then(p,u);n((o=o.apply(_,d)).next())});import{d as B,G as D,r as f,K as U,J as j,q as F,j as r,o as g,h as k,w as a,e as l,k as L,b as w,c as $,F as q,v as O,n as T,t as E}from"./index-90c78f99.js";const G=["title","onClick"],P=B({__name:"unit-dialog",props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close","getUnitName"],setup(_,{emit:d}){const o=_,c=D({name:""}),m=()=>{n.value=t.value.filter(e=>e.organizationName.includes(c.name))},p=e=>{u.value=e,d("getUnitName",e),d("close")},u=f(),n=f(),t=f();return U(()=>o.visible,e=>b(this,null,function*(){if(e){const s=yield j();t.value=s.data,n.value=s.data,yield F(),u.value=o.data}})),(e,s)=>{const x=r("el-input"),y=r("el-form-item"),v=r("el-col"),N=r("el-button"),C=r("el-row"),V=r("el-form"),h=r("el-dialog");return g(),k(h,{"model-value":_.visible,title:"选择部门",width:"772px","destroy-on-close":"",class:"unitDialog",onClose:s[1]||(s[1]=i=>d("close"))},{default:a(()=>[l(V,{model:c},{default:a(()=>[l(C,{gutter:4},{default:a(()=>[l(v,{span:8},{default:a(()=>[l(y,null,{default:a(()=>[l(x,{modelValue:c.name,"onUpdate:modelValue":s[0]||(s[0]=i=>c.name=i),placeholder:"请输入部门名称",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),l(v,{span:16},{default:a(()=>[l(y,null,{default:a(()=>[l(N,{type:"primary",onClick:m},{default:a(()=>[L("查找")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),w("div",null,[l(C,{gutter:16},{default:a(()=>[(g(!0),$(q,null,O(n.value,(i,z)=>(g(),k(v,{key:z,span:6,class:"mb-16"},{default:a(()=>[w("p",{class:T(`truncate cursor-pointer px-4 py-2 ${u.value&&u.value.organizationCode===i.organizationCode?"active-p":""}`),title:i,onClick:I=>p(i)},E(i.organizationName),11,G)]),_:2},1024))),128))]),_:1})])]),_:1},8,["model-value"])}}});export{P as _};
