yxuse 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.cjs.js +1 -1
- package/lib/api.es.js +2 -2
- package/lib/index.cjs3.js +1 -1
- package/lib/index.cjs3.js.gz +0 -0
- package/lib/index.es3.js +8 -10
- package/lib/index.es3.js.gz +0 -0
- package/package.json +1 -1
package/lib/api.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./index.cjs3.js");
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs3.js");exports.auth=e.index;
|
package/lib/api.es.js
CHANGED
package/lib/index.cjs3.js
CHANGED
|
@@ -42,4 +42,4 @@ Use slot props instead:
|
|
|
42
42
|
</${n}>
|
|
43
43
|
</router-view>`)}}function oo(e,t){const n=fe({},e,{matched:e.matched.map(o=>Nb(o,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function Yo(e){return{_custom:{display:e}}}let hb=0;function mb(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const o=hb++;Fi({id:"org.vuejs.router"+(o?"."+o:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:e},r=>{typeof r.now!="function"&&console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),r.on.inspectComponent((u,f)=>{u.instanceData&&u.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:oo(t.currentRoute.value,"Current Route")})}),r.on.visitComponentTree(({treeNode:u,componentInstance:f})=>{if(f.__vrv_devtools){const d=f.__vrv_devtools;u.tags.push({label:(d.name?`${d.name.toString()}: `:"")+d.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:_f})}We(f.__vrl_devtools)&&(f.__devtoolsApi=r,f.__vrl_devtools.forEach(d=>{let m=bf,g="";d.isExactActive?(m=Ef,g="This is exactly active"):d.isActive&&(m=yf,g="This link is active"),u.tags.push({label:d.route.path,textColor:0,tooltip:g,backgroundColor:m})}))}),lt(t.currentRoute,()=>{a(),r.notifyComponentUpdate(),r.sendInspectorTree(c),r.sendInspectorState(c)});const s="router:navigations:"+o;r.addTimelineLayer({id:s,label:`Router${o?" "+o:""} Navigations`,color:4237508}),t.onError((u,f)=>{r.addTimelineEvent({layerId:s,event:{title:"Error during Navigation",subtitle:f.fullPath,logType:"error",time:r.now(),data:{error:u},groupId:f.meta.__navigationId}})});let i=0;t.beforeEach((u,f)=>{const d={guard:Yo("beforeEach"),from:oo(f,"Current Location during this navigation"),to:oo(u,"Target location")};Object.defineProperty(u.meta,"__navigationId",{value:i++}),r.addTimelineEvent({layerId:s,event:{time:r.now(),title:"Start of navigation",subtitle:u.fullPath,data:d,groupId:u.meta.__navigationId}})}),t.afterEach((u,f,d)=>{const m={guard:Yo("afterEach")};d?(m.failure={_custom:{type:Error,readOnly:!0,display:d?d.message:"",tooltip:"Navigation Failure",value:d}},m.status=Yo("❌")):m.status=Yo("✅"),m.from=oo(f,"Current Location during this navigation"),m.to=oo(u,"Target location"),r.addTimelineEvent({layerId:s,event:{title:"End of navigation",subtitle:u.fullPath,time:r.now(),data:m,logType:d?"warning":"default",groupId:u.meta.__navigationId}})});const c="router-inspector:"+o;r.addInspector({id:c,label:"Routes"+(o?" "+o:""),icon:"book",treeFilterPlaceholder:"Search routes"});function a(){if(!l)return;const u=l;let f=n.getRoutes().filter(d=>!d.parent);f.forEach(Of),u.filter&&(f=f.filter(d=>ni(d,u.filter.toLowerCase()))),f.forEach(d=>wf(d,t.currentRoute.value)),u.rootNodes=f.map(Nf)}let l;r.on.getInspectorTree(u=>{l=u,u.app===e&&u.inspectorId===c&&a()}),r.on.getInspectorState(u=>{if(u.app===e&&u.inspectorId===c){const d=n.getRoutes().find(m=>m.record.__vd_id===u.nodeId);d&&(u.state={options:vb(d)})}}),r.sendInspectorTree(c),r.sendInspectorState(c)})}function gb(e){return e.optional?e.repeatable?"*":"?":e.repeatable?"+":""}function vb(e){const{record:t}=e,n=[{editable:!1,key:"path",value:t.path}];return t.name!=null&&n.push({editable:!1,key:"name",value:t.name}),n.push({editable:!1,key:"regexp",value:e.re}),e.keys.length&&n.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:e.keys.map(o=>`${o.name}${gb(o)}`).join(" "),tooltip:"Param keys",value:e.keys}}}),t.redirect!=null&&n.push({editable:!1,key:"redirect",value:t.redirect}),e.alias.length&&n.push({editable:!1,key:"aliases",value:e.alias.map(o=>o.record.path)}),Object.keys(e.record.meta).length&&n.push({editable:!1,key:"meta",value:e.record.meta}),n.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(o=>o.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:e.score}}}),n}const _f=15485081,yf=2450411,Ef=8702998,_b=2282478,bf=16486972,yb=6710886;function Nf(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:_b}),n.aliasOf&&t.push({label:"alias",textColor:0,backgroundColor:bf}),e.__vd_match&&t.push({label:"matches",textColor:0,backgroundColor:_f}),e.__vd_exactActive&&t.push({label:"exact",textColor:0,backgroundColor:Ef}),e.__vd_active&&t.push({label:"active",textColor:0,backgroundColor:yf}),n.redirect&&t.push({label:typeof n.redirect=="string"?`redirect: ${n.redirect}`:"redirects",textColor:16777215,backgroundColor:yb});let o=n.__vd_id;return o==null&&(o=String(Eb++),n.__vd_id=o),{id:o,label:n.path,tags:t,children:e.children.map(Nf)}}let Eb=0;const bb=/^\/(.*)\/([a-z]*)$/;function wf(e,t){const n=t.matched.length&&Yt(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(o=>Yt(o,e.record))),e.children.forEach(o=>wf(o,t))}function Of(e){e.__vd_match=!1,e.children.forEach(Of)}function ni(e,t){const n=String(e.re).match(bb);if(e.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,""),n[2]).test(t))return e.children.forEach(i=>ni(i,t)),e.record.path!=="/"||t==="/"?(e.__vd_match=e.re.test(t),!0):!1;const r=e.record.path.toLowerCase(),s=Po(r);return!t.startsWith("/")&&(s.includes(t)||r.includes(t))||s.startsWith(t)||r.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(i=>ni(i,t))}function Nb(e,t){const n={};for(const o in e)t.includes(o)||(n[o]=e[o]);return n}function wb(e){const t=kE(e.routes,e),n=e.parseQuery||nb,o=e.stringifyQuery||Ca,r=e.history;if(process.env.NODE_ENV!=="production"&&!r)throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');const s=no(),i=no(),c=no(),a=Ip(Mt);let l=Mt;xt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vs.bind(null,y=>""+y),f=vs.bind(null,tb),d=vs.bind(null,Po);function m(y,M){let k,U;return uf(y)?(k=t.getRecordMatcher(y),U=M):U=y,t.addRoute(U,k)}function g(y){const M=t.getRecordMatcher(y);M?t.removeRoute(M):process.env.NODE_ENV!=="production"&&se(`Cannot remove non-existent route "${String(y)}"`)}function v(){return t.getRoutes().map(y=>y.record)}function w(y){return!!t.getRecordMatcher(y)}function O(y,M){if(M=fe({},M||a.value),typeof y=="string"){const ee=_s(n,y,M.path),p=t.resolve({path:ee.path},M),h=r.createHref(ee.fullPath);return process.env.NODE_ENV!=="production"&&(h.startsWith("//")?se(`Location "${y}" resolved to "${h}". A resolved location cannot start with multiple slashes.`):p.matched.length||se(`No match found for location with path "${y}"`)),fe(ee,p,{params:d(p.params),hash:Po(ee.hash),redirectedFrom:void 0,href:h})}let k;if("path"in y)process.env.NODE_ENV!=="production"&&"params"in y&&!("name"in y)&&Object.keys(y.params).length&&se(`Path "${y.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),k=fe({},y,{path:_s(n,y.path,M.path).path});else{const ee=fe({},y.params);for(const p in ee)ee[p]==null&&delete ee[p];k=fe({},y,{params:f(y.params)}),M.params=f(M.params)}const U=t.resolve(k,M),ie=y.hash||"";process.env.NODE_ENV!=="production"&&ie&&!ie.startsWith("#")&&se(`A \`hash\` should always start with the character "#". Replace "${ie}" with "#${ie}".`),U.params=u(d(U.params));const _e=aE(o,fe({},y,{hash:ZE(ie),path:U.path})),te=r.createHref(_e);return process.env.NODE_ENV!=="production"&&(te.startsWith("//")?se(`Location "${y}" resolved to "${te}". A resolved location cannot start with multiple slashes.`):U.matched.length||se(`No match found for location with path "${"path"in y?y.path:y}"`)),fe({fullPath:_e,hash:ie,query:o===Ca?ob(y.query):y.query||{}},U,{redirectedFrom:void 0,href:te})}function V(y){return typeof y=="string"?_s(n,y,a.value.path):fe({},y)}function P(y,M){if(l!==y)return zn(8,{from:M,to:y})}function L(y){return A(y)}function J(y){return L(fe(V(y),{replace:!0}))}function me(y){const M=y.matched[y.matched.length-1];if(M&&M.redirect){const{redirect:k}=M;let U=typeof k=="function"?k(y):k;if(typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=V(U):{path:U},U.params={}),process.env.NODE_ENV!=="production"&&!("path"in U)&&!("name"in U))throw se(`Invalid redirect found:
|
|
44
44
|
${JSON.stringify(U,null,2)}
|
|
45
|
-
when navigating to "${y.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return fe({query:y.query,hash:y.hash,params:"path"in U?{}:y.params},U)}}function A(y,M){const k=l=O(y),U=a.value,ie=y.state,_e=y.force,te=y.replace===!0,ee=me(k);if(ee)return A(fe(V(ee),{state:typeof ee=="object"?fe({},ie,ee.state):ie,force:_e,replace:te}),M||k);const p=k;p.redirectedFrom=M;let h;return!_e&&ga(o,U,k)&&(h=zn(16,{to:p,from:U}),xn(U,U,!0,!1)),(h?Promise.resolve(h):D(p,U)).catch(_=>Ot(_)?Ot(_,2)?_:Be(_):W(_,p,U)).then(_=>{if(_){if(Ot(_,2))return process.env.NODE_ENV!=="production"&&ga(o,O(_.to),p)&&M&&(M._count=M._count?M._count+1:1)>10?(se(`Detected an infinite redirection in a navigation guard when going from "${U.fullPath}" to "${p.fullPath}". Aborting to avoid a Stack Overflow. This will break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):A(fe({replace:te},V(_.to),{state:typeof _.to=="object"?fe({},ie,_.to.state):ie,force:_e}),M||p)}else _=X(p,U,!0,te,ie);return T(p,U,_),_})}function K(y,M){const k=P(y,M);return k?Promise.reject(k):Promise.resolve()}function D(y,M){let k;const[U,ie,_e]=Ob(y,M);k=ys(U.reverse(),"beforeRouteLeave",y,M);for(const ee of U)ee.leaveGuards.forEach(p=>{k.push(Bt(p,y,M))});const te=K.bind(null,y,M);return k.push(te),Dn(k).then(()=>{k=[];for(const ee of s.list())k.push(Bt(ee,y,M));return k.push(te),Dn(k)}).then(()=>{k=ys(ie,"beforeRouteUpdate",y,M);for(const ee of ie)ee.updateGuards.forEach(p=>{k.push(Bt(p,y,M))});return k.push(te),Dn(k)}).then(()=>{k=[];for(const ee of y.matched)if(ee.beforeEnter&&!M.matched.includes(ee))if(We(ee.beforeEnter))for(const p of ee.beforeEnter)k.push(Bt(p,y,M));else k.push(Bt(ee.beforeEnter,y,M));return k.push(te),Dn(k)}).then(()=>(y.matched.forEach(ee=>ee.enterCallbacks={}),k=ys(_e,"beforeRouteEnter",y,M),k.push(te),Dn(k))).then(()=>{k=[];for(const ee of i.list())k.push(Bt(ee,y,M));return k.push(te),Dn(k)}).catch(ee=>Ot(ee,8)?ee:Promise.reject(ee))}function T(y,M,k){for(const U of c.list())U(y,M,k)}function X(y,M,k,U,ie){const _e=P(y,M);if(_e)return _e;const te=M===Mt,ee=xt?history.state:{};k&&(U||te?r.replace(y.fullPath,fe({scroll:te&&ee&&ee.scroll},ie)):r.push(y.fullPath,ie)),a.value=y,xn(y,M,k,te),Be()}let I;function ue(){I||(I=r.listen((y,M,k)=>{const U=O(y),ie=me(U);if(ie){A(fe(ie,{replace:!0}),U).catch(po);return}l=U;const _e=a.value;xt&&gE(_a(_e.fullPath,k.delta),ns()),D(U,_e).catch(te=>Ot(te,12)?te:Ot(te,2)?(A(te.to,U).then(ee=>{Ot(ee,20)&&!k.delta&&k.type===$o.pop&&r.go(-1,!1)}).catch(po),Promise.reject()):(k.delta&&r.go(-k.delta,!1),W(te,U,_e))).then(te=>{te=te||X(U,_e,!1),te&&(k.delta&&!Ot(te,8)?r.go(-k.delta,!1):k.type===$o.pop&&Ot(te,20)&&r.go(-1,!1)),T(U,_e,te)}).catch(po)}))}let xe=no(),Re=no(),de;function W(y,M,k){Be(y);const U=Re.list();return U.length?U.forEach(ie=>ie(y,M,k)):(process.env.NODE_ENV!=="production"&&se("uncaught error during route navigation:"),console.error(y)),Promise.reject(y)}function oe(){return de&&a.value!==Mt?Promise.resolve():new Promise((y,M)=>{xe.add([y,M])})}function Be(y){return de||(de=!y,ue(),xe.list().forEach(([M,k])=>y?k(y):M()),xe.reset()),y}function xn(y,M,k,U){const{scrollBehavior:ie}=e;if(!xt||!ie)return Promise.resolve();const _e=!k&&vE(_a(y.fullPath,0))||(U||!k)&&history.state&&history.state.scroll||null;return yn().then(()=>ie(y,M,_e)).then(te=>te&&mE(te)).catch(te=>W(te,y,M))}const Nt=y=>r.go(y);let ft;const Ge=new Set;return{currentRoute:a,listening:!0,addRoute:m,removeRoute:g,hasRoute:w,getRoutes:v,resolve:O,options:e,push:L,replace:J,go:Nt,back:()=>Nt(-1),forward:()=>Nt(1),beforeEach:s.add,beforeResolve:i.add,afterEach:c.add,onError:Re.add,isReady:oe,install(y){const M=this;y.component("RouterLink",ab),y.component("RouterView",db),y.config.globalProperties.$router=M,Object.defineProperty(y.config.globalProperties,"$route",{enumerable:!0,get:()=>B(a)}),xt&&!ft&&a.value===Mt&&(ft=!0,L(r.location).catch(ie=>{process.env.NODE_ENV!=="production"&&se("Unexpected error when starting the router:",ie)}));const k={};for(const ie in Mt)k[ie]=Z(()=>a.value[ie]);y.provide(zi,M),y.provide(vf,Sn(k)),y.provide(ti,a);const U=y.unmount;Ge.add(y),y.unmount=function(){Ge.delete(y),Ge.size<1&&(l=Mt,I&&I(),I=null,a.value=Mt,ft=!1,de=!1),U()},process.env.NODE_ENV!=="production"&&xt&&mb(y,M,t)}}}function Dn(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function Ob(e,t){const n=[],o=[],r=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const c=t.matched[i];c&&(e.matched.find(l=>Yt(l,c))?o.push(c):n.push(c));const a=e.matched[i];a&&(t.matched.find(l=>Yt(l,a))||r.push(a))}return[n,o,r]}const Sb=[{path:"/table",name:"Table",component:()=>Promise.resolve().then(()=>require("./index.cjs5.js")),meta:{title:"表格"}}],Ra=wb({history:NE("./"),strict:!1,routes:Sb}),Cb="/gateway/integrated-management/api/v1",xb={timeout:1e4*6,headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8","X-Requested-With":"XMLHttpRequest"}};let Aa={lock:!0,text:"加载中...",background:"rgba(0, 0, 0, 0.6)"};const Tb=["put","delete"],Ar=class{httpInterceptorsResponse(){Ar.axiosInstance.interceptors.response.use(n=>{const o=n.data.code;return o===200&&Tb.includes(n.config.method)&&Le.success("操作成功"),o!==200&&Ny(o,n.data.resultMsg),n.data},n=>{var s,i,c;n.message.indexOf("timeout")!==-1&&Le.error("请求超时!请您稍后重试"),n.message.indexOf("Network Error")!==-1&&Le.error("网络错误!请您稍后重试"),window.navigator.onLine||Ra.replace("/500");const o=(s=n.response)==null?void 0:s.data.code,r=ha();return o===Gu.OVERDUE?(r.setToken(""),Ra.replace(by),Ey({title:"登录过期提醒",message:((i=n.response)==null?void 0:i.data.resultMsg)||"当前登录失效",type:"warning",duration:5e3})):Le.error(((c=n.response)==null?void 0:c.data.resultMsg)||"服务器错误"),n.response})}constructor(){this.httpInterceptorsResponse()}request(t,n="POST",o={},r,s,i){let c;s&&i&&(Aa.text=i),s&&(c=W_.service(Aa));const a=ha(),l={url:`${Cb}${t}`,headers:{token:a.token},method:n,[`${n==="GET"||r?"params":"data"}`]:o};return new Promise((u,f)=>{Ar.axiosInstance.request(l).then(d=>{if(c&&c.close(),d.code===200)return u(d)}).catch(d=>{f(d)})})}post(t,n,o){return this.request(t,"POST",n,o)}get(t,n,o){return this.request(t,"GET",n,o)}};let pr=Ar;Gi(pr,"axiosInstance",Ud.create(xb));const Sf=new pr,Ki=()=>{var n;const e=sessionStorage.getItem("GlobalState");return((n=JSON.parse(e))==null?void 0:n.token)||null},$b=()=>{var n;const e=sessionStorage.getItem("GlobalState");return((n=JSON.parse(e))==null?void 0:n.userInfo)||null},Pb=async()=>Ki()?await Sf.request("/account/home/menu","GET","",!1,!0):[],Db=async e=>{if(!Ki())return null;try{const{data:t}=await Sf.request("/account/auth/route/list","GET","",!1,!0);if(!t)return null;const n=t.filter(s=>s.routeTag.includes(e)),o=n.filter(s=>s.routeType==="VIEW"),r=n.filter(s=>s.routeType==="BTN");return{userMenuList:o,userBtnList:r}}catch{return null}},Rb=e=>{let t=[];const n=Object.assign({}),o=Object.assign({});return e.forEach(r=>{const s=`/src/views${r.routeView}/config.ts`,i=`/src/views${r.routeView}/index.vue`;if(n[i]&&o[s]){const c=o[s],a={path:r.routeView,name:r.routeView.split("/")[1],meta:{title:c.title,icon:c.icon},component:n[i]};t.push(a)}}),t},
|
|
45
|
+
when navigating to "${y.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return fe({query:y.query,hash:y.hash,params:"path"in U?{}:y.params},U)}}function A(y,M){const k=l=O(y),U=a.value,ie=y.state,_e=y.force,te=y.replace===!0,ee=me(k);if(ee)return A(fe(V(ee),{state:typeof ee=="object"?fe({},ie,ee.state):ie,force:_e,replace:te}),M||k);const p=k;p.redirectedFrom=M;let h;return!_e&&ga(o,U,k)&&(h=zn(16,{to:p,from:U}),xn(U,U,!0,!1)),(h?Promise.resolve(h):D(p,U)).catch(_=>Ot(_)?Ot(_,2)?_:Be(_):W(_,p,U)).then(_=>{if(_){if(Ot(_,2))return process.env.NODE_ENV!=="production"&&ga(o,O(_.to),p)&&M&&(M._count=M._count?M._count+1:1)>10?(se(`Detected an infinite redirection in a navigation guard when going from "${U.fullPath}" to "${p.fullPath}". Aborting to avoid a Stack Overflow. This will break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):A(fe({replace:te},V(_.to),{state:typeof _.to=="object"?fe({},ie,_.to.state):ie,force:_e}),M||p)}else _=X(p,U,!0,te,ie);return T(p,U,_),_})}function K(y,M){const k=P(y,M);return k?Promise.reject(k):Promise.resolve()}function D(y,M){let k;const[U,ie,_e]=Ob(y,M);k=ys(U.reverse(),"beforeRouteLeave",y,M);for(const ee of U)ee.leaveGuards.forEach(p=>{k.push(Bt(p,y,M))});const te=K.bind(null,y,M);return k.push(te),Dn(k).then(()=>{k=[];for(const ee of s.list())k.push(Bt(ee,y,M));return k.push(te),Dn(k)}).then(()=>{k=ys(ie,"beforeRouteUpdate",y,M);for(const ee of ie)ee.updateGuards.forEach(p=>{k.push(Bt(p,y,M))});return k.push(te),Dn(k)}).then(()=>{k=[];for(const ee of y.matched)if(ee.beforeEnter&&!M.matched.includes(ee))if(We(ee.beforeEnter))for(const p of ee.beforeEnter)k.push(Bt(p,y,M));else k.push(Bt(ee.beforeEnter,y,M));return k.push(te),Dn(k)}).then(()=>(y.matched.forEach(ee=>ee.enterCallbacks={}),k=ys(_e,"beforeRouteEnter",y,M),k.push(te),Dn(k))).then(()=>{k=[];for(const ee of i.list())k.push(Bt(ee,y,M));return k.push(te),Dn(k)}).catch(ee=>Ot(ee,8)?ee:Promise.reject(ee))}function T(y,M,k){for(const U of c.list())U(y,M,k)}function X(y,M,k,U,ie){const _e=P(y,M);if(_e)return _e;const te=M===Mt,ee=xt?history.state:{};k&&(U||te?r.replace(y.fullPath,fe({scroll:te&&ee&&ee.scroll},ie)):r.push(y.fullPath,ie)),a.value=y,xn(y,M,k,te),Be()}let I;function ue(){I||(I=r.listen((y,M,k)=>{const U=O(y),ie=me(U);if(ie){A(fe(ie,{replace:!0}),U).catch(po);return}l=U;const _e=a.value;xt&&gE(_a(_e.fullPath,k.delta),ns()),D(U,_e).catch(te=>Ot(te,12)?te:Ot(te,2)?(A(te.to,U).then(ee=>{Ot(ee,20)&&!k.delta&&k.type===$o.pop&&r.go(-1,!1)}).catch(po),Promise.reject()):(k.delta&&r.go(-k.delta,!1),W(te,U,_e))).then(te=>{te=te||X(U,_e,!1),te&&(k.delta&&!Ot(te,8)?r.go(-k.delta,!1):k.type===$o.pop&&Ot(te,20)&&r.go(-1,!1)),T(U,_e,te)}).catch(po)}))}let xe=no(),Re=no(),de;function W(y,M,k){Be(y);const U=Re.list();return U.length?U.forEach(ie=>ie(y,M,k)):(process.env.NODE_ENV!=="production"&&se("uncaught error during route navigation:"),console.error(y)),Promise.reject(y)}function oe(){return de&&a.value!==Mt?Promise.resolve():new Promise((y,M)=>{xe.add([y,M])})}function Be(y){return de||(de=!y,ue(),xe.list().forEach(([M,k])=>y?k(y):M()),xe.reset()),y}function xn(y,M,k,U){const{scrollBehavior:ie}=e;if(!xt||!ie)return Promise.resolve();const _e=!k&&vE(_a(y.fullPath,0))||(U||!k)&&history.state&&history.state.scroll||null;return yn().then(()=>ie(y,M,_e)).then(te=>te&&mE(te)).catch(te=>W(te,y,M))}const Nt=y=>r.go(y);let ft;const Ge=new Set;return{currentRoute:a,listening:!0,addRoute:m,removeRoute:g,hasRoute:w,getRoutes:v,resolve:O,options:e,push:L,replace:J,go:Nt,back:()=>Nt(-1),forward:()=>Nt(1),beforeEach:s.add,beforeResolve:i.add,afterEach:c.add,onError:Re.add,isReady:oe,install(y){const M=this;y.component("RouterLink",ab),y.component("RouterView",db),y.config.globalProperties.$router=M,Object.defineProperty(y.config.globalProperties,"$route",{enumerable:!0,get:()=>B(a)}),xt&&!ft&&a.value===Mt&&(ft=!0,L(r.location).catch(ie=>{process.env.NODE_ENV!=="production"&&se("Unexpected error when starting the router:",ie)}));const k={};for(const ie in Mt)k[ie]=Z(()=>a.value[ie]);y.provide(zi,M),y.provide(vf,Sn(k)),y.provide(ti,a);const U=y.unmount;Ge.add(y),y.unmount=function(){Ge.delete(y),Ge.size<1&&(l=Mt,I&&I(),I=null,a.value=Mt,ft=!1,de=!1),U()},process.env.NODE_ENV!=="production"&&xt&&mb(y,M,t)}}}function Dn(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function Ob(e,t){const n=[],o=[],r=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const c=t.matched[i];c&&(e.matched.find(l=>Yt(l,c))?o.push(c):n.push(c));const a=e.matched[i];a&&(t.matched.find(l=>Yt(l,a))||r.push(a))}return[n,o,r]}const Sb=[{path:"/table",name:"Table",component:()=>Promise.resolve().then(()=>require("./index.cjs5.js")),meta:{title:"表格"}}],Ra=wb({history:NE("./"),strict:!1,routes:Sb}),Cb="/gateway/integrated-management/api/v1",xb={timeout:1e4*6,headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8","X-Requested-With":"XMLHttpRequest"}};let Aa={lock:!0,text:"加载中...",background:"rgba(0, 0, 0, 0.6)"};const Tb=["put","delete"],Ar=class{httpInterceptorsResponse(){Ar.axiosInstance.interceptors.response.use(n=>{const o=n.data.code;return o===200&&Tb.includes(n.config.method)&&Le.success("操作成功"),o!==200&&Ny(o,n.data.resultMsg),n.data},n=>{var s,i,c;n.message.indexOf("timeout")!==-1&&Le.error("请求超时!请您稍后重试"),n.message.indexOf("Network Error")!==-1&&Le.error("网络错误!请您稍后重试"),window.navigator.onLine||Ra.replace("/500");const o=(s=n.response)==null?void 0:s.data.code,r=ha();return o===Gu.OVERDUE?(r.setToken(""),Ra.replace(by),Ey({title:"登录过期提醒",message:((i=n.response)==null?void 0:i.data.resultMsg)||"当前登录失效",type:"warning",duration:5e3})):Le.error(((c=n.response)==null?void 0:c.data.resultMsg)||"服务器错误"),n.response})}constructor(){this.httpInterceptorsResponse()}request(t,n="POST",o={},r,s,i){let c;s&&i&&(Aa.text=i),s&&(c=W_.service(Aa));const a=ha(),l={url:`${Cb}${t}`,headers:{token:a.token},method:n,[`${n==="GET"||r?"params":"data"}`]:o};return new Promise((u,f)=>{Ar.axiosInstance.request(l).then(d=>{if(c&&c.close(),d.code===200)return u(d)}).catch(d=>{f(d)})})}post(t,n,o){return this.request(t,"POST",n,o)}get(t,n,o){return this.request(t,"GET",n,o)}};let pr=Ar;Gi(pr,"axiosInstance",Ud.create(xb));const Sf=new pr,Ki=()=>{var n;const e=sessionStorage.getItem("GlobalState");return((n=JSON.parse(e))==null?void 0:n.token)||null},$b=()=>{var n;const e=sessionStorage.getItem("GlobalState");return((n=JSON.parse(e))==null?void 0:n.userInfo)||null},Pb=async()=>Ki()?await Sf.request("/account/home/menu","GET","",!1,!0):[],Db=async e=>{if(!Ki())return null;try{const{data:t}=await Sf.request("/account/auth/route/list","GET","",!1,!0);if(!t)return null;const n=t.filter(s=>s.routeTag.includes(e)),o=n.filter(s=>s.routeType==="VIEW"),r=n.filter(s=>s.routeType==="BTN");return{userMenuList:o,userBtnList:r}}catch{return null}},Rb=e=>{let t=[];const n=Object.assign({}),o=Object.assign({});return e.forEach(r=>{const s=`/src/views${r.routeView}/config.ts`,i=`/src/views${r.routeView}/index.vue`;if(n[i]&&o[s]){const c=o[s],a={path:r.routeView,name:r.routeView.split("/")[1],meta:{title:c.title,icon:c.icon},component:n[i]};t.push(a)}}),t},Cf=Object.freeze(Object.defineProperty({__proto__:null,getToken:Ki,getUserInfo:$b,getUserPermissions:Db,getUserRouteList:Pb,getUserRouter:Rb},Symbol.toStringTag,{value:"Module"})),Ab=Object.freeze(Object.defineProperty({__proto__:null,auth:Cf},Symbol.toStringTag,{value:"Module"}));exports.Fragment=Ie;exports.api=Ab;exports.createBlock=Ze;exports.createCommentVNode=Kt;exports.createElementBlock=et;exports.createTextVNode=fu;exports.createVNode=Ne;exports.defineComponent=Je;exports.index=Cf;exports.isVNode=tt;exports.mergeProps=Pi;exports.openBlock=ye;exports.ref=Se;exports.renderList=Dh;exports.resolveComponent=Ph;exports.resolveDynamicComponent=Si;exports.toDisplayString=go;exports.unref=B;exports.withCtx=yt;
|
package/lib/index.cjs3.js.gz
CHANGED
|
Binary file
|
package/lib/index.es3.js
CHANGED
|
@@ -3172,7 +3172,7 @@ function Zt(e, t, n, o) {
|
|
|
3172
3172
|
}
|
|
3173
3173
|
}
|
|
3174
3174
|
const wr = "components";
|
|
3175
|
-
function
|
|
3175
|
+
function Ab(e, t) {
|
|
3176
3176
|
return Gl(wr, e, !0, t) || e;
|
|
3177
3177
|
}
|
|
3178
3178
|
const Wl = Symbol();
|
|
@@ -3212,7 +3212,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
3212
3212
|
function vc(e, t) {
|
|
3213
3213
|
return e && (e[t] || e[at(t)] || e[_n(at(t))]);
|
|
3214
3214
|
}
|
|
3215
|
-
function
|
|
3215
|
+
function Ib(e, t, n, o) {
|
|
3216
3216
|
let r;
|
|
3217
3217
|
const s = n && n[o];
|
|
3218
3218
|
if (q(e) || le(e)) {
|
|
@@ -10242,29 +10242,27 @@ const Of = new dr(), Hi = () => {
|
|
|
10242
10242
|
getUserPermissions: Tb,
|
|
10243
10243
|
getUserRouteList: xb,
|
|
10244
10244
|
getUserRouter: $b
|
|
10245
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
10246
|
-
auth: Pb
|
|
10247
|
-
}, kb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10245
|
+
}, Symbol.toStringTag, { value: "Module" })), Vb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10248
10246
|
__proto__: null,
|
|
10249
|
-
|
|
10247
|
+
auth: Pb
|
|
10250
10248
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10251
10249
|
export {
|
|
10252
10250
|
Me as F,
|
|
10253
|
-
|
|
10251
|
+
Vb as a,
|
|
10254
10252
|
lt as b,
|
|
10255
10253
|
ot as c,
|
|
10256
10254
|
Ze as d,
|
|
10257
10255
|
Jl as e,
|
|
10258
10256
|
fn as f,
|
|
10259
10257
|
we as g,
|
|
10260
|
-
|
|
10258
|
+
Ab as h,
|
|
10261
10259
|
ut as i,
|
|
10262
10260
|
Te as j,
|
|
10263
10261
|
rm as k,
|
|
10264
|
-
|
|
10262
|
+
Pb as l,
|
|
10265
10263
|
uu as m,
|
|
10266
10264
|
ye as o,
|
|
10267
|
-
|
|
10265
|
+
Ib as r,
|
|
10268
10266
|
hr as t,
|
|
10269
10267
|
B as u,
|
|
10270
10268
|
$t as w
|
package/lib/index.es3.js.gz
CHANGED
|
Binary file
|