2 lines
1.8 KiB
JavaScript
Raw Normal View History

2025-05-29 15:03:59 +08:00
import{C as N,r,a3 as V,j as d,c as f,o as i,f as a,e as u,w as p,I as B,J as E,h as M,k as P,aS as T,B as m,_ as j}from"./index-CrAWI0wi.js";const z={style:{width:"100%"}},D={class:"title"},I={class:"search"},L={class:"prefix"},O=N({__name:"ThreePanel",props:{modelthree:{}},emits:["handleNodeClick","refresh"],setup(_,{emit:b}){const c=_,k={children:"children",label:"label",value:"id"},y=b,o=r("all"),h=r([{value:"all",label:"全部"},{value:"Mesh",label:"网格"},{value:"Group",label:"组"},{value:"Object3D",label:"对象"},{value:"Light",label:"光源"}]);V(()=>c.modelthree,()=>{const l=[];l.push({value:"all",label:"全部"}),c.modelthree.forEach(e=>l.push({label:e.type,value:e.type})),h.value=l.filter((e,s,n)=>n.indexOf(e)===s)});function C(l){y("handleNodeClick",l)}const v=r(),g=(l,e)=>e.type.includes(l)||l==="all",x=()=>v.value.filter(o.value);return(l,e)=>{const s=d("el-button"),n=d("el-option"),w=d("el-select");return i(),f("div",z,[a("div",D,[e[3]||(e[3]=a("div",null,"模型树",-1)),u(s,{onClick:e[0]||(e[0]=t=>l.$emit("refresh")),size:"small"},{default:p(()=>e[2]||(e[2]=[a("div",{style:{width:"124px"}},"重新加载模型树",-1)])),_:1})]),a("div",I,[e[4]||(e[4]=a("div",null,"筛选",-1)),u(w,{size:"small",style:{width:"150px"},modelValue:o.value,"onUpdate:modelValue":e[1]||(e[1]=t=>o.value=t),onChange:x},{default:p(()=>[(i(!0),f(B,null,E(h.value,t=>(i(),M(n,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),u(P(T),{height:300,style:{height:"100%",background:"none"},data:l.modelthree,"node-key":"id",props:k,onNodeClick:C,"expand-on-click-node":!1,ref_key:"treeRef",ref:v,"filter-method":g},{default:p(({node:t})=>[a("span",L," ["+m(t.data.type)+"] ",1),a("span",null,m(t.label),1)]),_:1},8,["data"])])}}}),S=j(O,[["__scopeId","data-v-4be2eade"]]);export{S as default};