import{d as B,L as M,h as r,P as U,Y,r as c,o as u,f as P,w as i,a as n,b as s,c as p,H as _,t as X,a7 as b,a8 as k,x as $,l as h,E as y,a9 as z}from"./index.e3896b23.js";import{f as H}from"./folder.ea536bf2.js";import{_ as j}from"./database.235d7a89.js";import{_ as q}from"./table.e1c1b00a.js";import{_ as G}from"./column.79595943.js";import{_ as J}from"./model.45425835.js";import{_ as K}from"./add-or-update.vue_vue_type_script_setup_true_lang.ae2729f2.js";import{l as Q,d as W}from"./metamodel.a560a346.js";import{_ as Z}from"./info.vue_vue_type_script_setup_true_lang.27dbafd7.js";import"./property-info.vue_vue_type_script_setup_true_lang.423cb64e.js";import"./property-add-or-update.vue_vue_type_script_setup_true_lang.9dc69a05.js";const ee={class:"metamodelBox",style:{height:"calc(100vh - 170px )"}},te={class:"leftBox"},oe={style:{height:"100%"},class:"metamodelTreeDiv"},ne=n("br",null,null,-1),se=n("br",null,null,-1),ae=h("\u6DFB\u52A0\u6839\u76EE\u5F55"),ie=n("br",null,null,-1),le=n("br",null,null,-1),re={class:"metamodel-tree-node"},ue={key:0,src:H},de={key:1,src:j},ce={key:2,src:q},pe={key:3,src:G},_e={key:4,src:J},me={style:{"margin-left":"8px"}},fe={class:"rightBox"},he=h("\u6DFB\u52A0\u5B50\u9879"),ge=h("\u4FEE\u6539"),Ce=h("\u5220\u9664"),ve=B({name:"Data-governanceMetamodelIndex"}),Se=B({...ve,setup(xe){M(()=>{C()});const m=r(),D=r(),w=r([]),g=r(""),E=r(),C=()=>{Q().then(e=>{w.value=e.data})};U(g,e=>{D.value.filter(e)});const F=(e,t)=>e?t.label.includes(e)||t.label.includes(e.toUpperCase())||t.label.includes(e.toLowerCase()):!0,N=()=>{m.value.init(null,0,"")},R=()=>{let e=o.optionData;m.value.init(null,e.id,e.path),d()},A=()=>{let e=o.optionData;if(e.builtin==1){y.warning("\u5185\u7F6E\u5143\u6A21\u578B\uFF0C\u4E0D\u53EF\u4FEE\u6539");return}m.value.init(e.id,e.parentId,e.parentPath),d()},S=()=>{let e=o.optionData;if(e.builtin==1){y.warning("\u5185\u7F6E\u5143\u6A21\u578B\uFF0C\u4E0D\u53EF\u5220\u9664");return}d(),z.confirm("\u786E\u8BA4\u5220\u9664\u5417, \u63D0\u793A",{confirmButtonText:"\u662F",cancelButtonText:"\u5426",type:"warning"}).then(()=>{W(e.id).then(t=>{y.success("\u5220\u9664\u6210\u529F\uFF01"),C()})})},o=Y({optionCardShow:!1,optionCardX:0,optionCardY:0,optionData:{},node:"",tree:""}),T=(e,t,f,a)=>{o.optionCardShow=!1,o.optionCardX=e.x,o.optionCardY=e.y,o.optionData=t,o.node=f,o.tree=a,o.optionCardShow=!0},d=e=>{var t=document.getElementById("option-button-group");t&&(o.optionCardShow=!1)},v=r(!1),V=(e,t,f,a)=>{d(),console.log(t.data),t.data.ifLeaf=="0"?(v.value=!0,E.value.init(t.data)):v.value=!1};return(e,t)=>{const f=c("el-input"),a=c("el-button"),I=c("el-tree"),L=c("el-scrollbar"),O=c("el-card");return u(),P(O,{onClick:t[1]||(t[1]=x=>d())},{default:i(()=>[n("div",ee,[n("div",te,[s(L,null,{default:i(()=>[n("div",oe,[n("div",null,[s(f,{modelValue:g.value,"onUpdate:modelValue":t[0]||(t[0]=x=>g.value=x),placeholder:"search"},null,8,["modelValue"]),ne,se]),n("div",null,[s(a,{type:"primary",onClick:N},{default:i(()=>[ae]),_:1}),ie,le]),s(I,{ref_key:"treeRef",ref:D,data:w.value,onNodeContextmenu:T,onNodeClick:V,"default-expand-all":"","node-key":"id","filter-node-method":F},{default:i(({node:x,data:l})=>[n("div",re,[n("span",null,[l.icon=="/src/assets/folder.png"?(u(),p("img",ue)):_("",!0),l.icon=="/src/assets/database.png"?(u(),p("img",de)):_("",!0),l.icon=="/src/assets/table.png"?(u(),p("img",ce)):_("",!0),l.icon=="/src/assets/column.png"?(u(),p("img",pe)):_("",!0),l.icon=="/src/assets/model.png"?(u(),p("img",_e)):_("",!0),n("span",me,X(l.name),1)])])]),_:1},8,["data"])])]),_:1})]),n("div",fe,[b(s(Z,{ref_key:"modelInfoRef",ref:E},null,512),[[k,v.value]])])]),b(n("div",{style:$({"z-index":9999,position:"fixed",left:o.optionCardX+"px",top:o.optionCardY+"px",width:"100px",background:"white","box-shadow":"0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"}),id:"option-button-group"},[b(s(a,{onClick:R,class:"option-card-button"},{default:i(()=>[he]),_:1},512),[[k,o.optionData.ifLeaf=="1"]]),s(a,{onClick:A,class:"option-card-button"},{default:i(()=>[ge]),_:1}),s(a,{onClick:S,class:"option-card-button"},{default:i(()=>[Ce]),_:1})],4),[[k,o.optionCardShow]]),s(K,{ref_key:"addOrUpdateRef",ref:m,onRefreshDataList:C},null,512)]),_:1})}}});export{Se as default};
