import{C as o}from"./index.f12ca817.js";import{t as c}from"./tree-handler.776679bc.js";import{n as r,L as l}from"./index.8c202964.js";const d={name:"TreeItem",components:{CustomTree:o},props:{title:{type:String,default:"\u5206\u7C7B\u53F7"},options:{type:Array,default:()=>[]},visible:{type:Boolean,default:!1},disabled:Boolean},data(){return{expand:!0}},watch:{visible:{handler(t){this.expand=t},immediate:!0}},computed:{defaultProps(){return{children:"children",label:"classificationName",disabled:this.disabled}}},methods:{getNodeClass(t,e){return{"is-active":e.checked||e.selected}},getLabel({categoryType:t,classificationCode:e,classificationName:s}){return`${["tsk_classification","tsk_pz_classification"].includes(t)?e:""}${s}`},hasChild(t){return l(t.children)},handleNodeClick(t,e,s){let n=[];if(c(this.options,a=>{l(a.children)||n.push(a)}),this.disabled||this.hasChild(t))return;const{parent:i}=e;i.data&&i.data.children&&n.forEach(a=>a.checked=!1),l(i.data)&&i.data.forEach(a=>a.checked=!1),t.checked=!0,this.$emit("nodeClick",{data:t,node:e})}}};var _=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tree_item"},[s("div",{staticClass:"menuTypeTitle flex-space-between pointer",on:{click:function(n){e.expand=!e.expand}}},[s("p",[e._v(e._s(e.title))]),s("i",{staticClass:"toggleMenuIcon",class:e.expand?"el-icon-arrow-up":"el-icon-arrow-down"})]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}],staticClass:"scrollbar-default tree-wrap"},[s("CustomTree",{attrs:{data:e.options,props:e.defaultProps,"root-node-class":e.getNodeClass},on:{"node-click":e.handleNodeClick},scopedSlots:e._u([{key:"default",fn:function({node:n,data:i}){return s("div",{staticClass:"custom_item flex-space-between flex-center-align",class:{active:i.checked||i.selected,disabled:e.disabled,level:n.level===1,child:n.level!==1}},[s("div",{directives:[{name:"title",rawName:"v-title.overflow",value:e.getLabel(i),expression:"getLabel(data)",modifiers:{overflow:!0}}],staticClass:"text_content flex-none text-ellipsis",attrs:{"title-placement":"right"}},[e._v(" "+e._s(e.getLabel(i))+" ")]),s("div",{staticClass:"number"},[e._v("("+e._s(i.contentNum||i.num||0)+")")])])}}])})],1)])},p=[],u=r(d,_,p,!1,null,"227bcb5a",null,null);const f=u.exports;const m={name:"SiderTree",props:{optionsData:{type:Array,default:()=>[]},disabled:Boolean},components:{TreeItem:f},methods:{getTitle(t){return t.categoryName||t.classificationName}}};var v=function(){var e=this,s=e._self._c;return s("div",{staticClass:"SiderTree"},e._l(e.optionsData,function(n,i){return s("TreeItem",{key:n.rid,attrs:{title:e.getTitle(n),options:n.children,visible:i===0||e.getTitle(n)==="\u5EFA\u8BBE\u5355\u4F4D",disabled:e.disabled},on:{nodeClick:function(a){return e.$emit("change",a)}}})}),1)},h=[],b=r(m,v,h,!1,null,"7ec076b2",null,null);const y=b.exports;export{y as S};
