import{d as w,p as n,s as z,w as x,i as g,a as o,c as u,t as r,l as s,k as i,m as k,e as V,E as D,j as C,v as I,x as O,y as U,_ as G}from"./index-deffec86.js";const H={class:"filter"},J={key:0,class:"title sle"},L={class:"tree-label"},Q={key:0},W={key:1},X={key:2},Y={key:3},Z={class:"tree-label"},$=w({name:"TreeFilter"}),ee=w({...$,props:{requestApi:{},data:{},title:{},id:{default:"company_area_id"},label:{default:"name"},multiple:{type:Boolean,default:!1},defaultValue:{},expandAll:{type:Boolean,default:!1},expandKeys:{default:[]},type:{default:"company_area_id"}},emits:["change"],setup(K,{expose:T,emit:R}){const t=K,A={children:"next",label:t.label},f=n(),v=n(),y=n(),m=n([]),_=n([]),q=n([{[t.id]:"",[t.label]:"\u56FA\u5B9A\u533A\u57DF\u6807\u7B7E",next:[{[t.id]:5999,[t.label]:"\u6C11\u65CF\u53BF"},{[t.id]:5998,[t.label]:"\u8FB9\u5883\u53BF"},{[t.id]:5997,[t.label]:"\u4E61\u6751\u632F\u5174\u53BF"}]}]),h=n(),F=n(),B=n([]),E=()=>{h.value=typeof t.defaultValue=="string"?t.defaultValue:""};z(async()=>{if(E(),t.requestApi){const{data:e}=await t.requestApi();m.value=e,_.value=[{id:"",[t.label]:"\u5168\u90E8"},...e]}}),x(()=>t.defaultValue,()=>U(()=>E()),{deep:!0,immediate:!0}),x(()=>t.data,()=>{var e;(e=t.data)!=null&&e.length&&(m.value=t.data,_.value=[...t.data])},{deep:!0,immediate:!0});const b=n("");x(b,e=>{var d,a;(d=f.value)==null||d.filter(e),(a=y.value)==null||a.filter(e)});const S=(e,d,a)=>{if(!e)return!0;let c=a.parent,p=[a.label],l=1;for(;l<a.level;)p=[...p,c.label],c=c.parent,l++;return p.some(j=>j.indexOf(e)!==-1)},N=R,M=e=>{var d,a;h.value=e[t.id],F.value=void 0,(d=v.value)==null||d.setCurrentKey(void 0),(a=y.value)==null||a.setCheckedKeys([]),B.value=[],N("change",{type:"area",value:e[t.id]})},P=e=>{var d,a;F.value=e[t.id],h.value=void 0,(d=f.value)==null||d.setCurrentKey(void 0),(a=y.value)==null||a.setCheckedKeys([]),B.value=[],N("change",{type:"tag",value:e[t.id]})};return T({treeData:m,treeAllData:_,treeRef1:f,treeRef2:v,treeRef3:y}),(e,d)=>{const a=g("el-input"),c=g("el-tooltip"),p=g("el-scrollbar");return o(),u("div",H,[e.title?(o(),u("h4",J,r(e.title),1)):s("v-if",!0),i(a,{modelValue:b.value,"onUpdate:modelValue":d[0]||(d[0]=l=>b.value=l),placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",clearable:""},null,8,["modelValue"]),i(p,{style:O({height:e.title?"calc(100% - 95px)":"calc(100% - 56px)"})},{default:k(()=>[s(" \u533A\u57DF\uFF08\u5355\u9009\uFF09 "),i(V(D),{ref_key:"treeRef1",ref:f,"default-expand-all":e.expandAll,"default-expanded-keys":e.expandKeys,"node-key":e.id,data:_.value,"current-node-key":h.value,"highlight-current":"","expand-on-click-node":!1,props:A,"filter-node-method":S,onNodeClick:M},{default:k(l=>[C("span",L,[l.node.label.length>7?(o(),u("p",Q,[i(c,{effect:"dark","show-after":200,content:l.node.label,placement:"right"},{default:k(()=>[I(r(l.node.label),1)]),_:2},1032,["content"])])):(o(),u("p",W,r(l.node.label),1)),e.type=="company_area_id"?(o(),u("p",X,r(l.data[e.type]),1)):(o(),u("p",Y,"("+r(l.data[e.type])+")",1)),s(' <p>{{ levelMap[scope.node.level] || "" }}</p> ')])]),_:1},8,["default-expand-all","default-expanded-keys","node-key","data","current-node-key"]),s(" \u56FA\u5B9A\u533A\u57DF\u6807\u7B7E\uFF08\u5355\u9009\uFF09 "),i(V(D),{ref_key:"treeRef2",ref:v,"default-expand-all":!0,"node-key":e.id,data:q.value,"current-node-key":F.value,"highlight-current":"","expand-on-click-node":!1,props:A,onNodeClick:P},{default:k(l=>[C("span",Z,[C("p",null,r(l.node.label),1)])]),_:1},8,["node-key","data","current-node-key"]),s(" \u81EA\u5B9A\u4E49\u533A\u57DF\uFF08\u591A\u9009\uFF09- \u6682\u65F6\u9690\u85CF "),s(` <el-tree\r
				ref="treeRef3"\r
				:default-expand-all="expandAll"\r
				:default-expanded-keys="expandKeys"\r
				:node-key="id"\r
				:data="treeData"\r
				show-checkbox\r
				:check-strictly="false"\r
				:expand-on-click-node="false"\r
				:check-on-click-node="true"\r
				:props="defaultProps"\r
				:filter-node-method="filterNode"\r
				:default-checked-keys="selected3"\r
				@check="handleCheckChange3"\r
			>\r
				<template #default="scope">\r
					<span class="tree-label">\r
						<p v-if="scope.node.label.length > 7">\r
							<el-tooltip effect="dark" :show-after="200" :content="scope.node.label" placement="right">\r
								{{ scope.node.label }}\r
							</el-tooltip>\r
						</p>\r
						<p v-else>{{ scope.node.label }}</p>\r
						<p v-if="type == 'company_area_id'">{{ scope.data[type] }}</p>\r
						<p v-else>({{ scope.data[type] }})</p>\r
					</span>\r
				</template>\r
			</el-tree> `)]),_:1},8,["style"])])}}});const ae=G(ee,[["__scopeId","data-v-13a36465"]]);export{ae as default};
