static.assets.index.c7a5d8a0.js Maven / Gradle / Ivy
The newest version!
var e=Object.defineProperty,a=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,s=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,r=(e,r)=>{for(var n in r||(r={}))t.call(r,n)&&s(e,n,r[n]);if(a)for(var n of a(r))l.call(r,n)&&s(e,n,r[n]);return e};import{h as n,p as o,a as i,r as u,i as d,c as p,o as c,b as m,N as h,u as f,d as y,e as g,f as v,g as b,w as _,j as k,k as x,l as w,m as O,n as j,q as E,F as P,s as C,t as L,C as D,v as I,x as S,y as T,z as A,A as M,B as R,D as $,H as Y,E as z,G as B,S as N,R as U,I as V,J as q,K as F,L as H,M as G,O as J,P as K,Q as W,T as Q,U as X,V as Z,W as ee,X as ae,Y as te,Z as le,_ as se,$ as re,a0 as ne,a1 as oe,a2 as ie}from"./vendor.55fdba86.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))a(e);new MutationObserver((e=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&a(e)})).observe(document,{childList:!0,subtree:!0})}function a(e){if(e.ep)return;e.ep=!0;const a=function(e){const a={};return e.integrity&&(a.integrity=e.integrity),e.referrerpolicy&&(a.referrerPolicy=e.referrerpolicy),"use-credentials"===e.crossorigin?a.credentials="include":"anonymous"===e.crossorigin?a.credentials="omit":a.credentials="same-origin",a}(e);fetch(e.href,a)}}();let ue={},de=(e,a,t)=>{var l;if("$ref"in e||"items"in e&&"$ref"in e.items){let s="";s="$ref"in e?e.$ref.replace("#/definitions/",""):e.items.$ref.replace("#/definitions/","");let r=null==(l=null==ue?void 0:ue.definitions)?void 0:l[s];if(null==r)return{};let n=r.properties,o={},i=Object.keys(n);if(null!=t){let l=[],s={name:a,type:e.type,description:e.description,children:l};for(let e in i)o[i[e]]=de(n[i[e]],i[e],l);t.push(s)}else for(let e in i)o[i[e]]=de(n[i[e]],i[e],void 0);return o}{let l=pe.mockDataByType(e.type);return null!=t&&t.push({name:a,type:e.type,required:e.required,description:e.description}),l}};let pe={process:e=>{let a={};e.tags;let t=e.paths;return Object.keys(t).forEach((e=>{let l=t[e];Object.keys(l).forEach((t=>{const s=l[t].tags[0];l[t].method=t,l[t].url=e,Object.keys(a).indexOf(s)<0?(a[s]=[],a[s].push(l)):a[s].push(l)}))})),a},radioConsts:[{value:"success",label:"成功"},{value:"error",label:"失败"},{value:"error-retry",label:"失败待重试"},{value:"retry",label:"待重试"},{value:"no-auth",label:"无权限"},{value:"no-data",label:"无响应数据"},{value:"no-some-data",label:"响应缺少部分数据"},{value:"big-some-data",label:"返回了多余数据"},{value:"no-format",label:"响应参数未驼峰命名"},{value:"type-error",label:"参数类型错误"}],deep:de,mockDataByType:e=>{switch(e.toLowerCase()){case"array":return[];case"integer":case"number":return 0;case"string":return"";case"object":return{};case"string(date-time)":return n().format("YYYY-MM-DD HH:mm:ss");default:return""}},setRefObj:e=>{ue=e},refObj:ue};o("data-v-66075b02");const ce=M(" 关闭全部标签页,同时清理缓存 ");i();const me={setup(e){const a=u([{label:"主页",key:"home",name:"home"},{label:"Models",key:"mad"},{label:"请求用例管理",key:"manager"},{label:"离线文档分享",key:"share"}]);let t=d("g"),l={},s=p((()=>new Date));c((()=>{let e=t.value.data;l=pe.process(e),Object.keys(l).forEach((e=>{let t={label:e,key:e,name:e},s=l[e];if(s.length>0){let a={},l=Array.from(new Set(s.map((e=>{let t=Object.keys(e)[0];return t in a||(a[t]=[]),a[t].push(e),t})))),n=0;t.children=l.map((t=>({type:"group",label:()=>r(t),key:e+t,group:t,children:a[t].map((e=>(n++,{label:e[t].summary,key:e[t].summary+n,data:e[t]})))})))}a.value.push(t)}))}));const r=e=>{let a="success";switch(e){case"get":a="info";break;case"post":a="success";break;case"put":a="warning";break;case"delete":a="error"}return m(h,{type:a},{default:()=>e.toUpperCase()})},n=u("");n.value="home";const o=u([{id:"home",name:"主页"}]);let i=f(),M=(e,a)=>{o.value.find((a=>a.id==e))||o.value.push({id:e,name:a.label,data:a.data}),n.value=e,F(e,a.data)},q=e=>{F(e.id,e.data)},F=(e,a)=>{"home"==e?i.push({name:"FirstPage",params:{data:"identity"}}):"manager"==e?i.push({name:"Manager"}):"mad"==e?i.push({name:"Models"}):"share"==e?i.push({name:"Share"}):i.push({name:"Api",params:{data:JSON.stringify(a)}})},H=e=>{if("group"in e)return r(e.group);if("children"in e){let a=0;return null!=e.children&&e.children.forEach((e=>{null!=e&&"children"in e&&(a+=e.children.length)})),m("span",null,[m(R,null,[m("span",null,e.label),m($,{value:a,max:20,type:"success",style:"margin-left:6px"})])])}return m(R,null,{default:()=>e.label})},G=e=>"home"===e.key?m(E,null,{default:()=>m(Y)}):"mad"===e.key?m(E,null,{default:()=>m(z)}):"manager"===e.key?m(E,null,{default:()=>m(B)}):"share"===e.key?m(E,null,{default:()=>m(N)}):m(E,null,{default:()=>m(U)}),J=e=>m(E,null,{default:()=>m(V)}),K=()=>{o.value=o.value.filter((e=>"home"===e.id)),o.value.find((e=>"home"==e.id))||o.value.push({id:"home",name:"主页"}),n.value="home",sessionStorage.clear(),i.push("/firstPage")};const W=p((()=>o.value.length>1)),Q=e=>{const a=o.value.find((a=>a.id==e));null!=a.data&&sessionStorage.removeItem(a.data.url+a.data.method);const{value:t}=o,l=t.findIndex((a=>a.id===e));if(!~l)return;t.splice(l,1);const s=t[0];F(s.id,s.data),n.value=s.id};return(e,t)=>{const l=y("router-view");return g(),v("div",null,[b(k(O),{"has-sider":"",position:"absolute",style:{top:"64px"}},{default:_((()=>[b(k(x),{bordered:"","collapse-mode":"width","collapsed-width":100,width:280,"native-scrollbar":!1,"show-trigger":"bar","content-style":"padding: 20px;"},{default:_((()=>[b(k(w),{"on-update:value":k(M),"collapsed-width":60,"collapsed-icon-size":25,options:a.value,"render-label":k(H),"render-icon":k(G),"expand-icon":k(J),value:n.value},null,8,["on-update:value","options","render-label","render-icon","expand-icon","value"])])),_:1}),b(k(O),{"native-scrollbar":!1,"content-style":"padding: 24px;"},{default:_((()=>[b(k(j),{value:n.value,"onUpdate:value":t[0]||(t[0]=e=>n.value=e),type:"card",closable:k(W),"default-value":"home",onClose:Q,"tab-style":"min-width: 40px;"},{prefix:_((()=>[b(k(E),{size:"20"},{default:_((()=>[b(k(P))])),_:1})])),suffix:_((()=>[b(k(C),null,{trigger:_((()=>[b(k(L),{text:"",onClick:k(K)},{default:_((()=>[b(k(E),{size:"30"},{default:_((()=>[b(k(D))])),_:1})])),_:1},8,["onClick"])])),default:_((()=>[ce])),_:1})])),default:_((()=>[(g(!0),v(I,null,S(o.value,(e=>(g(),T(k(A),{name:e.id,tab:e.name,key:e.id,onClick:a=>k(q)(e)},null,8,["name","tab","onClick"])))),128))])),_:1},8,["value","closable"]),b(l,{key:k(s)})])),_:1})])),_:1})])}},__scopeId:"data-v-66075b02"};var he=q.create({timeout:6e4,headers:{"Content-Type":"application/json"}});he.interceptors.request.use((e=>(e.startTime=new Date,e)),(e=>e));const fe=({method:e,url:a,data:t,config:l})=>"post"==(e=e.toLowerCase())?he.post(a,{data:t},r({},l)):"get"==e?he.get(a,r({params:t},l)):"delete"==e?he.delete(a,{data:t},r({},l)):"put"==e?he.put(a,{data:t},r({},l)):(console.error("未知的method"+e),!1),ye={style:{display:"flex",width:"100%"}},ge=H("img",{style:{padding:"14px",height:"32px",width:"32px"},src:"assets/title.8b763cb0.png"},null,-1),ve={style:{display:"flex","justify-content":"flex-start","align-items":"center"}},be=M(" YDoc Lucky UI "),_e={style:{display:"inline-flex","justify-content":"flex-start","align-items":"center","margin-left":"45px",width:"200px"}},ke=M(" 切换一个主题,换换心情! "),xe=M(" LuckyUI "),we=M(" YDoc "),Oe=M("加载数据中"),je={key:0},Ee={setup(e){const a={Card:{borderRadius:"15px",boxShadow:"1px 3px 3px #00b873"}},t={Card:{borderRadius:"15px",boxShadow:"1px 3px 3px #ac9b9a"}};let l=u(!0);const s=d("g");s.value.theme=1;let r=u(null),n=u("Dark Theme");const o=()=>{null==r.value?(r.value=te,n.value="Light Theme",s.value.theme=0):(r.value=null,n.value="Dark Theme",s.value.theme=1)};let i=f(),p=u(),m=u(),y=u([]),x=u({}),w=()=>{window.open("https://github.com/NoBugBoy/LuckyUI")},j=()=>{window.open("https://github.com/NoBugBoy/YDoc")};return c((()=>{sessionStorage.clear();let e=window.location.pathname.replace("/doc.html","");e="http://127.0.0.1:8888",fe({url:e+"/swagger-resources",method:"get"}).then((a=>{p.value=a.data,s.value.resource=a.data,y.value=a.data.map((e=>({label:e.name,key:e.url}))),x.value=y.value[0].label,fe({url:e+a.data[0].url,method:"get"}).then((e=>{m.value=e.data,s.value.data=e.data,l.value=!1,i.push("/firstPage")}))}))})),(e,s)=>(g(),T(k(ae),{theme:k(r),"theme-overrides":null==k(r)?t:a},{default:_((()=>[b(k(O),{position:"absolute"},{default:_((()=>[b(k(F),{style:{height:"64px",display:"flex"},bordered:""},{default:_((()=>[H("div",ye,[ge,H("span",ve,[b(k(h),{type:"success",size:23},{default:_((()=>[be])),_:1})]),H("span",_e,[b(k(G),{value:k(x),"onUpdate:value":s[0]||(s[0]=e=>J(x)?x.value=e:x=e),options:k(y),loading:k(l)},null,8,["value","options","loading"])]),b(k(K),{style:{position:"absolute",right:"50px",padding:"14px"}},{default:_((()=>[b(k(C),{trigger:"hover"},{trigger:_((()=>[b(k(L),{onClick:o,Ghost:""},{default:_((()=>[M(W(k(n)),1)])),_:1})])),default:_((()=>[ke])),_:1}),b(k(L),{strong:"",style:{display:"inline-flex","align-items":"center",margin:"auto"},onClick:k(w)},{icon:_((()=>[b(k(E),{size:"20"},{default:_((()=>[b(k(Q))])),_:1})])),default:_((()=>[xe])),_:1},8,["onClick"]),b(k(L),{strong:"",style:{display:"inline-flex","align-items":"center",margin:"auto"},onClick:k(j)},{icon:_((()=>[b(k(E),{size:"20"},{default:_((()=>[b(k(Q))])),_:1})])),default:_((()=>[we])),_:1},8,["onClick"])])),_:1})])])),_:1}),b(k(X),null,{default:_((()=>[b(k(Z),{show:k(l),style:{position:"absolute",top:"50%",left:"50%"}},{description:_((()=>[Oe])),_:1},8,["show"]),k(l)?ee("",!0):(g(),v("div",je,[b(me)]))])),_:1})])),_:1})])),_:1},8,["theme","theme-overrides"]))}},Pe={},Ce=function(e,a){return a&&0!==a.length?Promise.all(a.map((e=>{if((e=`/${e}`)in Pe)return;Pe[e]=!0;const a=e.endsWith(".css"),t=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${t}`))return;const l=document.createElement("link");return l.rel=a?"stylesheet":"modulepreload",a||(l.as="script",l.crossOrigin=""),l.href=e,document.head.appendChild(l),a?new Promise(((e,a)=>{l.addEventListener("load",e),l.addEventListener("error",a)})):void 0}))).then((()=>e())):e()};let Le=le({history:se(),routes:[{path:"/",name:"FirstPage0",component:()=>Ce((()=>import("./FirstPage.469bf859.js")),["assets/FirstPage.469bf859.js","assets/FirstPage.48bcf13f.css","assets/vendor.55fdba86.js","assets/vendor.0513d345.css"])},{path:"/firstPage",name:"FirstPage",component:()=>Ce((()=>import("./FirstPage.469bf859.js")),["assets/FirstPage.469bf859.js","assets/FirstPage.48bcf13f.css","assets/vendor.55fdba86.js","assets/vendor.0513d345.css"])},{path:"/api",name:"Api",component:()=>Ce((()=>import("./Api.b23d5bdf.js")),["assets/Api.b23d5bdf.js","assets/Api.72747b56.css","assets/vendor.55fdba86.js","assets/vendor.0513d345.css"])},{path:"/manager",name:"Manager",component:()=>Ce((()=>import("./Manager.38a7d5b3.js")),["assets/Manager.38a7d5b3.js","assets/vendor.55fdba86.js","assets/vendor.0513d345.css"])},{path:"/models",name:"Models",component:()=>Ce((()=>import("./Models.07abb999.js")),["assets/Models.07abb999.js","assets/vendor.55fdba86.js","assets/vendor.0513d345.css"])},{path:"/share",name:"Share",component:()=>Ce((()=>import("./Share.310ffd41.js")),["assets/Share.310ffd41.js","assets/vendor.55fdba86.js","assets/vendor.0513d345.css"])}]});const De=re(Ee);De.use(Le),De.use(ne),De.use(oe),De.component(ie.name,ie);De.provide("g",u({})),De.mount("#app");export{pe as C,fe as a};