import{d as T,L as P,h as n,Y as H,r as _,o as d,f as N,w as i,a as o,b as s,c as f,H as u,t as R,a7 as D,a8 as w,x as K,l as m,a9 as j,E as q}from"./index.e3896b23.js";import{f as G}from"./folder.ea536bf2.js";import{_ as J}from"./database.235d7a89.js";import{_ as Q}from"./table.e1c1b00a.js";import{_ as W}from"./column.79595943.js";import{_ as Z}from"./model.45425835.js";import{_ as ee}from"./add-or-update.vue_vue_type_style_index_0_lang.1148389a.js";import{_ as te}from"./info.vue_vue_type_script_setup_true_lang.c67ba728.js";import{e as oe,f as ae,h as ne}from"./metadata.0c954be9.js";import"./metamodel.a560a346.js";import"./dataStandard.4ca18653.js";import"./standard-info.vue_vue_type_script_setup_true_lang.b31a2105.js";import"./standard-check.vue_vue_type_style_index_0_lang.45a8c9ee.js";import"./readonly-studio.vue_vue_type_script_setup_true_lang.0062e564.js";import"./toggleHighContrast.483b4227.js";const se={class:"metadataBox",style:{height:"calc(100vh - 170px )"}},le={class:"leftBox"},ie={style:{height:"100%"},class:"metadataTreeDiv"},re=o("br",null,null,-1),de=o("br",null,null,-1),ce=m("\u67E5\u8BE2"),ue=o("br",null,null,-1),pe=o("br",null,null,-1),_e=m("\u6DFB\u52A0\u6839\u76EE\u5F55"),fe=o("br",null,null,-1),me=o("br",null,null,-1),he={class:"metadata-tree-node"},ve={key:0,src:G},xe={key:1,src:J},ge={key:2,src:Q},ye={key:3,src:W},Ce={key:4,src:Z},ke={style:{"margin-left":"8px"}},be={class:"rightBox"},De=m("\u6DFB\u52A0\u5B50\u9879"),we=m("\u4FEE\u6539"),Be=m("\u5220\u9664"),Ee=T({name:"Data-governanceMetadata-manageIndex"}),Pe=T({...Ee,setup(Ne){P(()=>{k()});const h=n(),F=n(),y=n([]),v=n(""),B=n(),C=n(!1),I=n(!0),x=n(!0),k=()=>{g.value=!1,E()},S={label:"name",children:"children",isLeaf:"leaf"},V=async(e,t)=>{if(e.level==0)return t(y.value);if(e.level>=1)if(e.data.children)t(e.data.children);else{const{data:c}=await ae(e.data.id);t(c)}},E=()=>{v.value?(x.value=!1,C.value=!0):(x.value=!1,C.value=!1),oe(v.value).then(e=>{y.value=e.data,x.value=!0})},A=()=>{h.value.init(null,0,"")},z=()=>{let e=a.optionData;h.value.init(null,e.id,e.path),p()},L=()=>{let e=a.optionData;h.value.init(e.id,e.parentId,e.parentPath),p()},O=()=>{let e=a.optionData;p(),j.confirm("\u786E\u8BA4\u5220\u9664\u5417, \u63D0\u793A",{confirmButtonText:"\u662F",cancelButtonText:"\u5426",type:"warning"}).then(()=>{ne(e.id).then(t=>{q.success("\u5220\u9664\u6210\u529F\uFF01"),k()})})},a=H({optionCardShow:!1,optionCardX:0,optionCardY:0,optionData:{},node:"",tree:""}),M=(e,t,c,l)=>{a.optionCardShow=!1,a.optionCardX=e.x,a.optionCardY=e.y,a.optionData=t,a.node=c,a.tree=l,a.optionCardShow=!0},p=e=>{var t=document.getElementById("option-button-group");t&&(a.optionCardShow=!1)},g=n(!1),Y=(e,t,c,l)=>{p(),t.data.metamodelId?(g.value=!0,B.value.init(t.data)):g.value=!1};return(e,t)=>{const c=_("el-input"),l=_("el-button"),U=_("el-tree"),X=_("el-scrollbar"),$=_("el-card");return d(),N($,{onClick:t[1]||(t[1]=b=>p())},{default:i(()=>[o("div",se,[o("div",le,[s(X,null,{default:i(()=>[o("div",ie,[o("div",null,[s(c,{modelValue:v.value,"onUpdate:modelValue":t[0]||(t[0]=b=>v.value=b),placeholder:"search"},null,8,["modelValue"]),re,de,s(l,{type:"primary",onClick:E},{default:i(()=>[ce]),_:1}),ue,pe]),o("div",null,[s(l,{type:"primary",onClick:A},{default:i(()=>[_e]),_:1}),fe,me]),x.value?(d(),N(U,{key:0,ref_key:"treeRef",ref:F,props:S,load:V,lazy:I.value,data:y.value,onNodeContextmenu:M,"expand-on-click-node":!1,onNodeClick:Y,"default-expand-all":C.value,"node-key":"id"},{default:i(({node:b,data:r})=>[o("div",he,[o("span",null,[r.icon=="/src/assets/folder.png"?(d(),f("img",ve)):u("",!0),r.icon=="/src/assets/database.png"?(d(),f("img",xe)):u("",!0),r.icon=="/src/assets/table.png"?(d(),f("img",ge)):u("",!0),r.icon=="/src/assets/column.png"?(d(),f("img",ye)):u("",!0),r.icon=="/src/assets/model.png"?(d(),f("img",Ce)):u("",!0),o("span",ke,R(r.name)+"\u2003"+R(r.code),1)])])]),_:1},8,["lazy","data","default-expand-all"])):u("",!0)])]),_:1})]),o("div",be,[D(s(te,{ref_key:"meatadataInfoRef",ref:B},null,512),[[w,g.value]])])]),D(o("div",{style:K({"z-index":9999,position:"fixed",left:a.optionCardX+"px",top:a.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"},[D(s(l,{onClick:z,class:"option-card-button"},{default:i(()=>[De]),_:1},512),[[w,!a.optionData.leaf]]),s(l,{onClick:L,class:"option-card-button"},{default:i(()=>[we]),_:1}),s(l,{onClick:O,class:"option-card-button"},{default:i(()=>[Be]),_:1})],4),[[w,a.optionCardShow]]),s(ee,{ref_key:"addOrUpdateRef",ref:h,onRefreshDataList:k},null,512)]),_:1})}}});export{Pe as default};
