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
969 B
1 lines
969 B
import{a as y}from"./orgApi-B5ceIBmm.js";import{z as l,h as _,r as k,o as m,k as C}from"./index-CsSGZIOI.js";const g={__name:"orgTree",props:{hasAllOption:{type:Boolean,default:!1}},setup(o,{expose:a}){const n=l([]),r=l(),s=o;_(()=>{y({}).then(e=>{s.hasAllOption?n.value=[{id:0,label:"全部",children:null,disabled:!1},...e.data]:n.value=e.data})});function u(e){var t;(t=r.value)==null||t.setCheckedKeys(e)}function c(){var e;return(e=r.value)==null?void 0:e.getCheckedKeys()}function i(){var e;return(e=r.value)==null?void 0:e.getCurrentKey()}function f(e){var t;(t=r.value)==null||t.setCurrentKey(e)}function d(e){var t;(t=r.value)==null||t.filter(e)}const p=(e,t)=>e?t.label.includes(e):!0;return a({setCheckedKeys:u,getCheckedKeys:c,getCurrentKey:i,setCurrentKey:f,filter:d}),(e,t)=>{const h=k("el-tree");return m(),C(h,{style:{width:"100%"},data:n.value,"node-key":"id",ref_key:"elTreeRef",ref:r,"filter-node-method":p},null,8,["data"])}}};export{g as default};
|
|
|