import{g as v}from"./orgApi-B9lfoxVb.js";import{n as g,u as y,i as p,j as k,J as M,r as _,o as x,h as B,K as S}from"./index-CL0IOL6c.js";const T={__name:"orgCascader",props:g({isMultiple:{type:Boolean,default:!1},checkStrictly:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i,{expose:f}){const a=y(i,"modelValue"),s=p([]),r=p(!0),u=i;k(()=>{r.value=!1,v({}).then(e=>{s.value=e.data,M(()=>{r.value=!0})})});async function m(e){if(await S(r),typeof e=="string"||e instanceof String)a.value=c(s.value,e);else{let l=[];e.forEach(t=>{l.push(c(s.value,t))}),a.value=l}}function c(e,l){let t=[];function n(h){for(let o of h){if(o.id===l)return[o.id];if(o.children&&o.children.length){const d=n(o.children);if(d)return[o.id,...d]}}return null}return t=n(e),t}return f({setDefaultValue:m}),(e,l)=>{const t=_("el-cascader");return x(),B(t,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=n=>a.value=n),options:s.value,props:{checkStrictly:u.checkStrictly,label:"orgName",value:"id",multiple:u.isMultiple},clearable:""},null,8,["modelValue","options","props"])}}};export{T as default};