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 h}from"./orgApi-DXFnUix5.js";import{f as l,g as _,r as m,o as C,i as g}from"./index-C8ULRFhF.js";const K={__name:"orgTree",props:{hasAllOption:{type:Boolean,default:!1}},setup(o,{expose:a}){const n=l([]),r=l(),s=o;_(()=>{h({}).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 y=m("el-tree");return C(),g(y,{style:{width:"100%"},data:n.value,"node-key":"id",ref_key:"elTreeRef",ref:r,"filter-node-method":p},null,8,["data"])}}};export{K as default};
|
|
|