import{d as B,L as P,h as r,P as U,Y,r as u,o as b,f as I,w as l,a as n,b as a,c as M,H as X,a7 as c,a8 as _,k,t as $,x as z,l as m,a9 as G,E as q}from"./index.e3896b23.js";import{_ as H}from"./add-or-update.vue_vue_type_script_setup_true_lang.8494cd6a.js";import{u as j,c as J}from"./apiGroup.d1155eaa.js";import{f as K}from"./folder.ea536bf2.js";import{a as Q}from"./api.55cd055b.js";import{_ as W}from"./index.vue_vue_type_style_index_0_lang.0a9da65b.js";import"./add-or-update.vue_vue_type_script_setup_true_lang.536b089d.js";import"./database.32bfd96d.js";import"./apiConfig.09b7ec3b.js";import"./databases.vue_vue_type_style_index_0_lang.dceac0af.js";import"./database.235d7a89.js";import"./table.e1c1b00a.js";import"./readonly-studio.vue_vue_type_script_setup_true_lang.0062e564.js";import"./toggleHighContrast.483b4227.js";import"./add-or-update.vue_vue_type_script_setup_true_lang.fd8fc5c7.js";import"./middledb.vue_vue_type_style_index_0_lang.fa7bd4c1.js";import"./house.1ac0c09f.js";import"./sql-studio.a6fca977.js";import"./run.cf98bfe1.js";import"./ts.worker.921d436c.js";import"./sqlFormatter.e0a34ad5.js";import"./sql.4f48b9c1.js";import"./json-studio.vue_vue_type_style_index_0_lang.ef678733.js";import"./console-result.vue_vue_type_script_setup_true_lang.932f9a7d.js";import"./param-studio.vue_vue_type_script_setup_true_lang.e008bef0.js";import"./app-info.vue_vue_type_script_setup_true_lang.248d957f.js";import"./api-test.vue_vue_type_script_setup_true_lang.4a9f24d4.js";import"./app.22c193c2.js";import"./api-auth.vue_vue_type_script_setup_true_lang.77949b40.js";import"./api-auth-detail.vue_vue_type_script_setup_true_lang.b0bb75fb.js";const Z={class:"apiGroupBox",style:{height:"calc(100vh - 170px )"}},tt={class:"leftBox"},et={style:{height:"100%"},class:"apiGroupTreeDiv"},ot=n("br",null,null,-1),nt=n("br",null,null,-1),at={key:0},it=m("\u6DFB\u52A0\u6839\u76EE\u5F55"),lt=n("br",null,null,-1),st=n("br",null,null,-1),rt={class:"api-group-tree-node"},ut=["src"],pt=["src"],dt={style:{"margin-left":"8px"}},ct={class:"rightBox"},_t=m("\u6DFB\u52A0\u5B50\u76EE\u5F55"),mt=m("\u91CD\u547D\u540D"),ft=m("\u5220\u9664"),ht=B({name:"Data-serviceApi-groupIndex"}),Ht=B({...ht,props:{ifAuth:{type:Boolean,required:!1,default:()=>!1}},setup(w){const f=w;P(()=>{C()});const p=r(),v=r(),y=r([]),h=r(""),D=r(),C=()=>{j().then(t=>{y.value=t.data})};U(h,t=>{v.value.filter(t)});const A=(t,e)=>t?e.label.includes(t)||e.label.includes(t.toUpperCase())||e.label.includes(t.toLowerCase()):!0,E=()=>{p.value.init(null,0,"")},R=()=>{let t=o.optionData;p.value.init(null,t.id,t.path),s()},T=()=>{let t=o.optionData;p.value.init(t.id,t.parentId,t.parentPath,t.type),s()},F=()=>{s(),G.confirm("\u786E\u8BA4\u5220\u9664\u5417, \u63D0\u793A",{confirmButtonText:"\u662F",cancelButtonText:"\u5426",type:"warning"}).then(()=>{let t=o.optionData;J(t.id).then(e=>{q.success("\u5220\u9664\u6210\u529F\uFF01"),C()})})},o=Y({optionCardShow:!1,optionCardX:0,optionCardY:0,optionData:{},node:"",tree:""}),N=(t,e,d,i)=>{f.ifAuth||(o.optionCardShow=!1,o.optionCardX=t.x,o.optionCardY=t.y,o.optionData=e,o.node=d,o.tree=i,o.optionCardShow=!0)},s=t=>{var e=document.getElementById("option-button-group");e&&(o.optionCardShow=!1)},S=(t,e,d,i)=>{s(),console.log(e.data),e.data.type=="2"&&D.value.init(e.data.id,e.data.path,null,f.ifAuth)};return(t,e)=>{const d=u("el-input"),i=u("el-button"),V=u("el-tree"),L=u("el-scrollbar"),O=u("el-card");return b(),I(O,{onClick:e[1]||(e[1]=g=>s())},{default:l(()=>[n("div",Z,[n("div",tt,[a(L,null,{default:l(()=>[n("div",et,[n("div",null,[a(d,{modelValue:h.value,"onUpdate:modelValue":e[0]||(e[0]=g=>h.value=g),placeholder:"search"},null,8,["modelValue"]),ot,nt]),f.ifAuth?X("",!0):(b(),M("div",at,[a(i,{type:"primary",onClick:E},{default:l(()=>[it]),_:1}),lt,st])),a(V,{ref_key:"catalogueTreeRef",ref:v,data:y.value,onNodeContextmenu:N,onNodeClick:S,"default-expand-all":"","node-key":"id","filter-node-method":A},{default:l(({node:g,data:x})=>[n("div",rt,[n("span",null,[c(n("img",{src:k(K)},null,8,ut),[[_,x.type=="1"]]),c(n("img",{src:k(Q)},null,8,pt),[[_,x.type=="2"]]),n("span",dt,$(x.name),1)])])]),_:1},8,["data"])])]),_:1})]),n("div",ct,[a(W,{ref_key:"apiConfigRef",ref:D},null,512)])]),c(n("div",{style:z({"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"},[c(a(i,{onClick:R,class:"option-card-button"},{default:l(()=>[_t]),_:1},512),[[_,o.optionData.type=="1"]]),a(i,{onClick:T,class:"option-card-button"},{default:l(()=>[mt]),_:1}),a(i,{onClick:F,class:"option-card-button"},{default:l(()=>[ft]),_:1})],4),[[_,o.optionCardShow]]),a(H,{ref_key:"addOrUpdateRef",ref:p,onRefreshDataList:C},null,512)]),_:1})}}});export{Ht as default};
