You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
1.1 KiB
1 lines
1.1 KiB
import{g as v}from"./orgApi-B5ceIBmm.js";import{B as g,C as k,z as p,h as y,M,r as B,o as _,k as x,N as S}from"./index-CsSGZIOI.js";const L={__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=k(i,"modelValue"),s=p([]),r=p(!0),u=i;y(()=>{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=B("el-cascader");return _(),x(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{L as default};
|
|
|