2 lines
6.8 KiB
JavaScript
2 lines
6.8 KiB
JavaScript
import{z as R,r as p,o as l,c as u,w as m,a as _,b as v,F as T,d as k,e as E,f as b,K as y,g as $,h as O,i as x,j as A,A as I,l as D}from"./vendor.81c025df.js";const N=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerpolicy&&(o.referrerPolicy=a.referrerpolicy),a.crossorigin==="use-credentials"?o.credentials="include":a.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}};N();var f=(e,t)=>{for(const[n,r]of t)e[n]=r;return e};const S={name:"app",components:{},data(){return{locale:R}},methods:{}};function V(e,t,n,r,a,o){const i=p("router-view"),c=p("a-config-provider");return l(),u(c,{locale:a.locale},{default:m(()=>[_(i)]),_:1},8,["locale"])}var j=f(S,[["render",V]]);const C="modulepreload",L={},M="",h=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${M}${r}`,r in L)return;L[r]=!0;const a=r.endsWith(".css"),o=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${o}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":C,a||(i.as="script",i.crossOrigin=""),i.href=r,document.head.appendChild(i),a)return new Promise((c,g)=>{i.addEventListener("load",c),i.addEventListener("error",g)})})).then(()=>t())};const q={name:"PageTableView",components:{},data(){return{pageList:[],linkList:[],activePage:"",multiPage:!0,ignoreParamPath:["/data/export"],apiRequestIndex:1}},computed:{pageTabNameMap(){return this.$store.state.pageTabNameMap}},created(){let{name:e,path:t,fullPath:n}=this.$route;this.pageList.push({name:e,path:t,fullPath:n});let r=this.getRouteRealPath(this.$route);this.linkList.push(r),this.activePage=r,this.$router.push(this.$route.fullPath)},watch:{$route:function(e,t){let n=this.getRouteRealPath(e);if(this.activePage=n,this.linkList.indexOf(n)<0){this.linkList.push(n);let{name:a,path:o,fullPath:i}=e;this.pageList.push({name:a,path:o,fullPath:i})}let r=this.pageList.find(a=>this.getRouteRealPath(a)===n);r.fullPath=e.fullPath}},methods:{isIgnoreParamPath(e){return this.ignoreParamPath.indexOf(e)>=0},getRouteRealPath(e){return this.isIgnoreParamPath(e.path)?e.path:e.fullPath},changePage(e){let t=this.pageList.find(n=>n.fullPath===e);this.activePage=this.getRouteRealPath(t),this.$router.push(t.fullPath)},editPage(e,t){this[t](e)},editPageTab(e,t){t==="add"?this.addPageTab():this.removePageTab(e)},addPageTab(){this.$router.push({path:"/api/request",query:{id:this.apiRequestIndex++}})},removePageTab(e){if(this.pageList.length===1){this.$message.warning("\u8FD9\u662F\u6700\u540E\u4E00\u9875\uFF0C\u4E0D\u80FD\u518D\u5173\u95ED\u4E86\u5566");return}this.pageList=this.pageList.filter(n=>this.getRouteRealPath(n)!==e),this.linkList=this.linkList.filter(n=>n!==e);let t=this.linkList.indexOf(this.activePage);t<0&&(t=this.linkList.length-1,this.activePage=this.linkList[t],this.$router.push(this.activePage))}}},K={class:"page-layout"},B={class:"page-body"};function F(e,t,n,r,a,o){const i=p("a-tab-pane"),c=p("a-tabs"),g=p("router-view");return l(),v("div",K,[_(c,{type:"editable-card",activeKey:a.activePage,"onUpdate:activeKey":t[0]||(t[0]=s=>a.activePage=s),onTabClick:o.changePage,onEdit:o.editPageTab,style:{padding:"5px 10px 0"}},{default:m(()=>[(l(!0),v(T,null,k(a.pageList,s=>(l(),u(i,{closable:"",tab:o.pageTabNameMap[s.fullPath]||s.name,name:o.getRouteRealPath(s),fullPath:s.fullPath,key:s.fullPath},null,8,["tab","name","fullPath"]))),128))]),_:1},8,["activeKey","onTabClick","onEdit"]),E("div",B,[_(g,null,{default:m(({Component:s,route:w})=>[(l(),u(y,null,[(l(),u(b(s),{key:w.fullPath}))],1024))]),_:1})])])}var G=f(q,[["render",F]]);const z={name:"EmptyLayout",components:{},props:[],data(){return{}},methods:{}};function H(e,t,n,r,a,o){const i=p("router-view");return l(),u(i,null,{default:m(({Component:c,route:g})=>[(l(),u(y,null,[(l(),u(b(c),{key:g.fullPath}))],1024))]),_:1})}var P=f(z,[["render",H]]);let U=[{path:"/",name:"\u4E3B\u9875",component:()=>h(()=>import("./GlobalLayout.e1d8edd1.js"),["assets/GlobalLayout.e1d8edd1.js","assets/custom.fa34986e.js","assets/vendor.81c025df.js"]),redirect:"/manage",children:[{path:"/doc",name:"\u6587\u6863\u7BA1\u7406",component:G,children:[{path:"/manage",name:"\u6587\u6863\u5730\u5740\u7BA1\u7406",meta:{icon:"FileTextOutlined"},component:()=>h(()=>import("./DocManage.d8b2c70e.js"),["assets/DocManage.d8b2c70e.js","assets/custom.fa34986e.js","assets/vendor.81c025df.js"])},{path:"/setting",name:"\u7CFB\u7EDF\u8BBE\u7F6E",meta:{icon:"SettingOutlined"},component:P,children:[{path:"/setting/globalParam",name:"\u5168\u5C40\u53C2\u6570",component:()=>h(()=>import("./GlobalParam.21193cf5.js"),["assets/GlobalParam.21193cf5.js","assets/custom.fa34986e.js","assets/vendor.81c025df.js"])},{path:"/setting/view",name:"\u5C55\u793A\u914D\u7F6E",meta:{hidden:!0},component:()=>h(()=>import("./SettingView.9d0565e2.js"),["assets/SettingView.9d0565e2.js","assets/vendor.81c025df.js"])}]},{path:"/swagger",name:"swagger\u6587\u6863",meta:{hidden:!0,icon:"SettingOutlined"},component:P,children:[{path:"/swagger/info",name:"\u6587\u6863\u4FE1\u606F",component:()=>h(()=>import("./DocInfo.9c6c6128.js"),["assets/DocInfo.9c6c6128.js","assets/vendor.81c025df.js"])},{path:"/swagger/view",name:"\u6587\u6863\u5C55\u793A",component:()=>h(()=>import("./DocView.7ed15556.js"),["assets/DocView.7ed15556.js","assets/vendor.81c025df.js","assets/unitConvert.e11ee573.js","assets/custom.fa34986e.js"])}]},{path:"/api",name:"API\u8BF7\u6C42",meta:{hidden:!0},component:P,children:[{path:"/api/request",name:"\u63A5\u53E3\u8BF7\u6C42",component:()=>h(()=>import("./ApiRequest.7aebc25a.js"),["assets/ApiRequest.7aebc25a.js","assets/vendor.81c025df.js","assets/unitConvert.e11ee573.js","assets/custom.fa34986e.js"])}]}]}]}];var W=$({state(){return{docChangedNum:1,userInfo:{},pageTabNameMap:{},swaggerDoc:{},swaggerDefinitions:{},swaggerTreePathMap:{},methodStatistic:{},swaggerResource:{},globalParam:[]}},mutations:{setUserInfo(e,t){e.userInfo=t},setGlobalParam(e,t){e.globalParam=t},setSwaggerResource(e,t){e.swaggerResource=t},addDocChangedNum(e){e.docChangedNum++},setSwaggerDoc(e,t){e.swaggerDoc=t,e.swaggerDefinitions=t.definitions||{}},setSwaggerTreePathMap(e,t){e.swaggerTreePathMap=t},setMethodStatistic(e,t){e.methodStatistic=t},addTableName(e,t){let n=Object.assign({},e.pageTabNameMap);n[t.key]=t.val,e.pageTabNameMap=n}}});const J=O({history:x(),routes:U}),d=A(j);d.config.productionTip=!1;d.use(I);d.use(J);d.use(W);d.mount("#app");d.directive("highlight",{updated(e){e.querySelectorAll("pre code").forEach(n=>{D.highlightBlock(n)})}});export{f as _};
|