2 lines
26 KiB
JavaScript
2 lines
26 KiB
JavaScript
var de=Object.defineProperty;var pe=(e,t,n)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>(pe(e,typeof t!="symbol"?t+"":t,n),n);import{d as b,u as me,a as k,c as A,r as y,o as d,b as _,w as l,e as i,_ as _e,f as S,g as he,h as ge,i as T,j as D,p as M,k as U,l as c,m as fe,n as L,q as Y,s as ve,t as we,v as Z,x as X,N as Q,y as ee,z as te,A as ne,B as oe,F as se,C as Te,L as be,I as $e,D as F,E as Ae,G as ye,H as Se,J as Ee,K as Ie,T as H,M as ke,O as Ce,P as Re,Q as Le,R as Oe,S as $,U as z,V as P,W as G,X as De,Y as Ne,Z as xe,$ as Be,a0 as Me}from"../js/.pnpm/.pnpm.f0f66221.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerpolicy&&(a.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?a.credentials="include":s.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const Ue=b({setup(){window.$message=me()}}),g=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n};function Ke(e,t,n,o,s,a){return null}const ae=g(Ue,[["render",Ke]]),Fe={common:{},Layout:{},Menu:{},Input:{}},He={common:{primaryColor:"#0057ff",primaryColorHover:"#0057ff",primaryColorPressed:"#0057ff",borderRadius:"5px"},Input:{}},ze=b({components:{MessageApi:ae},setup(){const e=k();let t=A(()=>e.getters["theme/getTheme"]);return{locale:y(null),dateLocale:y(null),darkThemeOverrides:Fe,lightThemeOverrides:He,theme:t}},beforeCreate(){this.$store.dispatch("theme/init"),this.$store.dispatch("auth/initClientId"),this.$store.dispatch("adminNavStore/initTabs")}});function Pe(e,t,n,o,s,a){const r=ae,p=_e,h=S("router-view"),u=he,m=ge;return d(),_(m,{"preflight-style-disabled":"","inline-theme-disabled":!1,theme:e.theme,"theme-overrides":e.theme===null?e.lightThemeOverrides:e.darkThemeOverrides,locale:e.$store.state.theme.locale,"date-locale":e.$store.state.theme.dateLocale},{default:l(()=>[i(p,null,{default:l(()=>[i(r)]),_:1}),i(h),i(u)]),_:1},8,["theme","theme-overrides","locale","date-locale"])}const Ge=g(ze,[["render",Pe]]),Ve="modulepreload",qe=function(e,t){return new URL(e,t).href},V={},w=function(t,n,o){if(!n||n.length===0)return t();const s=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=qe(a,o),a in V)return;V[a]=!0;const r=a.endsWith(".css"),p=r?'[rel="stylesheet"]':"";if(!!o)for(let m=s.length-1;m>=0;m--){const f=s[m];if(f.href===a&&(!r||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${p}`))return;const u=document.createElement("link");if(u.rel=r?"stylesheet":Ve,r||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),r)return new Promise((m,f)=>{u.addEventListener("load",m),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())},je=[{path:"/test",name:"Test",component:()=>w(()=>import("../js/test/Index.80e25189.js"),["../js/test/Index.80e25189.js","../js/.pnpm/.pnpm.f0f66221.js"],import.meta.url)}],Je=["home","admin","admin-group","admin-log","user"],re=[];Je.forEach(e=>{const t=Object.assign({"../../../../views/Admin/admin-group/Index.vue":()=>w(()=>import("../js/admin-group/Index.4ef755ad.js"),["../js/admin-group/Index.4ef755ad.js","../js/TableData/TableData.6826261f.js","../js/.pnpm/.pnpm.f0f66221.js","./TableData.3ed117a5.css"],import.meta.url),"../../../../views/Admin/admin-log/Index.vue":()=>w(()=>import("../js/admin-log/Index.49c0ec61.js"),["../js/admin-log/Index.49c0ec61.js","../js/TableData/TableData.6826261f.js","../js/.pnpm/.pnpm.f0f66221.js","./TableData.3ed117a5.css","./Index.e6f6ef44.css"],import.meta.url),"../../../../views/Admin/admin/Index.vue":()=>w(()=>import("../js/admin/Index.df1d809c.js"),["../js/admin/Index.df1d809c.js","../js/TableData/TableData.6826261f.js","../js/.pnpm/.pnpm.f0f66221.js","./TableData.3ed117a5.css"],import.meta.url),"../../../../views/Admin/home/Index.vue":()=>w(()=>import("../js/home/Index.4d562b01.js"),["../js/home/Index.4d562b01.js","../js/.pnpm/.pnpm.f0f66221.js"],import.meta.url),"../../../../views/Admin/login/Index.vue":()=>w(()=>import("../js/login/Index.1f06d029.js"),["../js/login/Index.1f06d029.js","../js/.pnpm/.pnpm.f0f66221.js","./Index.c9351cdb.css"],import.meta.url),"../../../../views/Admin/user/Index.vue":()=>w(()=>import("../js/user/Index.f77ec1cf.js"),["../js/user/Index.f77ec1cf.js","../js/.pnpm/.pnpm.f0f66221.js","./Index.08d08c57.css"],import.meta.url)});re.push({path:e,name:e.toUpperCase(),component:t[`../../../../views/Admin/${e}/Index.vue`]})});const We=[{path:"",redirect:"/admin/home"}],Ye=We.concat(re),Ze={setup(){return{}}};const Xe=e=>(M("data-v-efa2effb"),e=e(),U(),e),Qe={class:"not-found"},et=Xe(()=>c("span",{class:"label"},"404",-1));function tt(e,t,n,o,s,a){const r=S("css-doodle");return d(),T("div",Qe,[i(r,{class:"bg"},{default:l(()=>[D(" @grid: 50x1 / 100%; @place: center; @size: calc(75% / @I * @i); transform: rotate(calc(@i * 5deg)); border-radius: 30%; border: 1px solid hsla( calc(10 + 4 * @i), 70%, 68%, @r.8 ); ")]),_:1}),et])}const nt=g(Ze,[["render",tt],["__scopeId","data-v-efa2effb"]]),ot={setup(){return{}}};function st(e,t,n,o,s,a){return d(),T("div",null," Hello world; ")}const at=g(ot,[["render",st]]),rt={setup(){return{}},created(){}};function lt(e,t,n,o,s,a){const r=S("router-view");return d(),_(r)}const it=g(rt,[["render",lt]]),ct=w(()=>import("../js/.pnpm/.pnpm.f0f66221.js").then(e=>e.au),[],import.meta.url);console.log(ct);const ut=b({setup(){const e=fe("reload"),t=k();let n=A(()=>t.getters["theme/getTheme"]),o=A(()=>t.getters["theme/getHaveForward"]);const s=A(()=>t.getters["adminNavStore/getShowTabs"]);return{reload:e,theme:n,haveFroward:o,showTabs:s,toggleShowTabs(){t.dispatch("adminNavStore/setShowTabs")}}},methods:{toggleTheme(e){this.$store.dispatch("theme/toggle",e)},toggleLanguage(e){this.$store.dispatch("theme/toggleLanguage",e)},goRouter(e){return this.$router.go(e)}}});const E=e=>(M("data-v-f28b5eb8"),e=e(),U(),e),dt=E(()=>c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[c("g",{fill:"none"},[c("path",{d:"M20.026 17.001c-2.762 4.784-8.879 6.423-13.663 3.661A9.965 9.965 0 0 1 3.13 17.68a.75.75 0 0 1 .365-1.132c3.767-1.348 5.785-2.91 6.956-5.146c1.232-2.353 1.551-4.93.689-8.463a.75.75 0 0 1 .769-.927a9.961 9.961 0 0 1 4.457 1.327c4.784 2.762 6.423 8.879 3.66 13.662zm-8.248-4.903c-1.25 2.389-3.31 4.1-6.817 5.499a8.49 8.49 0 0 0 2.152 1.766a8.502 8.502 0 0 0 8.502-14.725a8.484 8.484 0 0 0-2.792-1.015c.647 3.384.23 6.043-1.045 8.475z",fill:"currentColor"})])],-1)),pt=E(()=>c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[c("g",{fill:"none"},[c("path",{d:"M12 2a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 12 2zm0 15a5 5 0 1 0 0-10a5 5 0 0 0 0 10zm0-1.5a3.5 3.5 0 1 1 0-7a3.5 3.5 0 0 1 0 7zm9.25-2.75a.75.75 0 0 0 0-1.5h-1.5a.75.75 0 0 0 0 1.5h1.5zM12 19a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 12 19zm-7.75-6.25a.75.75 0 0 0 0-1.5h-1.5a.75.75 0 0 0 0 1.5h1.5zm-.03-8.53a.75.75 0 0 1 1.06 0l1.5 1.5a.75.75 0 0 1-1.06 1.06l-1.5-1.5a.75.75 0 0 1 0-1.06zm1.06 15.56a.75.75 0 1 1-1.06-1.06l1.5-1.5a.75.75 0 1 1 1.06 1.06l-1.5 1.5zm14.5-15.56a.75.75 0 0 0-1.06 0l-1.5 1.5a.75.75 0 0 0 1.06 1.06l1.5-1.5a.75.75 0 0 0 0-1.06zm-1.06 15.56a.75.75 0 1 0 1.06-1.06l-1.5-1.5a.75.75 0 1 0-1.06 1.06l1.5 1.5z",fill:"currentColor"})])],-1)),mt=E(()=>c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[c("path",{d:"M17.65 6.35a7.95 7.95 0 0 0-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 0 0 7.21-4.56c.32-.67-.16-1.44-.9-1.44c-.37 0-.72.2-.88.53a5.994 5.994 0 0 1-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0 1 12 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z",fill:"currentColor"})],-1)),_t=E(()=>c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[c("g",{fill:"none"},[c("path",{d:"M16.5 6.5h-5.75a4.25 4.25 0 0 0-4.25 4.25v5.75H5.25A3.25 3.25 0 0 1 2 13.25v-8A3.25 3.25 0 0 1 5.25 2h8a3.25 3.25 0 0 1 3.25 3.25V6.5zM22 18.75A3.25 3.25 0 0 1 18.75 22h-8a3.25 3.25 0 0 1-3.25-3.25v-8a3.25 3.25 0 0 1 3.25-3.25h8A3.25 3.25 0 0 1 22 10.75v8zm-3.25 1.75a1.75 1.75 0 0 0 1.75-1.75v-8A1.75 1.75 0 0 0 18.75 9h-8A1.75 1.75 0 0 0 9 10.75v8c0 .966.784 1.75 1.75 1.75h8z",fill:"currentColor"})])],-1)),ht=E(()=>c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[c("g",{fill:"none"},[c("path",{d:"M13.25 16.5a3.25 3.25 0 0 0 3.25-3.25v-8A3.25 3.25 0 0 0 13.25 2h-8A3.25 3.25 0 0 0 2 5.25v8a3.25 3.25 0 0 0 3.25 3.25h8zm-5.75 1H9v1.25c0 .966.784 1.75 1.75 1.75h8a1.75 1.75 0 0 0 1.75-1.75v-8A1.75 1.75 0 0 0 18.75 9H17.5V7.5h1.25A3.25 3.25 0 0 1 22 10.75v8A3.25 3.25 0 0 1 18.75 22h-8a3.25 3.25 0 0 1-3.25-3.25V17.5z",fill:"currentColor"})])],-1)),gt={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ft=E(()=>c("g",{fill:"none"},[c("path",{d:"M17.75 3A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h11.5zm0 1.5H6.25A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .966.784 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75V6.25a1.75 1.75 0 0 0-1.75-1.75zM7.75 7a.75.75 0 0 1 .743.648l.007.102v8.5a.75.75 0 0 1-1.493.102L7 16.25v-8.5A.75.75 0 0 1 7.75 7z",fill:"currentColor"})],-1)),vt=[ft],wt={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 16 16"},Tt=E(()=>c("g",{fill:"none"},[c("path",{d:"M1 3.5A1.5 1.5 0 0 1 2.5 2h11A1.5 1.5 0 0 1 15 3.5v3A1.5 1.5 0 0 1 13.5 8h-11A1.5 1.5 0 0 1 1 6.5v-3zM2.5 3a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h11a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-11zM1 11.5A1.5 1.5 0 0 1 2.5 10h3A1.5 1.5 0 0 1 7 11.5v1A1.5 1.5 0 0 1 5.5 14h-3A1.5 1.5 0 0 1 1 12.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-3zm8-1A1.5 1.5 0 0 0 9 11.5v1a1.5 1.5 0 0 0 1.5 1.5h3a1.5 1.5 0 0 0 1.5-1.5v-1a1.5 1.5 0 0 0-1.5-1.5h-3zm-.5 1.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1z",fill:"currentColor"})],-1)),bt=[Tt];function $t(e,t,n,o,s,a){const r=Y,p=ve,h=we,u=Z;return d(),_(u,{class:"header-box"},{default:l(()=>[i(h,null,{default:l(()=>[e.theme==null?(d(),_(r,{key:0,strong:"",secondary:"",circle:"",onClick:t[0]||(t[0]=m=>e.toggleTheme("moon"))},{icon:l(()=>[dt]),_:1})):(d(),_(r,{key:1,strong:"",secondary:"",circle:"",onClick:t[1]||(t[1]=m=>e.toggleTheme(""))},{icon:l(()=>[pt]),_:1})),i(p,{placement:"top-start",trigger:"hover"},{trigger:l(()=>[i(r,{strong:"",secondary:"",circle:"",onClick:e.reload},{icon:l(()=>[mt]),_:1},8,["onClick"])]),default:l(()=>[D(" \u5237\u65B0\u9875\u9762 ")]),_:1}),i(p,{placement:"top-start",trigger:"hover"},{trigger:l(()=>[i(r,{strong:"",secondary:"",circle:"",onClick:t[2]||(t[2]=m=>e.goRouter(-1))},{icon:l(()=>[_t]),_:1})]),default:l(()=>[D(" \u540E\u9000\u4E00\u9875 ")]),_:1}),e.haveFroward?(d(),_(p,{key:2,placement:"top-start",trigger:"hover"},{trigger:l(()=>[i(r,{strong:"",secondary:"",circle:"",onClick:t[3]||(t[3]=m=>e.goRouter(1)),disabled:!e.haveFroward},{icon:l(()=>[ht]),_:1},8,["disabled"])]),default:l(()=>[D(" \u524D\u8FDB\u4E00\u9875 ")]),_:1})):L("",!0),i(r,{strong:"",secondary:"",circle:"",onClick:e.toggleShowTabs},{icon:l(()=>[e.showTabs?(d(),T("svg",gt,vt)):(d(),T("svg",wt,bt))]),_:1},8,["onClick"])]),_:1})]),_:1})}const le=g(ut,[["render",$t],["__scopeId","data-v-f28b5eb8"]]),At=b({props:["src","isShadow","fillet","showLabel"]});const yt={key:0,class:"label"};function St(e,t,n,o,s,a){const r=Q;return d(),T("div",{class:X(["avatar",(e.isShadow==!1?"no-shadow":"")+(e.fillet==!0?"fillet":"")])},[i(r,{src:e.src,"fallback-src":"https://inews.gtimg.com/newsapp_bt/0/14751264257/1000"},null,8,["src"]),e.showLabel==!0?(d(),T("div",yt)):L("",!0)],2)}const ie=g(At,[["render",St],["__scopeId","data-v-2b9fed72"]]),Et=ee([]),It=b({props:["activeKey"],components:{NLayoutSider:te,NMenu:ne,NImage:Q},setup(e){const t=k();let n=y(e.activeKey);const o=y(null),s=y([n.value]);return oe(()=>t.getters["menuStore/getActiveKey"],a=>{var r;n.value=a,(r=o.value)==null||r.showOption(a)}),setTimeout(()=>{var a;(a=o.value)==null||a.showOption(n.value)},500),{activeKey:n,menuOptions:Et,menuInstRef:o,defaultExpandedKeys:s}},created(){this.menuOptions.length<=0&&this.show()},methods:{async show(){const{data:e}=await this.$http.get("admin/api/auth/authentication");if(e){const t=this.$route.path.replace("/admin/",""),n={path:"/admin/"+t,title:e.menuKey[t][1],pin:!0,pathKey:e.menuKey[t][0]};this.$store.dispatch("adminNavStore/addTab",n),e.menus.forEach(o=>{o.icon,this.menuOptions.push(o)})}},changMenu(e,t){let n="/admin/";this.$store.dispatch("menuStore/setActiveKey",e);const o={path:n+e,title:t.label,pin:!0,pathKey:t.pathKey};return this.$store.dispatch("adminNavStore/addTab",o),this.$router.push(n+e)}}}),kt=c("img",{src:Te},null,-1);function Ct(e,t,n,o,s,a){const r=ne;return d(),T(se,null,[kt,e.menuOptions.length>0?(d(),_(r,{key:0,class:"menu-item",ref:"menuInstRef",value:e.activeKey,"onUpdate:value":t[0]||(t[0]=p=>e.activeKey=p),options:e.menuOptions,onUpdateValue:e.changMenu,"default-expanded-keys":e.defaultExpandedKeys},null,8,["value","options","onUpdateValue","default-expanded-keys"])):L("",!0)],64)}const Rt=g(It,[["render",Ct]]),Lt=b({components:{GeneralMenu:Rt,Avatar:ie,LogOutOutline:be,Icon:$e},setup(){const e=k(),t=A(()=>e.getters["menuStore/getActiveKey"]);let n=A(()=>e.getters["theme/getTheme"]);return{userInfo:e.getters["auth/getUser"],activeKey:t,theme:n,collapsed:y(!1)}},created(){let e=this.$route.path.replace("/admin/","");this.$store.dispatch("menuStore/setActiveKey",e)},methods:{async handleSelect(e){if(e=="logout"){const{data:t}=await this.$http.post("admin/api/auth/logout");if(t)return this.$store.dispatch("auth/logout"),this.$store.dispatch("auth/initClientId"),this.$router.push({path:"/admin/login",query:{direct:this.$route.fullPath}})}}}});const Ot=e=>(M("data-v-9890ae10"),e=e(),U(),e),Dt={class:"user-box"},Nt={class:"account-box"},xt={class:"info"},Bt={class:"name"},Mt={class:"des"},Ut={key:0,style:{"margin-top":"35px"}},Kt=Ot(()=>c("div",{class:"left-filter-box"},null,-1));function Ft(e,t,n,o,s,a){const r=ie,p=S("LogOutOutline"),h=S("Icon"),u=Y,m=Ae,f=S("GeneralMenu"),ue=te;return d(),_(ue,{class:X(["left-menu",(e.collapsed==!0?" collapsed ":"")+(e.theme==null?" moon ":"drak")]),bordered:"","collapse-mode":"width","collapsed-width":90,width:268,collapsed:e.collapsed,"show-trigger":"",onCollapse:t[1]||(t[1]=x=>e.collapsed=!0),onExpand:t[2]||(t[2]=x=>e.collapsed=!1)},{default:l(()=>[c("div",Dt,[c("div",Nt,[i(r,{showLabel:!0,src:e.userInfo.avatar,"onUpdate:src":t[0]||(t[0]=x=>e.userInfo.avatar=x)},null,8,["src"]),c("div",xt,[c("div",Bt,F(e.userInfo.username),1),c("div",Mt,F(e.userInfo.adminGroupId),1)])]),e.collapsed!=!0?(d(),T("div",Ut,[i(m,{options:[{label:"\u9000\u51FA\u767B\u5F55",key:"logout"}],placement:"bottom-start",trigger:"click",onSelect:e.handleSelect},{default:l(()=>[i(u,{strong:"",secondary:"",circle:""},{icon:l(()=>[i(h,null,{default:l(()=>[i(p)]),_:1})]),_:1})]),_:1},8,["onSelect"])])):L("",!0)]),i(f,{activeKey:e.activeKey},null,8,["activeKey"]),Kt]),_:1},8,["class","collapsed"])}const ce=g(Lt,[["render",Ft],["__scopeId","data-v-9890ae10"]]),Ht=b({setup(){const e=k(),t=A(()=>e.getters["adminNavStore/getTabs"]),n=y("");return oe(()=>e.getters["adminNavStore/getCurrentTab"],o=>{n.value=o.title},{deep:!0}),{navTabs:t,defaultTab:n,handleClose(o){e.dispatch("adminNavStore/deleteTab",o)}}},methods:{handleUpdateValue(e){this.navTabs.forEach(t=>{t.title==e&&(this.$store.dispatch("adminNavStore/addTab",t),this.$router.push(t.path))})}}});function zt(e,t,n,o,s,a){const r=Se,p=Ee,h=Z;return d(),_(h,{class:"header-tabs","content-style":"padding: 0;"},{default:l(()=>[i(p,{type:"card","tabs-padding":20,class:"tabs",closable:"",onClose:e.handleClose,value:e.defaultTab,"onUpdate:value":[t[0]||(t[0]=u=>e.defaultTab=u),e.handleUpdateValue]},{default:l(()=>[(d(!0),T(se,null,ye(e.navTabs,u=>(d(),_(r,{class:"item",key:u.path,name:u.title,closable:u.pin},null,8,["name","closable"]))),128))]),_:1},8,["onClose","value","onUpdate:value"])]),_:1})}const Pt=g(Ht,[["render",zt],["__scopeId","data-v-712ecae1"]]),Gt=b({components:{AdminHeader:le,AdminHeaderTab:Pt,AdminLeftMenu:ce},setup(){const e=k();let t=y(!0);const n=()=>{t.value=!1,setTimeout(()=>{t.value=!0},1)},o=A(()=>e.getters["adminNavStore/getShowTabs"]);return Ie("reload",n),{isRouterAlive:t,showTabs:o}}});function Vt(e,t,n,o,s,a){const r=ce,p=le,h=S("AdminHeaderTab"),u=S("router-view"),m=Oe;return d(),_(m,{"has-sider":"",class:"page"},{default:l(()=>[i(r),i(m,{class:"content-page-box"},{default:l(()=>[i(p),i(H,{name:"fade",mode:"out-in"},{default:l(()=>[ke(i(h,null,null,512),[[Ce,e.showTabs===!0]])]),_:1}),i(u,null,{default:l(({Component:f})=>[i(H,{name:"fade",mode:"out-in"},{default:l(()=>[c("div",null,[e.isRouterAlive?(d(),_(Re,{key:0},[(d(),_(Le(f)))],1024)):L("",!0)])]),_:2},1024)]),_:1})]),_:1})]),_:1})}const qt=g(Gt,[["render",Vt],["__scopeId","data-v-27c2172e"]]),jt=[{path:"/",component:it,children:[{path:"",component:at},...je,{path:"/admin/",component:qt,children:[...Ye]},{path:"/admin/login",component:()=>w(()=>import("../js/login/Index.1f06d029.js"),["../js/login/Index.1f06d029.js","../js/.pnpm/.pnpm.f0f66221.js","./Index.c9351cdb.css"],import.meta.url)},{path:"/:pathMatch(.*)*",name:"NotFound",component:nt}]}],q="yt12an145920Yt20",j="20yt029541NA21Yt",J={Encrypt(e){var t=$.AES.encrypt(e,$.enc.Utf8.parse(q),{iv:$.enc.Utf8.parse(j)});return $.enc.Base64.stringify(t.ciphertext)},Decrypt(e){e=e.replace(/\s+/g,"+");var t=$.AES.decrypt(e,$.enc.Utf8.parse(q),{iv:$.enc.Utf8.parse(j)});return t.toString($.enc.Utf8)}},W="client-id",O="ACCESS_TOKEN",v={getClientId(){return window.localStorage.getItem(W)},setClientId(e){window.localStorage.setItem(W,e)},getAccessToken(){return window.localStorage.getItem(O)},resetToken(){const e=window.localStorage.getItem(O);if(e){const n=J.Decrypt(e).split(","),o=new Date().valueOf()-3e3,s=n[0]+","+n[1]+","+o;return J.Encrypt(s)}return""},setAccessToken(e){e==null?window.localStorage.removeItem(O):window.localStorage.setItem(O,e)}},Jt={namespaced:!0,state(){return{theme:null,locale:z,dateLocale:P,haveForward:!1}},getters:{getTheme(e){return e.theme},getHaveForward(e){return e.haveForward}},mutations:{INIT_THEME:e=>{const t=window.localStorage.getItem("darkMode");t==null?e.theme?window.localStorage.setItem("darkMode","true"):window.localStorage.setItem("darkMode","false"):t=="true"?e.theme=G:e.theme=null},TOGGLE_THEME:(e,t)=>{t?(e.theme=G,window.localStorage.setItem("darkMode","true")):(e.theme=null,window.localStorage.setItem("darkMode","false"))},TOGGLE_LANGUAGE:(e,t)=>{t=="zh-CN"?(e.locale=z,e.dateLocale=P):(e.locale=null,e.dateLocale=null)},TOGGLE_ROUTER_STATUS:(e,t)=>{e.haveForward=t}},actions:{init({commit:e}){e("INIT_THEME")},toggle({commit:e},t){e("TOGGLE_THEME",t)},toggleLanguage({commit:e},t){e("TOGGLE_LANGUAGE",t)},toggleRouter({commit:e},t){e("TOGGLE_ROUTER_STATUS",t)}}},Wt={namespaced:!0,state(){return{user:null}},getters:{getUser(e){return e.user}},mutations:{INIT_USER:(e,t)=>{e.user=t,window.localStorage.setItem("userInfo",JSON.stringify(t))},RESET_USER:e=>{let t=window.localStorage.getItem("userInfo");t&&(t=JSON.parse(t),e.user=t)}},actions:{initClientId({commit:e}){v.getClientId()||v.setClientId(Math.random().toString(36).substr(2)),e("RESET_USER")},logout(){console.log("???"),window.localStorage.clear()},clear({commit:e}){window.localStorage.clear(),v.setAccessToken(null),v.setClientId(Math.random().toString(36).substr(2))},login({commit:e},t){e("INIT_USER",t),v.setAccessToken(t.token)}}},Yt={namespaced:!0,state(){return{activeKey:""}},getters:{getActiveKey(e){return e.activeKey}},mutations:{SET:(e,t)=>{e.activeKey=t}},actions:{setActiveKey({commit:e},t){e("SET",t)}}},Zt={namespaced:!0,state(){return{selectDragArr:[],tableDrag:[]}},getters:{getTableDrag(e){return e.tableDrag},getSelectDragArr(e){return e.selectDragArr}},mutations:{SET_TABLE_DRAG:(e,t)=>{e.tableDrag=t},SET_SELECT_DRAG_ARR:(e,t)=>{e.selectDragArr=t}},actions:{setTableDrag({commit:e},t){e("SET_TABLE_DRAG",t)},setSelectDrag({commit:e},t){e("SET_SELECT_DRAG_ARR",t)}}},C="yaa-tabs-nav",Xt={namespaced:!0,state(){return{tabs:[{path:"/admin/home",title:"\u63A7\u5236\u53F0",pin:!1}],currentTab:[],showTabs:!1}},getters:{getTabs(e){return e.tabs},getCurrentTab(e){return e.currentTab},getShowTabs(e){return e.showTabs}},mutations:{INIT_TABS:(e,t)=>{const n=window.localStorage.getItem(C),o=window.localStorage.getItem("if"+C);n&&n.length>0&&(e.tabs=JSON.parse(n)),o&&(e.showTabs=JSON.parse(o))},ADD_TABS:(e,t)=>{if(e.tabs.length>0){let n=!1;for(let o=0;o<e.tabs.length;o++)t.title==e.tabs[o].title&&(n=!0);n||e.tabs.push(t)}else e.tabs.push(t);e.currentTab=t,window.localStorage.setItem(C,JSON.stringify(e.tabs))},DELETE_TABS:(e,t)=>{let n=null,o=null,s=null,a=e.tabs.length;e.tabs.forEach((r,p)=>{r.title==t&&(s=p),r.title==e.currentTab.title&&(o=p)}),e.tabs.splice(s,1),s==o&&(o+1>=a?n=e.tabs[o-1]:n=e.tabs[o]),window.localStorage.setItem(C,JSON.stringify(e.tabs)),n&&(e.currentTab=n,R.push(n.path))},SET_SHOW_TABS(e){e.showTabs=!e.showTabs,window.localStorage.setItem("if"+C,e.showTabs)}},actions:{initTabs({commit:e},t){e("INIT_TABS",t)},addTab({commit:e},t){e("ADD_TABS",t)},deleteTab({commit:e},t){e("DELETE_TABS",t)},setShowTabs({commit:e},t){e("SET_SHOW_TABS",t)}}},I=De({strict:!1,modules:{theme:Jt,auth:Wt,menuStore:Yt,tableStore:Zt,adminNavStore:Xt}}),R=Ne({history:xe(),routes:jt,scrollBehavior(e,t,n){const o=e.path.replace("/admin/","");I.dispatch("menuStore/setActiveKey",o),n&&window.history.state.forward?I.dispatch("theme/toggleRouter",!0):I.dispatch("theme/toggleRouter",!1)}});R.beforeEach((e,t,n)=>{const o=/^\/admin\/(.*?)/.test(e.path);e.path!="/admin/login"?o?v.getAccessToken()?n():n({path:"/admin/login",query:{redirect:e.fullPath}}):n():v.getAccessToken()?n("/admin/"):n()});class Qt{constructor(t){K(this,"httpClient");const n={baseUrl:"",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},params:{},timeout:9e6,withCredentials:!1,responseType:"json",maxContentLength:2e3,validateStatus:function(s){return s>=200&&s<500},maxRedirects:3,data:{},getClientId(){return null},getAccessToken(){return null},successHandler:s=>{Promise.resolve(s)},errorHandler:s=>{Promise.reject(s)},...t},o=Be.create({baseURL:n.baseUrl,timeout:n.timeout,withCredentials:n.withCredentials});o.interceptors.request.use(s=>{const a=n.getClientId();a&&(s.headers["X-Client-Id"]=a);const r=n.getAccessToken();return r&&(s.headers["X-Access-Token"]=r),s.headers["admin-campus-id"]=window.localStorage.getItem("admin_campus_id"),s}),o.interceptors.response.use(s=>n.successHandler(s),s=>n.errorHandler(s)),this.httpClient=o}request(t,n,o=null,s=null){const a={};return a.url=n,a.method=t,o&&(a.params=o),s&&(a.data=s),this.httpClient.request(a).then(r=>({...r,error:null})).catch(r=>({err:r,data:null}))}get(t,n=null){return this.request("GET",t,n)}head(t,n=null){return this.request("HEAD",t,n)}post(t,n=null,o=null){return this.request("POST",t,o,n)}put(t,n=null,o=null){return this.request("PUT",t,o,n)}path(t,n=null,o=null){return this.request("PATH",t,o,n)}delete(t,n=null,o=null){return this.request("DELETE",t,o,n)}download(t,n,o=null,s=null,a=null){const r={};return r.url=n,r.method=t,r.timeout=9e10,r.responseType="blob",o&&(r.params=o),s&&(r.data=s),this.httpClient.request(r).then(p=>{let h=p.headers["x-suggested-filename"];const u=window.URL.createObjectURL(new Blob([p.data])),m=document.createElement("a");m.href=u,m.setAttribute("target","_blank");const f=(a||"")+new Date+h;return m.setAttribute("download",decodeURIComponent(f)),m.click(),window.URL.revokeObjectURL(u),!0}).catch(()=>!1)}}const B={OK:200,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,SERVICE:500},en=new Qt({baseUrl:"http://localhost:9527/",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},getClientId:()=>v.getClientId(),getAccessToken:()=>v.resetToken(),successHandler:e=>{const t=window.$message;let n=e.data.code;if(n==B.UNAUTHORIZED&&(v.setAccessToken(null),R.replace({path:"/admin/login",query:{direct:R.currentRoute.value.fullPath}})),n!=B.OK){if(e.data){const o=e.data;if(o.msg)t.error(o.msg);else if(Array.isArray(o))o.forEach(function(s){t.error(s.msg)});else if(o instanceof Blob){const s=new Blob([o]),a=new FileReader;a.onloadend=()=>{t.error("error")},a.readAsText(s)}}return Promise.reject(e.data)}return Promise.resolve(e.data)},errorHandler:e=>{const t=window.$message;if(e.response){if(e.response.status!=B.OK)if(e.response.data){const n=e.response.data;if(n.msg)t.error(n.msg);else if(n instanceof Blob){const o=new Blob([n]),s=new FileReader;s.onloadend=()=>{t.error("error")},s.readAsText(o)}}else t.error(e.message)}else t.error(e.message);return Promise.reject(e)}}),tn=b({data(){return{_handleBtn:ee([{title:"\u64CD\u4F5C",key:"tags",width:200,fixed:"right",NButtons:[{size:"small",emitFunction:"view",text:"\u67E5\u770B"},{size:"small",type:"info",emitFunction:"edit",text:"\u7F16\u8F91"}]}])}},methods:{openModal(e=null,t=null){if(!t)return window.$message.warning("\u8BF7\u5728\u4F7F\u7528openModal\u65B9\u6CD5\u65F6, \u586B\u5199ref\u540D\u79F0\u3002");const n=this.$refs[t];if(!n)return window.$message.warning("\u8BF7\u786E\u4FDDref\u540D\u79F0\u7EC4\u4EF6\u5B58\u5728\u3002");n.show(e)}}}),N=Me(Ge);N.config.globalProperties.$http=en;N.config.globalProperties.$store=I;N.mixin(tn);N.use(I).use(R).mount("#app");export{J as C,en as R,g as _};
|