2021-12-15 23:24:22 +08:00
|
|
|
import{z as D,r as h,o as r,c as p,w as g,a as _,P as E,b as v,F as A,d as T,e as w,f as y,K as R,g as $,h as x,i as M,j as I,A as S,l as V}from"./vendor.948fa90f.js";const N=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const s of n.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function a(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerpolicy&&(n.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?n.credentials="include":i.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function o(i){if(i.ep)return;i.ep=!0;const n=a(i);fetch(i.href,n)}};N();var b=(e,t)=>{const a=e.__vccOpts||e;for(const[o,i]of t)a[o]=i;return a};const j={name:"app",components:{},data(){return{locale:D}},methods:{}};function C(e,t,a,o,i,n){const s=h("router-view"),u=h("a-config-provider");return r(),p(u,{locale:i.locale},{default:g(()=>[_(s)]),_:1},8,["locale"])}var q=b(j,[["render",C]]);const K="modulepreload",O={},G="",l=function(t,a){return!a||a.length===0?t():Promise.all(a.map(o=>{if(o=`${G}${o}`,o in O)return;O[o]=!0;const i=o.endsWith(".css"),n=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${n}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":K,i||(s.as="script",s.crossOrigin=""),s.href=o,document.head.appendChild(s),i)return new Promise((u,m)=>{s.addEventListener("load",u),s.addEventListener("error",m)})})).then(()=>t())};const U={name:"PageTableView",components:{PlusOutlined:E},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:a}=this.$route;this.pageList.push({name:e,path:t,fullPath:a});let o=this.getRouteRealPath(this.$route);this.linkList.push(o),this.activePage=o,this.$router.push(this.$route.fullPath)},watch:{$route:function(e,t){let a=this.getRouteRealPath(e);if(this.activePage=a,this.linkList.indexOf(a)<0){this.linkList.push(a);let{name:i,path:n,fullPath:s}=e;this.pageList.push({name:i,path:n,fullPath:s})}let o=this.pageList.find(i=>this.getRouteRealPath(i)===a);o.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(a=>a.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(a=>this.getRouteRealPath(a)!==e),this.linkList=this.linkList.filter(a=>a!==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))}}},W={class:"page-layout"},B={class:"page-body"};function F(e,t,a,o,i,n){const s=h("plus-outlined"),u=h("a-tooltip"),m=h("a-tab-pane"),c=h("a-tabs"),L=h("router-view");return r(),v("div",W,[_(c,{type:"editable-card",activeKey:i.activePage,"onUpdate:activeKey":t[0]||(t[0]=d=>i.activePage=d),onTabClick:n.changePage,onEdit:n.editPageTab,style:{padding:"5px 10px 0"}},{addIcon:g(()=>[_(u,{title:"\u65B0\u5EFA\u4E00\u4E2AAPI\u63A5\u53E3"},{default:g(()=>[_(s)]),_:1})]),default:g(()=>[(r(!0),v(A,null,T(i.pageList,d=>(r(),p(m,{closable:"",tab:n.pageTabNameMap[d.fullPath]||d.name,name:n.getRouteRealPath(d),fullPath:d.fullPath,key:d.fullPath},null,8,["tab","name","fullPath"]))),128))]),_:1},8,["activeKey","onTabClick","onEdit"]),w("div",B,[_(L,null,{defa
|