import{a2 as h}from"./index.CL7yl-Wb.js";import{a as k,r as N,aj as c,c as C,o as x,b as s,S as a,K as d,u as L,Q as y}from"./vue.D1BjjNmv.js";import{_ as D}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:"treeList",props:{treeData:{type:Array,default:()=>[]}},emits:["treeClick","updateDocument","deleteDocument"],setup(i,{expose:u,emit:_}){const f=_,r=N(null),p={children:"children",label:"title"},m=(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),f("treeClick",{firstLevel:l,secondLevel:o,currentNode:n})};return u({treeRef:r}),(n,t)=>{const e=c("el-icon"),l=c("el-tree");return x(),C("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:p,"default-expand-all":"","highlight-current":"",onNodeClick:m},{default:d(({node:o,data:v})=>[s("div",g,[s("div",B,[a(e,null,{default:d(()=>[a(L(h))]),_:1}),s("span",w,y(v.title),1)])])]),_:1},8,["data"])])}}}),A=D(R,[["__scopeId","data-v-5e70d7d8"]]);export{A as default};
