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