7 lines
32 KiB
JavaScript
7 lines
32 KiB
JavaScript
import{z as zyplayerApi,g as getZyplayerApiBaseUrl}from"./custom.471d0de0.js";import{_ as _export_sfc}from"./main.5fd30069.js";import{r as resolveComponent,o as openBlock,c as createBlock,w as withCtx,e as createBaseVNode,t as toDisplayString,k as createTextVNode,D as DownOutlined,U as UserOutlined,b as createElementBlock,a as createVNode,m as withModifiers,F as Fragment,S as StarOutlined,n as SettingOutlined,C as CarryOutOutlined,p as FileTextOutlined,q as DashboardOutlined,I as InfoCircleOutlined,s as createCommentVNode,d as renderList,u as useStore,v as useRoute,x as useRouter,y as ref,B as message,E as nextTick,G as EllipsisOutlined,H as EditOutlined,J as DeleteOutlined,L as FolderAddOutlined,M as ApiOutlined,P as PlusOutlined,R as ReloadOutlined,N as watch,O as resolveDirective,Q as withDirectives,T as Modal,V as ExclamationCircleOutlined,W as onMounted,X as vShow,Y as BarChartOutlined,Z as MenuFoldOutlined,_ as MenuUnfoldOutlined,$ as pushScopeId,a0 as popScopeId}from"./vendor.6399378c.js";import{a as analysisSwaggerData,g as getTreeDataForTag,b as analysisOpenApiData,c as getTreeDataForTag$1,d as getTreeDataForTag$2,L as LeftResize,_ as _imports_0}from"./api-logo.e800ca99.js";const _sfc_main$8={data(){return{aboutDialogVisible:!1,upgradeInfo:{}}},mounted(){this.checkSystemUpgrade()},methods:{show(){this.aboutDialogVisible=!0},checkSystemUpgrade(){zyplayerApi.systemUpgradeInfo({}).then(d=>{d.data&&(this.upgradeInfo=d.data,this.upgradeInfo.upgradeContent&&(this.upgradeInfo.upgradeContent=this.upgradeInfo.upgradeContent.replaceAll("\uFF1B",`
|
|
`),console.log(`zyplayer-doc\u53D1\u73B0\u65B0\u7248\u672C\uFF1A
|
|
\u5347\u7EA7\u5730\u5740\uFF1A`+d.data.upgradeUrl+`
|
|
\u5F53\u524D\u7248\u672C\uFF1A`+d.data.nowVersion+`
|
|
\u6700\u65B0\u7248\u672C\uFF1A`+d.data.lastVersion+`
|
|
\u5347\u7EA7\u5185\u5BB9\uFF1A`+d.data.upgradeContent)))})}}},_hoisted_1$7={style:{}},_hoisted_2$6=createBaseVNode("div",{style:{"font-weight":"bold","font-size":"25px"}},"zyplayer-doc",-1),_hoisted_3$6={style:{"line-height":"30px",padding:"10px 0"}},_hoisted_4$4=createBaseVNode("div",{style:{"margin-bottom":"30px"}},"\u4E13\u6CE8\u4E8E\u79C1\u6709\u5316\u90E8\u7F72\u7684\u5728\u7EBF\u77E5\u8BC6\u5E93\u7BA1\u7406\u5E73\u53F0",-1),_hoisted_5$4=createBaseVNode("div",null,[createTextVNode("\u7248\u6743\u6240\u6709 \xA9 2018-2023 "),createBaseVNode("a",{target:"_blank",href:"https://doc.zyplayer.com"},"doc.zyplayer.com")],-1);function _sfc_render$8(d,t,a,o,s,f){const u=resolveComponent("a-modal");return openBlock(),createBlock(u,{visible:s.aboutDialogVisible,"onUpdate:visible":t[0]||(t[0]=n=>s.aboutDialogVisible=n),title:"\u5173\u4E8E",width:"600px",footer:null},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$7,[_hoisted_2$6,createBaseVNode("div",_hoisted_3$6,[_hoisted_4$4,createBaseVNode("div",null,"\u5F53\u524D\u7248\u672C "+toDisplayString(s.upgradeInfo.nowVersion||"1.0.0"),1),_hoisted_5$4])])]),_:1},8,["visible"])}var aboutDialog=_export_sfc(_sfc_main$8,[["render",_sfc_render$8]]),HeaderAvatar_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$7={name:"HeaderAvatar",data(){return{currUser:{}}},components:{DownOutlined,UserOutlined,aboutDialog},mounted(){this.getSelfUserInfo()},methods:{showAbout(){this.$refs.aboutDialog.show()},showConsole(){window.open(getZyplayerApiBaseUrl(),"_blank")},showMyInfo(){this.$router.push({path:"/user/myInfo"})},userSignOut(){zyplayerApi.userLogout().then(()=>{location.reload()})},getSelfUserInfo(){zyplayerApi.getSelfUserInfo().then(d=>{this.currUser=d.data})}}},_hoisted_1$6=createTextVNode("\u63A7\u5236\u53F0"),_hoisted_2$5=createTextVNode("\u5173\u4E8E"),_hoisted_3$5=createTextVNode("\u9000\u51FA\u767B\u5F55");function _sfc_render$7(d,t,a,o,s,f){const u=resolveComponent("UserOutlined"),n=resolveComponent("a-menu-item"),y=resolveComponent("a-menu-divider"),i=resolveComponent("a-menu"),c=resolveComponent("a-dropdown"),p=resolveComponent("about-dialog");return openBlock(),createElementBlock(Fragment,null,[createVNode(c,{trigger:"click"},{overlay:withCtx(()=>[createVNode(i,null,{default:withCtx(()=>[createVNode(n,{onClick:f.showConsole,key:"1"},{default:withCtx(()=>[_hoisted_1$6]),_:1},8,["onClick"]),createVNode(y),createVNode(n,{onClick:f.showAbout,key:"2"},{default:withCtx(()=>[_hoisted_2$5]),_:1},8,["onClick"]),createVNode(n,{onClick:f.userSignOut,key:"4"},{default:withCtx(()=>[_hoisted_3$5]),_:1},8,["onClick"])]),_:1})]),default:withCtx(()=>[createBaseVNode("a",{class:"ant-dropdown-link",onClick:t[0]||(t[0]=withModifiers(()=>{},["prevent"])),style:{display:"inline-block",height:"100%","vertical-align":"initial"}},[createVNode(u),createTextVNode(" "+toDisplayString(s.currUser.userName||"-"),1)])]),_:1}),createVNode(p,{ref:"aboutDialog"},null,512)],64)}var HeaderAvatar=_export_sfc(_sfc_main$7,[["render",_sfc_render$7],["__scopeId","data-v-6260e1ae"]]);const _sfc_main$6={name:"MenuLayoutChildren",props:{menuItem:Object},data(){return{}},components:{StarOutlined,SettingOutlined,CarryOutOutlined,FileTextOutlined,DashboardOutlined,InfoCircleOutlined},methods:{haveShowChildren(d){return d.filter(t=>!t.meta||!t.meta.hidden).length>0}}};function _sfc_render$6(d,t,a,o,s,f){const u=resolveComponent("SettingOutlined"),n=resolveComponent("FileTextOutlined"),y=resolveComponent("MenuLayoutChildren"),i=resolveComponent("a-sub-menu"),c=resolveComponent("DashboardOutlined"),p=resolveComponent("InfoCircleOutlined"),h=resolveComponent("router-link"),C=resolveComponent("a-menu-item");return!a.menuItem.meta||!a.menuItem.meta.hidden?(openBlock(),createElementBlock(Fragment,{key:0},[a.menuItem.children?(openBlock(),createElementBlock(Fragment,{key:0},[f.haveShowChildren(a.menuItem.children)?(openBlock(),createBlock(i,{key:a.menuItem.path},{title:withCtx(()=>[a.menuItem.meta?(openBlock(),createElementBlock(Fragment,{key:0},[a.menuItem.meta.icon==="SettingOutlined"?(openBlock(),createBlock(u,{key:0})):createCommentVNode("",!0),a.menuItem.meta.icon==="FileTextOutlined"?(openBlock(),createBlock(n,{key:1})):createCommentVNode("",!0)],64)):createCommentVNode("",!0),createBaseVNode("span",null,toDisplayString(a.menuItem.name),1)]),default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.menuItem.children,k=>(openBlock(),createBlock(y,{menuItem:k},null,8,["menuItem"]))),256))]),_:1})):createCommentVNode("",!0)],64)):(openBlock(),createBlock(C,{key:a.menuItem.path},{default:withCtx(()=>[createVNode(h,{to:{path:a.menuItem.path,query:a.menuItem.query}},{default:withCtx(()=>[a.menuItem.meta?(openBlock(),createElementBlock(Fragment,{key:0},[a.menuItem.meta.icon==="DashboardOutlined"?(openBlock(),createBlock(c,{key:0})):createCommentVNode("",!0),a.menuItem.meta.icon==="FileTextOutlined"?(openBlock(),createBlock(n,{key:1})):createCommentVNode("",!0),a.menuItem.meta.icon==="InfoCircleOutlined"?(openBlock(),createBlock(p,{key:2})):createCommentVNode("",!0)],64)):createCommentVNode("",!0),createBaseVNode("span",null,toDisplayString(a.menuItem.name),1)]),_:1},8,["to"])]),_:1}))],64)):createCommentVNode("",!0)}var MenuChildrenLayout=_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]),Swagger_vue_vue_type_style_index_0_lang="";const _sfc_main$5={components:{InfoCircleOutlined,FileTextOutlined},setup(){const store=useStore();useRoute();const router=useRouter();let tagPathMap=ref({}),swaggerDoc=ref({}),treeData=ref([]),expandedKeys=ref([]),choiceDocId=ref("");const docChecked=(d,t)=>{if(t.node.key==="info")router.push({path:"/swagger/info"});else if(t.node.isLeaf){let a=t.node.dataRef;router.push({path:"/swagger/view",query:a.query})}},loadDoc=(d,t,a)=>{choiceDocId.value=d,zyplayerApi.apiDocApisDetail({id:d}).then(o=>{let s=toJsonObj(o.data);if(typeof s!="object"||!s.swagger){a(!1),message.error("\u83B7\u53D6\u6587\u6863\u6570\u636E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u6587\u6863\u662F\u5426\u4E3A\u6807\u51C6\u7684Swagger\u6587\u6863\u683C\u5F0F");return}swaggerDoc.value=s,store.commit("setSwaggerDoc",s);let f=analysisSwaggerData(s);store.commit("setSwaggerUrlMethodMap",f.urlMethodMap),store.commit("setSwaggerMethodStatistic",f.methodStatistic),tagPathMap.value=f.tagPathMap,loadTreeData(t),a(!0)}).catch(()=>{a(!1)})},loadTreeData=async d=>{let t={id:choiceDocId.value};treeData.value=getTreeDataForTag(swaggerDoc.value,tagPathMap.value,d,t),treeData.value.unshift({key:"info",title:"\u6587\u6863\u8BF4\u660E\u4FE1\u606F",isLeaf:!0}),await nextTick(),expandedKeys.value=["main"]},toJsonObj=value=>{if(typeof value!="string")return value;try{return JSON.parse(value)}catch(e){try{return eval("("+value+")")}catch(d){return value||void 0}}};return{expandedKeys,docChecked,loadDoc,loadTreeData,treeData}}},_hoisted_1$5=createTextVNode("get"),_hoisted_2$4=createTextVNode("post"),_hoisted_3$4=createTextVNode("put"),_hoisted_4$3=createTextVNode("head"),_hoisted_5$3=createTextVNode("patch"),_hoisted_6$2=createTextVNode("delete"),_hoisted_7$2=createTextVNode("options"),_hoisted_8$2=createTextVNode("trace"),_hoisted_9$2={style:{margin:"0 6px 0 3px"}};function _sfc_render$5(d,t,a,o,s,f){const u=resolveComponent("file-text-outlined"),n=resolveComponent("a-tag"),y=resolveComponent("a-badge"),i=resolveComponent("a-directory-tree");return openBlock(),createBlock(i,{showIcon:!1,"tree-data":o.treeData,expandedKeys:o.expandedKeys,"onUpdate:expandedKeys":t[0]||(t[0]=c=>o.expandedKeys=c),onSelect:o.docChecked},{title:withCtx(({title:c,isLeaf:p,method:h,children:C,key:k})=>[k==="info"?(openBlock(),createBlock(u,{key:0,style:{"margin-right":"3px"}})):createCommentVNode("",!0),p?(openBlock(),createElementBlock(Fragment,{key:1},[h==="get"?(openBlock(),createBlock(n,{key:0,color:"pink"},{default:withCtx(()=>[_hoisted_1$5]),_:1})):h==="post"?(openBlock(),createBlock(n,{key:1,color:"red"},{default:withCtx(()=>[_hoisted_2$4]),_:1})):h==="put"?(openBlock(),createBlock(n,{key:2,color:"orange"},{default:withCtx(()=>[_hoisted_3$4]),_:1})):h==="head"?(openBlock(),createBlock(n,{key:3,color:"green"},{default:withCtx(()=>[_hoisted_4$3]),_:1})):h==="patch"?(openBlock(),createBlock(n,{key:4,color:"cyan"},{default:withCtx(()=>[_hoisted_5$3]),_:1})):h==="delete"?(openBlock(),createBlock(n,{key:5,color:"blue"},{default:withCtx(()=>[_hoisted_6$2]),_:1})):h==="options"?(openBlock(),createBlock(n,{key:6,color:"purple"},{default:withCtx(()=>[_hoisted_7$2]),_:1})):h==="trace"?(openBlock(),createBlock(n,{key:7,color:"purple"},{default:withCtx(()=>[_hoisted_8$2]),_:1})):createCommentVNode("",!0)],64)):createCommentVNode("",!0),createBaseVNode("span",_hoisted_9$2,toDisplayString(c),1),C?(openBlock(),createBlock(y,{key:2,count:C.length,"number-style":{backgroundColor:"#fff",color:"#999",boxShadow:"0 0 0 1px #d9d9d9 inset"}},null,8,["count"])):createCommentVNode("",!0)]),_:1},8,["tree-data","expandedKeys","onSelect"])}var DocTreeSwagger=_export_sfc(_sfc_main$5,[["render",_sfc_render$5]]),OpenApi_vue_vue_type_style_index_0_lang="";const _sfc_main$4={components:{InfoCircleOutlined,FileTextOutlined},setup(){const store=useStore();useRoute();const router=useRouter();let tagPathMap=ref({}),openApiDoc=ref({}),treeData=ref([]),expandedKeys=ref([]),choiceDocId=ref("");const docChecked=(d,t)=>{if(t.node.key==="info")router.push({path:"/openapi/info"});else if(t.node.isLeaf){let a=t.node.dataRef;router.push({path:"/openapi/view",query:a.query})}},loadDoc=(d,t,a)=>{choiceDocId.value=d,zyplayerApi.apiDocApisDetail({id:d}).then(o=>{let s=toJsonObj(o.data);if(typeof s!="object"||!s.openapi){a(!1),message.error("\u83B7\u53D6\u6587\u6863\u6570\u636E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u6587\u6863\u662F\u5426\u4E3A\u6807\u51C6\u7684OpenApi\u6587\u6863\u683C\u5F0F");return}openApiDoc.value=s,store.commit("setOpenApiDoc",s);let f=analysisOpenApiData(s);store.commit("setOpenApiUrlMethodMap",f.urlMethodMap),store.commit("setOpenApiMethodStatistic",f.methodStatistic),tagPathMap.value=f.tagPathMap,loadTreeData(t),a(!0)}).catch(()=>{a(!1)})},loadTreeData=async d=>{let t={id:choiceDocId.value};treeData.value=getTreeDataForTag$1(openApiDoc.value,tagPathMap.value,d,t),treeData.value.unshift({key:"info",title:"\u6587\u6863\u8BF4\u660E\u4FE1\u606F",isLeaf:!0}),await nextTick(),expandedKeys.value=["main"]},toJsonObj=value=>{if(typeof value!="string")return value;try{return JSON.parse(value)}catch(e){try{return eval("("+value+")")}catch(d){return value||void 0}}};return{expandedKeys,docChecked,loadDoc,loadTreeData,treeData}}},_hoisted_1$4=createTextVNode("get"),_hoisted_2$3=createTextVNode("post"),_hoisted_3$3=createTextVNode("put"),_hoisted_4$2=createTextVNode("head"),_hoisted_5$2=createTextVNode("patch"),_hoisted_6$1=createTextVNode("delete"),_hoisted_7$1=createTextVNode("options"),_hoisted_8$1=createTextVNode("trace"),_hoisted_9$1={style:{margin:"0 6px 0 3px","word-break":"break-all"}};function _sfc_render$4(d,t,a,o,s,f){const u=resolveComponent("file-text-outlined"),n=resolveComponent("a-tag"),y=resolveComponent("a-badge"),i=resolveComponent("a-directory-tree");return openBlock(),createBlock(i,{showIcon:!1,"tree-data":o.treeData,expandedKeys:o.expandedKeys,"onUpdate:expandedKeys":t[0]||(t[0]=c=>o.expandedKeys=c),onSelect:o.docChecked},{title:withCtx(({title:c,isLeaf:p,method:h,children:C,key:k})=>[k==="info"?(openBlock(),createBlock(u,{key:0,style:{"margin-right":"3px"}})):createCommentVNode("",!0),p?(openBlock(),createElementBlock(Fragment,{key:1},[h==="get"?(openBlock(),createBlock(n,{key:0,color:"pink"},{default:withCtx(()=>[_hoisted_1$4]),_:1})):h==="post"?(openBlock(),createBlock(n,{key:1,color:"red"},{default:withCtx(()=>[_hoisted_2$3]),_:1})):h==="put"?(openBlock(),createBlock(n,{key:2,color:"orange"},{default:withCtx(()=>[_hoisted_3$3]),_:1})):h==="head"?(openBlock(),createBlock(n,{key:3,color:"green"},{default:withCtx(()=>[_hoisted_4$2]),_:1})):h==="patch"?(openBlock(),createBlock(n,{key:4,color:"cyan"},{default:withCtx(()=>[_hoisted_5$2]),_:1})):h==="delete"?(openBlock(),createBlock(n,{key:5,color:"blue"},{default:withCtx(()=>[_hoisted_6$1]),_:1})):h==="options"?(openBlock(),createBlock(n,{key:6,color:"purple"},{default:withCtx(()=>[_hoisted_7$1]),_:1})):h==="trace"?(openBlock(),createBlock(n,{key:7,color:"purple"},{default:withCtx(()=>[_hoisted_8$1]),_:1})):createCommentVNode("",!0)],64)):createCommentVNode("",!0),createBaseVNode("span",_hoisted_9$1,toDisplayString(c),1),C?(openBlock(),createBlock(y,{key:2,count:C.length,"number-style":{backgroundColor:"#fff",color:"#999",boxShadow:"0 0 0 1px #d9d9d9 inset"}},null,8,["count"])):createCommentVNode("",!0)]),_:1},8,["tree-data","expandedKeys","onSelect"])}var DocTreeOpenApi=_export_sfc(_sfc_main$4,[["render",_sfc_render$4]]),CustomRequest_vue_vue_type_style_index_0_lang="";const _sfc_main$3={components:{InfoCircleOutlined,FileTextOutlined,EllipsisOutlined,EditOutlined,DeleteOutlined,FolderAddOutlined,ApiOutlined,PlusOutlined,ReloadOutlined},setup(){const d=useStore();useRoute();const t=useRouter();let a={},o=ref([]),s=ref(["main"]),f=ref([]),u="",n="";const y=(l,r)=>{if(r.node.isLeaf){let m=r.node.dataRef;t.push({path:"/custom/request",query:m.query})}},i=(l,r,m=()=>{})=>{u=l,zyplayerApi.apiDocApisDetail({id:l}).then(x=>{let w=x.data;if(!w&&w.length!=1){m(!1),message.error("\u83B7\u53D6\u6587\u6863\u6570\u636E\u5931\u8D25");return}a=w,d.commit("setCustomRequestDoc",w),h(r),m(!0)}).catch(()=>{m(!1)})};let c={treeRequestMap:{},originNodeMap:{}};const p=l=>{l.forEach(r=>{r.isLeaf&&r.nodeId?c.treeRequestMap[r.nodeId]=r:r.children&&p(r.children)})},h=async l=>{let r={id:u};n=l,o.value=getTreeDataForTag$2(a,l,r,c),p(o.value)};watch(d.getters.getCustomRequestChange,()=>{let l=d.state.customRequestChange;if(l&&l.nodeId&&l.nodeName){let r=c.treeRequestMap[l.nodeId];r&&(r.method=l.method,r.title=l.nodeName);let m=c.originNodeMap[l.nodeId];m&&(m.method=l.method,m.nodeName=l.nodeName)}}),watch(d.getters.getActivePage,()=>{let l=d.state.activePage;B(l.query.nodeId)});const C=(l,r)=>{l&&(r.data.editing=!1)},k=l=>{let r=l.data.titleEditing;r!==l.data.title&&zyplayerApi.apiCustomNodeUpdate({id:l.data.nodeId,nodeName:r}).then(m=>{l.data.title=r;let x=c.originNodeMap[l.data.nodeId];x&&(x.name=r),l.data.editing=!1,message.success("\u4FEE\u6539\u6210\u529F")})},v=(l,r)=>{l.key==="delete"&&Modal.confirm({title:"\u5220\u9664\u786E\u8BA4",maskClosable:!0,icon:createVNode(ExclamationCircleOutlined),content:"\u4F60\u786E\u5B9A\u8981\u5220\u9664\u6B64\u63A5\u53E3\u5417\uFF1F",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",onOk(){zyplayerApi.apiCustomNodeDelete({id:r.data.nodeId}).then(m=>{message.success("\u5220\u9664\u6210\u529F"),i(u,n)})}})},g=(l,r)=>{if(l.key==="newFolder"){let m={nodeType:0,docId:u,parentId:r.nodeId,nodeName:"\u65B0\u5EFA\u6587\u4EF6\u5939",nodeDesc:""};zyplayerApi.apiCustomNodeAdd(m).then(x=>{i(u,n)})}else if(l.key==="newRequest"){let m={nodeType:1,docId:u,parentId:r.nodeId,nodeName:"\u65B0\u5EFA\u63A5\u53E3",method:"get",apiUrl:""};zyplayerApi.apiCustomNodeAdd(m).then(x=>{let w=x.data,_={id:u,nodeId:w.id};t.push({path:"/custom/request",query:_}),i(u,n,()=>{B(w.id)})})}else l.key==="refresh"?i(u,n,m=>{m&&message.success("\u91CD\u65B0\u52A0\u8F7D\u6210\u529F")}):l.key==="edit"?r.data.editing=!0:l.key==="delete"&&Modal.confirm({title:"\u5220\u9664\u786E\u8BA4",maskClosable:!0,icon:createVNode(ExclamationCircleOutlined),content:"\u4F60\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6587\u4EF6\u5939\u53CA\u76EE\u5F55\u4E0B\u6240\u6709\u4E8C\u7EA7\u76EE\u5F55\u548C\u63A5\u53E3\u5417\uFF1F",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",onOk(){zyplayerApi.apiCustomNodeDelete({id:r.data.nodeId}).then(m=>{message.success("\u5220\u9664\u6210\u529F"),i(u,n)})}})},B=l=>{let r=c.treeRequestMap[l];r&&(f.value=[r.key])};return{expandedKeys:s,selectedKeys:f,editFolderVisibleChange:C,editFolderSave:k,docChecked:y,treeDataDragEnd:l=>{let r={id:l.dragNode.nodeId,parentId:l.node.nodeId,targetType:0};l.dropToGap?(console.log(`\u653E\u5165${l.node.key}\u7684\u540E\u9762`),r.targetType=1):console.log(`\u653E\u5165${l.node.key}\u6587\u4EF6\u5939\u5185`),zyplayerApi.apiCustomNodeChangeParent(r).then(m=>{message.success("\u4FEE\u6539\u6392\u5E8F\u6210\u529F"),i(u,n)}),console.log(l)},loadDoc:i,loadTreeData:h,treeData:o,handleFolderDropdownClick:g,handleApiTitleDropdownClick:v}}},_hoisted_1$3={class:"doc-tree-box"},_hoisted_2$2={key:0,class:"api-title-line"},_hoisted_3$2={class:"tree-title-text"},_hoisted_4$1={key:1,class:"api-title-line"},_hoisted_5$1={class:"tree-title-text"},_hoisted_6=createTextVNode(" \u65B0\u5EFA\u63A5\u53E3"),_hoisted_7=createTextVNode(" \u65B0\u5EFA\u6587\u4EF6\u5939"),_hoisted_8=createTextVNode(" \u5237\u65B0"),_hoisted_9={key:2,class:"api-title-line"},_hoisted_10=createTextVNode("get"),_hoisted_11=createTextVNode("post"),_hoisted_12=createTextVNode("put"),_hoisted_13=createTextVNode("head"),_hoisted_14=createTextVNode("patch"),_hoisted_15=createTextVNode("delete"),_hoisted_16=createTextVNode("options"),_hoisted_17=createTextVNode("trace"),_hoisted_18={class:"tree-title-text"},_hoisted_19=createTextVNode(" \u5220\u9664"),_hoisted_20={key:3,class:"api-title-line"},_hoisted_21={style:{"margin-top":"10px","text-align":"right"}},_hoisted_22=createTextVNode("\u4FDD\u5B58"),_hoisted_23={class:"tree-title-text"},_hoisted_24=createTextVNode(" \u65B0\u5EFA\u63A5\u53E3"),_hoisted_25=createTextVNode(" \u65B0\u5EFA\u6587\u4EF6\u5939"),_hoisted_26=createTextVNode(" \u7F16\u8F91"),_hoisted_27=createTextVNode(" \u5220\u9664");function _sfc_render$3(d,t,a,o,s,f){const u=resolveComponent("file-text-outlined"),n=resolveComponent("a-badge"),y=resolveComponent("ellipsis-outlined"),i=resolveComponent("plus-outlined"),c=resolveComponent("a-menu-item"),p=resolveComponent("folder-add-outlined"),h=resolveComponent("reload-outlined"),C=resolveComponent("a-menu"),k=resolveComponent("a-dropdown"),v=resolveComponent("a-tag"),g=resolveComponent("delete-outlined"),B=resolveComponent("a-input"),V=resolveComponent("a-button"),l=resolveComponent("a-popover"),r=resolveComponent("a-menu-divider"),m=resolveComponent("edit-outlined"),x=resolveComponent("a-directory-tree"),w=resolveDirective("autofocus");return openBlock(),createElementBlock("div",_hoisted_1$3,[createVNode(x,{showIcon:!1,"tree-data":o.treeData,expandedKeys:o.expandedKeys,"onUpdate:expandedKeys":t[3]||(t[3]=_=>o.expandedKeys=_),selectedKeys:o.selectedKeys,"onUpdate:selectedKeys":t[4]||(t[4]=_=>o.selectedKeys=_),draggable:"",onDrop:o.treeDataDragEnd,onSelect:o.docChecked},{title:withCtx(_=>[_.key==="info"?(openBlock(),createElementBlock("div",_hoisted_2$2,[createVNode(u,{style:{"margin-right":"3px"}}),createBaseVNode("span",_hoisted_3$2,toDisplayString(_.title),1)])):createCommentVNode("",!0),_.key==="main"?(openBlock(),createElementBlock("div",_hoisted_4$1,[createBaseVNode("span",_hoisted_5$1,toDisplayString(_.title),1),createVNode(n,{count:_.children.length,showZero:"","number-style":{backgroundColor:"#fff",color:"#999",boxShadow:"0 0 0 1px #d9d9d9 inset"}},null,8,["count"]),createVNode(k,{trigger:["click"]},{overlay:withCtx(()=>[createVNode(C,{onClick:N=>o.handleFolderDropdownClick(N,_)},{default:withCtx(()=>[createVNode(c,{key:"newRequest"},{default:withCtx(()=>[createVNode(i),_hoisted_6]),_:1}),createVNode(c,{key:"newFolder"},{default:withCtx(()=>[createVNode(p),_hoisted_7]),_:1}),createVNode(c,{key:"refresh"},{default:withCtx(()=>[createVNode(h),_hoisted_8]),_:1})]),_:2},1032,["onClick"])]),default:withCtx(()=>[createBaseVNode("span",{onClick:t[0]||(t[0]=withModifiers(()=>{},["stop"])),style:{padding:"3px 10px"}},[createVNode(y)])]),_:2},1024)])):createCommentVNode("",!0),_.isLeaf?(openBlock(),createElementBlock("div",_hoisted_9,[_.method==="get"?(openBlock(),createBlock(v,{key:0,color:"pink"},{default:withCtx(()=>[_hoisted_10]),_:1})):_.method==="post"?(openBlock(),createBlock(v,{key:1,color:"red"},{default:withCtx(()=>[_hoisted_11]),_:1})):_.method==="put"?(openBlock(),createBlock(v,{key:2,color:"orange"},{default:withCtx(()=>[_hoisted_12]),_:1})):_.method==="head"?(openBlock(),createBlock(v,{key:3,color:"green"},{default:withCtx(()=>[_hoisted_13]),_:1})):_.method==="patch"?(openBlock(),createBlock(v,{key:4,color:"cyan"},{default:withCtx(()=>[_hoisted_14]),_:1})):_.method==="delete"?(openBlock(),createBlock(v,{key:5,color:"blue"},{default:withCtx(()=>[_hoisted_15]),_:1})):_.method==="options"?(openBlock(),createBlock(v,{key:6,color:"purple"},{default:withCtx(()=>[_hoisted_16]),_:1})):_.method==="trace"?(openBlock(),createBlock(v,{key:7,color:"purple"},{default:withCtx(()=>[_hoisted_17]),_:1})):createCommentVNode("",!0),createBaseVNode("span",_hoisted_18,[createTextVNode(toDisplayString(_.title)+" ",1),createVNode(k,{trigger:["click"],class:"api-title-dropdown"},{overlay:withCtx(()=>[createVNode(C,{onClick:N=>o.handleApiTitleDropdownClick(N,_)},{default:withCtx(()=>[createVNode(c,{key:"delete"},{default:withCtx(()=>[createVNode(g),_hoisted_19]),_:1})]),_:2},1032,["onClick"])]),default:withCtx(()=>[createBaseVNode("span",{onClick:t[1]||(t[1]=withModifiers(()=>{},["stop"])),style:{padding:"3px 10px"}},[createVNode(y)])]),_:2},1024)])])):_.nodeId?(openBlock(),createElementBlock("div",_hoisted_20,[createVNode(l,{visible:_.data.editing,"onUpdate:visible":N=>_.data.editing=N,placement:"rightTop",title:"\u7F16\u8F91\u540D\u79F0",trigger:"click",onVisibleChange:N=>o.editFolderVisibleChange(N,_)},{content:withCtx(()=>[withDirectives(createVNode(B,{value:_.data.titleEditing,"onUpdate:value":N=>_.data.titleEditing=N},null,8,["value","onUpdate:value"]),[[w]]),createBaseVNode("div",_hoisted_21,[createVNode(V,{onClick:N=>o.editFolderSave(_),type:"primary"},{default:withCtx(()=>[_hoisted_22]),_:2},1032,["onClick"])])]),default:withCtx(()=>[createBaseVNode("span",_hoisted_23,toDisplayString(_.title),1)]),_:2},1032,["visible","onUpdate:visible","onVisibleChange"]),createVNode(n,{count:_.children.length,showZero:"","number-style":{backgroundColor:"#fff",color:"#999",boxShadow:"0 0 0 1px #d9d9d9 inset"}},null,8,["count"]),createVNode(k,{trigger:["click"]},{overlay:withCtx(()=>[createVNode(C,{onClick:N=>o.handleFolderDropdownClick(N,_)},{default:withCtx(()=>[createVNode(c,{key:"newRequest"},{default:withCtx(()=>[createVNode(i),_hoisted_24]),_:1}),createVNode(c,{key:"newFolder"},{default:withCtx(()=>[createVNode(p),_hoisted_25]),_:1}),createVNode(r),createVNode(c,{key:"edit"},{default:withCtx(()=>[createVNode(m),_hoisted_26]),_:1}),createVNode(c,{key:"delete"},{default:withCtx(()=>[createVNode(g),_hoisted_27]),_:1})]),_:2},1032,["onClick"])]),default:withCtx(()=>[createBaseVNode("span",{onClick:t[2]||(t[2]=withModifiers(()=>{},["stop"])),style:{padding:"3px 10px"}},[createVNode(y)])]),_:2},1024)])):createCommentVNode("",!0)]),_:1},8,["tree-data","expandedKeys","selectedKeys","onDrop","onSelect"])])}var CustomRequest=_export_sfc(_sfc_main$3,[["render",_sfc_render$3]]),MenuLayout_vue_vue_type_style_index_0_lang="";const _sfc_main$2={props:{collapsed:{type:Boolean,default:!1}},components:{MenuChildrenLayout,DocTreeSwagger,DocTreeOpenApi,CustomRequest},setup(d){const t=useStore(),a=useRoute(),o=useRouter();let s=ref([]),f=ref([]),u=ref([]),n=ref(!1),y=ref([]),i=ref(),c=ref(""),p=ref({});const h=()=>{zyplayerApi.docApiGlobalParamList().then(r=>{let m=r.data||[];t.commit("setGlobalParam",m)})},C=()=>{zyplayerApi.apiDocApis().then(r=>{y.value=r.data||[],y.value.length>0&&!i.value&&(a.path==="/swagger/view"&&a.query.id||a.path==="/openapi/view"&&a.query.id||a.path==="/custom/request"&&a.query.id?i.value=parseInt(a.query.id):i.value=y.value[0].id,B())})};let k=ref(),v=ref(),g=ref();const B=async()=>{if(n.value=!0,p.value=y.value.find(m=>m.id===i.value),!p.value){message.error("\u672A\u627E\u5230\u5BF9\u5E94\u7684\u6587\u6863\u5730\u5740\u4FE1\u606F");return}await nextTick();const r=m=>{m&&t.commit("setApiDoc",p.value),n.value=!1};p.value.docType===1||p.value.docType===2?k.value&&k.value.loadDoc(i.value,c.value,r):p.value.docType===3||p.value.docType===4?v.value&&v.value.loadDoc(i.value,c.value,r):p.value.docType===5&&g.value&&g.value.loadDoc(i.value,c.value,r),zyplayerApi.docApiGlobalParamList({docId:i.value}).then(m=>{let x=m.data||[];t.commit("setDocGlobalParam",x)})},V=()=>{B()},l=()=>{p.value.docType===1||p.value.docType===2?k.value&&k.value.loadTreeData(c.value):p.value.docType===3||p.value.docType===4?v.value&&v.value.loadTreeData(c.value):p.value.docType===5&&g.value&&g.value.loadTreeData(c.value)};return watch(t.getters.getDocChangedNum,()=>{C()}),onMounted(()=>{s.value=o.options.routes.find(w=>w.path==="/").children[0].children;let r=a.meta||{},m=a.path;r.parentPath&&(m=r.parentPath),f.value=[m];let x=a.matched;x.length>=1&&(u.value=[x[1].path]),C(),h()}),{menuData:s,selectedKeys:f,openKeys:u,treeDataLoading:n,docResourceList:y,docChoiceId:i,searchKeywords:c,swaggerRef:k,openApiRef:v,customRequestRef:g,docChoice:p,searchDoc:l,docChoiceChange:V}}},_hoisted_1$2={class:"menu-layout"},_hoisted_2$1={class:"doc-tree"},_hoisted_3$1={style:{padding:"10px 5px"}};function _sfc_render$2(d,t,a,o,s,f){const u=resolveComponent("menu-children-layout"),n=resolveComponent("a-menu"),y=resolveComponent("a-divider"),i=resolveComponent("a-select-option"),c=resolveComponent("a-select"),p=resolveComponent("a-input-search"),h=resolveComponent("DocTreeSwagger"),C=resolveComponent("DocTreeOpenApi"),k=resolveComponent("CustomRequest"),v=resolveComponent("a-spin");return openBlock(),createElementBlock("div",_hoisted_1$2,[createVNode(n,{theme:"light",mode:"inline","inline-collapsed":!1,openKeys:o.openKeys,"onUpdate:openKeys":t[0]||(t[0]=g=>o.openKeys=g),selectedKeys:o.selectedKeys,"onUpdate:selectedKeys":t[1]||(t[1]=g=>o.selectedKeys=g)},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.menuData,g=>(openBlock(),createBlock(u,{menuItem:g},null,8,["menuItem"]))),256))]),_:1},8,["openKeys","selectedKeys"]),createVNode(y,{style:{margin:"6px 0"}}),withDirectives(createBaseVNode("div",_hoisted_2$1,[createVNode(v,{tip:"\u52A0\u8F7D\u4E2D...",spinning:o.treeDataLoading},{default:withCtx(()=>[createBaseVNode("div",_hoisted_3$1,[createVNode(c,{placeholder:"\u8BF7\u9009\u62E9\u5206\u7EC4",value:o.docChoiceId,"onUpdate:value":t[2]||(t[2]=g=>o.docChoiceId=g),onChange:o.docChoiceChange,style:{width:"100%"}},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.docResourceList,g=>(openBlock(),createBlock(i,{value:g.id},{default:withCtx(()=>[createTextVNode(toDisplayString(g.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value","onChange"]),createVNode(p,{value:o.searchKeywords,"onUpdate:value":t[3]||(t[3]=g=>o.searchKeywords=g),placeholder:"\u641C\u7D22\u6587\u6863\u5185\u5BB9",style:{width:"100%","margin-top":"10px"},onSearch:o.searchDoc},null,8,["value","onSearch"])]),o.docChoice&&o.docChoice.docType?(openBlock(),createElementBlock(Fragment,{key:0},[o.docChoice.docType===1||o.docChoice.docType===2?(openBlock(),createBlock(h,{key:0,ref:"swaggerRef"},null,512)):createCommentVNode("",!0),o.docChoice.docType===3||o.docChoice.docType===4?(openBlock(),createBlock(C,{key:1,ref:"openApiRef"},null,512)):createCommentVNode("",!0),o.docChoice.docType===5?(openBlock(),createBlock(k,{key:2,ref:"customRequestRef"},null,512)):createCommentVNode("",!0)],64)):createCommentVNode("",!0)]),_:1},8,["spinning"])],512),[[vShow,!a.collapsed]])])}var MenuLayout=_export_sfc(_sfc_main$2,[["render",_sfc_render$2]]),GlobalFooter_vue_vue_type_style_index_0_scoped_true_lang="";const _sfc_main$1={name:"GlobalFooter",props:["copyright","linkList"]},_hoisted_1$1={class:"footer"},_hoisted_2={class:"links"},_hoisted_3=["href"],_hoisted_4={class:"copyright"},_hoisted_5=createTextVNode(" Copyright");function _sfc_render$1(d,t,a,o,s,f){const u=resolveComponent("a-icon");return openBlock(),createElementBlock("div",_hoisted_1$1,[createBaseVNode("div",_hoisted_2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.linkList,(n,y)=>(openBlock(),createElementBlock("a",{target:"_blank",key:y,href:n.link?n.link:"javascript: void(0)"},[n.icon?(openBlock(),createBlock(u,{key:0,type:n.icon},null,8,["type"])):createCommentVNode("",!0),createTextVNode(toDisplayString(n.name),1)],8,_hoisted_3))),128))]),createBaseVNode("div",_hoisted_4,[_hoisted_5,createVNode(u,{type:"copyright"}),createTextVNode(" "+toDisplayString(a.copyright),1)])])}var GlobalFooter=_export_sfc(_sfc_main$1,[["render",_sfc_render$1],["__scopeId","data-v-7aaaa116"]]),GlobalLayout_vue_vue_type_style_index_0_scoped_true_lang="";const minHeight=window.innerHeight-64-122,_sfc_main={name:"GlobalLayout",components:{LeftResize,HeaderAvatar,MenuLayout,GlobalFooter,BarChartOutlined,MenuFoldOutlined,MenuUnfoldOutlined},data(){return{minHeight:minHeight+"px",appMenuCollapsed:!1,leftAsideWidth:300}},computed:{},mounted(){},methods:{}},_withScopeId=d=>(pushScopeId("data-v-40238062"),d=d(),popScopeId(),d),_hoisted_1=_withScopeId(()=>createBaseVNode("div",{class:"header-border logo"},[createBaseVNode("img",{src:_imports_0}),createBaseVNode("h1",null,"API\u63A5\u53E3\u6587\u6863\u7BA1\u7406")],-1));function _sfc_render(d,t,a,o,s,f){const u=resolveComponent("menu-layout"),n=resolveComponent("a-layout-sider"),y=resolveComponent("LeftResize"),i=resolveComponent("MenuUnfoldOutlined"),c=resolveComponent("MenuFoldOutlined"),p=resolveComponent("a-col"),h=resolveComponent("header-avatar"),C=resolveComponent("a-row"),k=resolveComponent("a-layout-header"),v=resolveComponent("router-view"),g=resolveComponent("a-layout-content"),B=resolveComponent("a-layout");return openBlock(),createBlock(B,{class:"api-menu-trigger"},{default:withCtx(()=>[createVNode(n,{theme:"light",trigger:null,collapsible:"",collapsed:s.appMenuCollapsed,"onUpdate:collapsed":t[0]||(t[0]=V=>s.appMenuCollapsed=V),width:s.leftAsideWidth,style:{height:"100vh",overflow:"auto"}},{default:withCtx(()=>[_hoisted_1,createVNode(u,{collapsed:s.appMenuCollapsed},null,8,["collapsed"])]),_:1},8,["collapsed","width"]),withDirectives(createVNode(y,{value:s.leftAsideWidth,"onUpdate:value":t[1]||(t[1]=V=>s.leftAsideWidth=V)},null,8,["value"]),[[vShow,!s.appMenuCollapsed]]),createVNode(B,null,{default:withCtx(()=>[createVNode(k,{class:"header-border"},{default:withCtx(()=>[createVNode(C,{type:"flex"},{default:withCtx(()=>[createVNode(p,{flex:"auto"},{default:withCtx(()=>[s.appMenuCollapsed?(openBlock(),createBlock(i,{key:0,class:"trigger",onClick:t[2]||(t[2]=V=>s.appMenuCollapsed=!s.appMenuCollapsed)})):(openBlock(),createBlock(c,{key:1,class:"trigger",onClick:t[3]||(t[3]=V=>s.appMenuCollapsed=!s.appMenuCollapsed)}))]),_:1}),createVNode(p,{flex:"400px",style:{"text-align":"right","padding-right":"20px"}},{default:withCtx(()=>[createVNode(h)]),_:1})]),_:1})]),_:1}),createVNode(g,{style:{height:"calc(100vh - 80px)",overflow:"auto",background:"#fff"}},{default:withCtx(()=>[createVNode(v)]),_:1})]),_:1})]),_:1})}var GlobalLayout=_export_sfc(_sfc_main,[["render",_sfc_render],["__scopeId","data-v-40238062"]]);export{GlobalLayout as default};
|