import{a2 as h}from"./index.CL7yl-Wb.js";import{a as k,r as C,aj as c,c as N,o as x,b as s,S as a,K as d,u as D,Q as y}from"./vue.D1BjjNmv.js";import{_ as L}from"./_plugin-vue_export-helper.DlAUqK2U.js";const b={class:"document-tree-container"},g={class:"custom-tree-node"},B={class:"node-label"},w={class:"ml-2"},R=k({__name:"index",props:{treeData:{type:Array,default:()=>[]}},emits:["treeClick","updateDocument","deleteDocument"],setup(i,{expose:u,emit:f}){const _=f,r=C(null),m={children:"children",label:"title"},p=(n,t)=>{let e=t,l=null,o=null;for(;e;)e.level===1?l=e.data:e.level===2&&(o=e.data),e=e.parent;t.level===1?(l=n,o=null):t.level===2&&(o=n),_("treeClick",{firstLevel:l,secondLevel:o,currentNode:n})};return u({treeRef:r}),(n,t)=>{const e=c("el-icon"),l=c("el-tree");return x(),N("div",b,[t[0]||(t[0]=s("div",{class:"document-tree-header"},[s("span",{class:"document-tree-title"},"题库归属")],-1)),a(l,{ref_key:"treeRef",ref:r,data:i.treeData,"node-key":"id",props:m,"default-expand-all":"","highlight-current":"",onNodeClick:p},{default:d(({node:o,data:v})=>[s("div",g,[s("div",B,[a(e,null,{default:d(()=>[a(D(h))]),_:1}),s("span",w,y(v.title),1)])])]),_:1},8,["data"])])}}}),A=L(R,[["__scopeId","data-v-ed5fa56c"]]);export{A as default};
