import{d as N,k as p,m as y,o as K,x as C,z as H,j as V,b as a,a as r,c as I,t as R,B as D,X as x,a0 as B,u as t,M as g}from"./vue.1703796278973.js";import{av as J,K as O,G as $,H as z,aw as E}from"./index.17037962789732.js";import"./index.170379627897319.js";import"./index.170379627897334.js";import"./index.170379627897315.js";import"./index.170379627897327.js";import G from"./HomePage.1703796278973.js";import{g as L,a as M}from"./apiPage.1703796278973.js";import{_ as q}from"./LeftTree.vue_vue_type_style_index_0_lang.1703796278973.js";import X from"./ChooseApi.1703796278973.js";import F from"./ApiDoes.1703796278973.js";import Q from"./ApiTest.1703796278973.js";import{u as W}from"./department.17037962789732.js";import{_ as Y}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897338.js";import"./index.1703796278973300.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./comm.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897333.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./index.1703796278973307.js";import"./InputCard.1703796278973.js";import"./utils.17037962789732.js";import"./index.170379627897318.js";const Z={class:"api-page-container"},ee={class:"top"},te={class:"url-page"},oe={key:0,class:"api-details"},se=N({name:"apiPage"}),ae=N({...se,props:{mode:null,showTitle:{type:Boolean},hasHome:{type:Boolean},code:null},setup(P){const n=P,S=W(),_=p(Boolean(n.hasHome)),f=p([]),T=(e,s={})=>{if(e.key==="home")return _.value=!0;if(k.value=s,!e.apiList)return;_.value=!1;const l=e.apiList,v=[];l==null||l.forEach(h=>{const{method:c,url:A}=h;for(const o in c)Object.prototype.hasOwnProperty.call(c,o)&&v.push({...c[o],url:A,method:o,id:c[o].operationId})}),f.value=v},u=p("does"),k=p({}),w={url:"",method:"",summary:"",parameters:[],responses:{},requestBody:{}},i=p(w),m=p([]),b=p([]),d=p({});U();function U(){j(),y(f,()=>{u.value="does",i.value=w}),y(()=>i.value.url,()=>u.value="does")}function j(){n.mode==="appManger"?L(n.code).then(e=>{m.value=e.result,b.value=[...e.result],d.value={}}):n.mode==="api"&&M().then(e=>{m.value=e.result,b.value=[...e.result]})}return y(()=>m.value,e=>{S.setSelectedKeys(e)}),y(()=>d.value,e=>{S.setChangedApis(e)}),(e,s)=>{const l=J,v=O,h=$,c=z,A=E;return K(),C("div",Z,[H("div",ee,[V(e.$slots,"top",{},void 0,!0)]),a(A,{gutter:24,class:"content"},{default:r(()=>[n.showTitle?(K(),I(l,{key:0,span:24,style:{"font-size":"16px","margin-bottom":"48px"}},{default:r(()=>[R(" API文档 ")]),_:1})):D("",!0),a(l,{span:5,class:"tree-content"},{default:r(()=>[a(q,{onSelect:T,mode:n.mode,"has-home":n.hasHome,code:n.code},null,8,["mode","has-home","code"])]),_:1}),a(l,{span:19},{default:r(()=>[x(a(G,null,null,512),[[B,t(_)]]),x(H("div",te,[x(a(X,{"click-api":t(i),"onUpdate:click-api":s[0]||(s[0]=o=>g(i)?i.value=o:null),selectedRowKeys:t(m),"onUpdate:selectedRowKeys":s[1]||(s[1]=o=>g(m)?m.value=o:null),changedApis:t(d),"onUpdate:changedApis":s[2]||(s[2]=o=>g(d)?d.value=o:null),"table-data":t(f),"source-keys":t(b),mode:n.mode,onRefresh:j},null,8,["click-api","selectedRowKeys","changedApis","table-data","source-keys","mode"]),[[B,!t(i).url]]),t(i).url&&t(f).length>0?(K(),C("div",oe,[a(v,{onClick:s[3]||(s[3]=o=>i.value=w),style:{"margin-bottom":"24px"}},{default:r(()=>[R("返回")]),_:1}),a(c,{activeKey:t(u),"onUpdate:activeKey":s[4]||(s[4]=o=>g(u)?u.value=o:null),type:"card"},{default:r(()=>[a(h,{key:"does",tab:"文档"},{default:r(()=>[a(F,{"select-api":t(i),schemas:t(k)},null,8,["select-api","schemas"])]),_:1}),a(h,{key:"test",tab:"调试"},{default:r(()=>[a(Q,{"select-api":t(i),schemas:t(k)},null,8,["select-api","schemas"])]),_:1})]),_:1},8,["activeKey"])])):D("",!0)],512),[[B,!t(_)]])]),_:1})]),_:1})])}}});const Ye=Y(ae,[["__scopeId","data-v-e5529119"]]);export{Ye as default};
