2 lines
32 KiB
JavaScript
2 lines
32 KiB
JavaScript
import{d as e,r as t,g as a,a as l,w as n,s as o,u as r,o as s,b as i,c,e as u,f as d,h as p,i as v,j as f,k as h,l as m,m as g,n as b,T as y,p as _,K as w,q as k,t as x,_ as C,v as E,x as A,y as S,F as T,z as V,A as M,B as I,C as R,D as F,E as P,G as D,H as L,I as z,J as N,L as O,M as q,N as j,O as W,P as B,Q as $,R as H,S as X,U,V as G,W as Y,X as J,Y as Z,Z as K,$ as Q,a0 as ee,a1 as te,a2 as ae,a3 as le,a4 as ne,a5 as oe,a6 as re,a7 as se,a8 as ie,a9 as ce}from"./index-e36acc7e.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang-950a151a.js";var de=(e=>(e[e.Mobile=0]="Mobile",e[e.Desktop=1]="Desktop",e))(de||{});const pe="closed";const ve=e("app",(()=>{const e=t({opened:a()!==pe,withoutAnimation:!1}),r=l(de.Desktop);n((()=>e.opened),(e=>function(e){o(e?"opened":pe)}(e)));return{device:r,sidebar:e,toggleSidebar:t=>{e.opened=!e.opened,e.withoutAnimation=t},closeSidebar:t=>{e.opened=!1,e.withoutAnimation=t},toggleDevice:e=>{r.value=e}}})),fe={class:"app-main"},he={class:"app-scrollbar"},me=C(u({__name:"AppMain",setup(e){const t=r(),a=d(),l=p((()=>t.path));return(e,t)=>{const n=v("router-view");return f(),h("section",fe,[m("div",he,[g(n,null,{default:b((({Component:e})=>[g(y,{name:"el-fade-in",mode:"out-in"},{default:b((()=>[(f(),_(w,{include:k(a).cachedViews},[(f(),_(x(e),{key:l.value}))],1032,["include"]))])),_:2},1024)])),_:1})])])}}}),[["__scopeId","data-v-ff33bb27"]]),ge=C(u({__name:"index",props:{isActive:{type:Boolean,default:!1}},emits:["toggleClick"],setup(e,{emit:t}){const a=e,l=()=>{t("toggleClick")};return(e,t)=>{const n=v("el-icon");return f(),h("div",{onClick:l},[g(n,{size:20,class:"icon"},{default:b((()=>[a.isActive?(f(),_(k(E),{key:0})):(f(),_(k(A),{key:1}))])),_:1})])}}}),[["__scopeId","data-v-252d9bf8"]]);function be(e,t){void 0===t&&(t={});for(var a=function(e){for(var t=[],a=0;a<e.length;){var l=e[a];if("*"!==l&&"+"!==l&&"?"!==l)if("\\"!==l)if("{"!==l)if("}"!==l)if(":"!==l)if("("!==l)t.push({type:"CHAR",index:a,value:e[a++]});else{var n=1,o="";if("?"===e[s=a+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--n){s++;break}}else if("("===e[s]&&(n++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=e[s++]}else o+=e[s++]+e[s++];if(n)throw new TypeError("Unbalanced pattern at ".concat(a));if(!o)throw new TypeError("Missing pattern at ".concat(a));t.push({type:"PATTERN",index:a,value:o}),a=s}else{for(var r="",s=a+1;s<e.length;){var i=e.charCodeAt(s);if(!(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||95===i))break;r+=e[s++]}if(!r)throw new TypeError("Missing parameter name at ".concat(a));t.push({type:"NAME",index:a,value:r}),a=s}else t.push({type:"CLOSE",index:a,value:e[a++]});else t.push({type:"OPEN",index:a,value:e[a++]});else t.push({type:"ESCAPED_CHAR",index:a++,value:e[a++]});else t.push({type:"MODIFIER",index:a,value:e[a++]})}return t.push({type:"END",index:a,value:""}),t}(e),l=t.prefixes,n=void 0===l?"./":l,o="[^".concat(function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}(t.delimiter||"/#?"),"]+?"),r=[],s=0,i=0,c="",u=function(e){if(i<a.length&&a[i].type===e)return a[i++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var l=a[i],n=l.type,o=l.index;throw new TypeError("Unexpected ".concat(n," at ").concat(o,", expected ").concat(e))},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};i<a.length;){var v=u("CHAR"),f=u("NAME"),h=u("PATTERN");if(f||h){var m=v||"";-1===n.indexOf(m)&&(c+=m,m=""),c&&(r.push(c),c=""),r.push({name:f||s++,prefix:m,suffix:"",pattern:h||o,modifier:u("MODIFIER")||""})}else{var g=v||u("ESCAPED_CHAR");if(g)c+=g;else if(c&&(r.push(c),c=""),u("OPEN")){m=p();var b=u("NAME")||"",y=u("PATTERN")||"",_=p();d("CLOSE"),r.push({name:b||(y?s++:""),pattern:b&&!y?o:y,prefix:m,suffix:_,modifier:u("MODIFIER")||""})}else d("END")}}return r}function ye(e,t){return function(e,t){void 0===t&&(t={});var a=function(e){return e&&e.sensitive?"":"i"}(t),l=t.encode,n=void 0===l?function(e){return e}:l,o=t.validate,r=void 0===o||o,s=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:".concat(e.pattern,")$"),a)}));return function(t){for(var a="",l=0;l<e.length;l++){var o=e[l];if("string"!=typeof o){var i=t?t[o.name]:void 0,c="?"===o.modifier||"*"===o.modifier,u="*"===o.modifier||"+"===o.modifier;if(Array.isArray(i)){if(!u)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===i.length){if(c)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var d=0;d<i.length;d++){var p=n(i[d],o);if(r&&!s[l].test(p))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(p,'"'));a+=o.prefix+p+o.suffix}}else if("string"!=typeof i&&"number"!=typeof i){if(!c){var v=u?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(v))}}else{p=n(String(i),o);if(r&&!s[l].test(p))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(p,'"'));a+=o.prefix+p+o.suffix}}else a+=o}return a}}(be(e,t),t)}const _e={key:0,class:"no-redirect"},we=["onClick"],ke=C(u({__name:"index",setup(e){const t=r(),a=S(),o=l([]),s=()=>{o.value=t.matched.filter((e=>{var t,a;return(null==(t=e.meta)?void 0:t.title)&&!1!==(null==(a=e.meta)?void 0:a.breadcrumb)}))},i=e=>{const{redirect:l,path:n}=e;l?a.push(l):a.push((e=>ye(e)(t.params))(n))};return n((()=>t.path),(e=>{e.startsWith("/redirect/")||s()})),s(),(e,t)=>{const a=v("el-breadcrumb-item"),l=v("el-breadcrumb");return f(),_(l,{class:"app-breadcrumb"},{default:b((()=>[(f(!0),h(T,null,V(o.value,((e,t)=>(f(),_(a,{key:e.path},{default:b((()=>["noRedirect"===e.redirect||t===o.value.length-1?(f(),h("span",_e,M(e.meta.title),1)):(f(),h("a",{key:1,onClick:I((t=>i(e)),["prevent"])},M(e.meta.title),9,we))])),_:2},1024)))),128))])),_:1})}}}),[["__scopeId","data-v-94c6aa4b"]]),xe=e=>/^(https?:|mailto:|tel:)/.test(e),Ce=["href"],Ee=u({__name:"SidebarItemLink",props:{to:{}},setup(e){const t=e;return(e,a)=>{const l=v("router-link");return k(xe)(t.to)?(f(),h("a",{key:0,href:t.to,target:"_blank",rel:"noopener"},[R(e.$slots,"default")],8,Ce)):(f(),_(l,{key:1,to:t.to},{default:b((()=>[R(e.$slots,"default")])),_:3},8,["to"]))}}});function Ae(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function Se(e,t){for(var a,l="",n=0,o=-1,r=0,s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(47===a)break;a=47}if(47===a){if(o===s-1||1===r);else if(o!==s-1&&2===r){if(l.length<2||2!==n||46!==l.charCodeAt(l.length-1)||46!==l.charCodeAt(l.length-2))if(l.length>2){var i=l.lastIndexOf("/");if(i!==l.length-1){-1===i?(l="",n=0):n=(l=l.slice(0,i)).length-1-l.lastIndexOf("/"),o=s,r=0;continue}}else if(2===l.length||1===l.length){l="",n=0,o=s,r=0;continue}t&&(l.length>0?l+="/..":l="..",n=2)}else l.length>0?l+="/"+e.slice(o+1,s):l=e.slice(o+1,s),n=s-o-1;o=s,r=0}else 46===a&&-1!==r?++r:r=-1}return l}var Te={resolve:function(){for(var e,t="",a=!1,l=arguments.length-1;l>=-1&&!a;l--){var n;l>=0?n=arguments[l]:(void 0===e&&(e=process.cwd()),n=e),Ae(n),0!==n.length&&(t=n+"/"+t,a=47===n.charCodeAt(0))}return t=Se(t,!a),a?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(Ae(e),0===e.length)return".";var t=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return 0!==(e=Se(e,!t)).length||t||(e="."),e.length>0&&a&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return Ae(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var a=arguments[t];Ae(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":Te.normalize(e)},relative:function(e,t){if(Ae(e),Ae(t),e===t)return"";if((e=Te.resolve(e))===(t=Te.resolve(t)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var l=e.length,n=l-a,o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var r=t.length-o,s=n<r?n:r,i=-1,c=0;c<=s;++c){if(c===s){if(r>s){if(47===t.charCodeAt(o+c))return t.slice(o+c+1);if(0===c)return t.slice(o+c)}else n>s&&(47===e.charCodeAt(a+c)?i=c:0===c&&(i=0));break}var u=e.charCodeAt(a+c);if(u!==t.charCodeAt(o+c))break;47===u&&(i=c)}var d="";for(c=a+i+1;c<=l;++c)c!==l&&47!==e.charCodeAt(c)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(o+i):(o+=i,47===t.charCodeAt(o)&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(Ae(e),0===e.length)return".";for(var t=e.charCodeAt(0),a=47===t,l=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!n){l=o;break}}else n=!1;return-1===l?a?"/":".":a&&1===l?"//":e.slice(0,l)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Ae(e);var a,l=0,n=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var r=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){var i=e.charCodeAt(a);if(47===i){if(!o){l=a+1;break}}else-1===s&&(o=!1,s=a+1),r>=0&&(i===t.charCodeAt(r)?-1==--r&&(n=a):(r=-1,n=s))}return l===n?n=s:-1===n&&(n=e.length),e.slice(l,n)}for(a=e.length-1;a>=0;--a)if(47===e.charCodeAt(a)){if(!o){l=a+1;break}}else-1===n&&(o=!1,n=a+1);return-1===n?"":e.slice(l,n)},extname:function(e){Ae(e);for(var t=-1,a=0,l=-1,n=!0,o=0,r=e.length-1;r>=0;--r){var s=e.charCodeAt(r);if(47!==s)-1===l&&(n=!1,l=r+1),46===s?-1===t?t=r:1!==o&&(o=1):-1!==t&&(o=-1);else if(!n){a=r+1;break}}return-1===t||-1===l||0===o||1===o&&t===l-1&&t===a+1?"":e.slice(t,l)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var a=t.dir||t.root,l=t.base||(t.name||"")+(t.ext||"");return a?a===t.root?a+l:a+e+l:l}("/",e)},parse:function(e){Ae(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var a,l=e.charCodeAt(0),n=47===l;n?(t.root="/",a=1):a=0;for(var o=-1,r=0,s=-1,i=!0,c=e.length-1,u=0;c>=a;--c)if(47!==(l=e.charCodeAt(c)))-1===s&&(i=!1,s=c+1),46===l?-1===o?o=c:1!==u&&(u=1):-1!==o&&(u=-1);else if(!i){r=c+1;break}return-1===o||-1===s||0===u||1===u&&o===s-1&&o===r+1?-1!==s&&(t.base=t.name=0===r&&n?e.slice(1,s):e.slice(r,s)):(0===r&&n?(t.name=e.slice(1,o),t.base=e.slice(1,s)):(t.name=e.slice(r,o),t.base=e.slice(r,s)),t.ext=e.slice(o,s)),r>0?t.dir=e.slice(0,r-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Te.posix=Te;const Ve=F(Te),Me={key:2},Ie=C(u({__name:"SidebarItem",props:{item:{},isCollapse:{type:Boolean,default:!1},isTop:{type:Boolean,default:!1},isFirstLevel:{type:Boolean,default:!0},basePath:{default:""}},setup(e){const t=e,a=p((()=>{var e;return null==(e=t.item.meta)?void 0:e.alwaysShow})),l=p((()=>{var e;return(null==(e=t.item.children)?void 0:e.filter((e=>{var t;return!(null==(t=e.meta)?void 0:t.hidden)})))??[]})),n=p((()=>l.value.length)),o=p((()=>{const e=n.value;switch(!0){case e>1:return null;case 1===e:return l.value[0];default:return{...t.item,path:""}}})),r=e=>{switch(!0){case xe(e):return e;case xe(t.basePath):return t.basePath;default:return Ve.resolve(t.basePath,e)}};return(e,l)=>{var n;const s=v("SvgIcon"),i=v("el-menu-item"),c=v("sidebar-item",!0),u=v("el-sub-menu");return(null==(n=t.item.meta)?void 0:n.hidden)?D("",!0):(f(),h("div",{key:0,class:z({"simple-mode":t.isCollapse&&!e.isTop,"first-level":t.isFirstLevel})},[a.value||!o.value||o.value.children?(f(),_(u,{key:1,index:r(t.item.path),teleported:""},{title:b((()=>{var e,a,l;return[(null==(e=t.item.meta)?void 0:e.svgIcon)?(f(),_(s,{key:0,name:t.item.meta.svgIcon},null,8,["name"])):(null==(a=t.item.meta)?void 0:a.elIcon)?(f(),_(x(t.item.meta.elIcon),{key:1,class:"el-icon"})):D("",!0),(null==(l=t.item.meta)?void 0:l.title)?(f(),h("span",Me,M(t.item.meta.title),1)):D("",!0)]})),default:b((()=>[t.item.children?(f(!0),h(T,{key:0},V(t.item.children,(e=>(f(),_(c,{key:e.path,item:e,"is-collapse":t.isCollapse,"is-first-level":!1,"base-path":r(e.path)},null,8,["item","is-collapse","base-path"])))),128)):D("",!0)])),_:1},8,["index"])):(f(),h(T,{key:0},[o.value.meta?(f(),_(Ee,{key:0,to:r(o.value.path)},{default:b((()=>[g(i,{index:r(o.value.path)},P({default:b((()=>[o.value.meta.svgIcon?(f(),_(s,{key:0,name:o.value.meta.svgIcon},null,8,["name"])):o.value.meta.elIcon?(f(),_(x(o.value.meta.elIcon),{key:1,class:"el-icon"})):D("",!0)])),_:2},[o.value.meta.title?{name:"title",fn:b((()=>[L(M(o.value.meta.title),1)])),key:"0"}:void 0]),1032,["index"])])),_:1},8,["to"])):D("",!0)],64))],2))}}}),[["__scopeId","data-v-72444830"]]),Re=["src"],Fe=["src"],Pe=C(u({__name:"index",props:{collapse:{type:Boolean,default:!0}},setup(e){const t=e,a=N(),{layoutMode:l}=O(a);return(e,a)=>{const n=v("router-link");return f(),h("div",{class:z(["layout-logo-container",{collapse:t.collapse,"layout-mode-top":"top"===k(l)}])},[g(y,{name:"layout-logo-fade"},{default:b((()=>[t.collapse?(f(),_(n,{key:"collapse",to:"/"},{default:b((()=>[m("img",{src:k("/v3-admin-vite/static/logo-cc70e06e.png"),class:"layout-logo"},null,8,Re)])),_:1})):(f(),_(n,{key:"expand",to:"/"},{default:b((()=>[m("img",{src:"left"!==k(l)?k("/v3-admin-vite/static/logo-text-2-eef467fb.png"):k("/v3-admin-vite/static/logo-text-1-b6b0364d.png"),class:"layout-logo-text"},null,8,Fe)])),_:1}))])),_:1})],2)}}}),[["__scopeId","data-v-8474c76e"]]),De=C(u({__name:"index",setup(e){q((e=>({"5c2ec67e":P.value,"19ddf9ab":R.value,ea20f6da:F.value,"201746b4":I.value})));const t=j("--v3-sidebar-menu-bg-color"),a=j("--v3-sidebar-menu-text-color"),l=j("--v3-sidebar-menu-active-text-color"),n=r(),o=ve(),s=W(),i=N(),{sidebar:c,device:u}=O(o),{layoutMode:d,showLogo:m}=O(i),y=p((()=>{const{meta:{activeMenu:e},path:t}=n;return e||t})),w=p((()=>!c.value.opened)),x=p((()=>"left"===d.value)),C=p((()=>"top"===d.value)),E=p((()=>u.value===de.Mobile)),A=p((()=>x.value&&m.value)),S=p((()=>x.value?t:void 0)),M=p((()=>x.value?a:void 0)),I=p((()=>x.value?l:void 0)),R=p((()=>"top"!==d.value?j("--v3-sidebar-menu-item-height"):j("--v3-navigationbar-height"))),F=p((()=>"top"!==d.value?j("--v3-sidebar-menu-hover-bg-color"):"transparent")),P=p((()=>"top"!==d.value?"2px":"0px"));return(e,t)=>{const a=v("el-menu"),l=v("el-scrollbar");return f(),h("div",{class:z({"has-logo":A.value})},[A.value?(f(),_(Pe,{key:0,collapse:w.value},null,8,["collapse"])):D("",!0),g(l,{"wrap-class":"scrollbar-wrapper"},{default:b((()=>[g(a,{"default-active":y.value,collapse:w.value&&!C.value,"background-color":S.value,"text-color":M.value,"active-text-color":I.value,"unique-opened":!0,"collapse-transition":!1,mode:C.value&&!E.value?"horizontal":"vertical"},{default:b((()=>[(f(!0),h(T,null,V(k(s).routes,(e=>(f(),_(Ie,{key:e.path,item:e,"base-path":e.path,"is-collapse":w.value,"is-top":C.value},null,8,["item","base-path","is-collapse","is-top"])))),128))])),_:1},8,["default-active","collapse","background-color","text-color","active-text-color","mode"])])),_:1})],2)}}}),[["__scopeId","data-v-e571e362"]]),Le=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],ze=(()=>{if("undefined"==typeof document)return!1;const e=Le[0],t={};for(const a of Le){if((null==a?void 0:a[1])in document){for(const[l,n]of a.entries())t[e[l]]=n;return t}}return!1})(),Ne={change:ze.fullscreenchange,error:ze.fullscreenerror};let Oe={request:(e=document.documentElement,t)=>new Promise(((a,l)=>{const n=()=>{Oe.off("change",n),a()};Oe.on("change",n);const o=e[ze.requestFullscreen](t);o instanceof Promise&&o.then(n).catch(l)})),exit:()=>new Promise(((e,t)=>{if(!Oe.isFullscreen)return void e();const a=()=>{Oe.off("change",a),e()};Oe.on("change",a);const l=document[ze.exitFullscreen]();l instanceof Promise&&l.then(a).catch(t)})),toggle:(e,t)=>Oe.isFullscreen?Oe.exit():Oe.request(e,t),onchange(e){Oe.on("change",e)},onerror(e){Oe.on("error",e)},on(e,t){const a=Ne[e];a&&document.addEventListener(a,t,!1)},off(e,t){const a=Ne[e];a&&document.removeEventListener(a,t,!1)},raw:ze};Object.defineProperties(Oe,{isFullscreen:{get:()=>Boolean(document[ze.fullscreenElement])},element:{enumerable:!0,get:()=>document[ze.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[ze.fullscreenEnabled])}}),ze||(Oe={isEnabled:!1});const qe=Oe,je=C(u({__name:"index",props:{element:{default:"html"},openTips:{default:"全屏"},exitTips:{default:"退出全屏"},content:{type:Boolean,default:!1}},setup(e){const t=e,a=l(!1),n=p((()=>a.value?t.exitTips:t.openTips)),o=p((()=>a.value?"fullscreen-exit":"fullscreen")),r=()=>{const e=document.querySelector(t.element)||void 0;qe.isEnabled?qe.toggle(e):$.warning("您的浏览器无法工作")},s=()=>{a.value=qe.isFullscreen};B((e=>{qe.on("change",s),e((()=>{qe.isEnabled&&qe.off("change",s)}))}));const i=l(!1),c=p((()=>i.value?"内容区复原":"内容区放大")),u=p((()=>i.value?"fullscreen-exit":"fullscreen")),d=()=>{document.body.className=i.value?"":"content-large",i.value=!i.value};return(e,t)=>{const l=v("SvgIcon"),s=v("el-tooltip"),i=v("el-dropdown-item"),p=v("el-dropdown-menu"),m=v("el-dropdown");return f(),h("div",null,[e.content?(f(),_(m,{key:1},{dropdown:b((()=>[g(p,null,{default:b((()=>[g(i,{onClick:d},{default:b((()=>[L(M(c.value),1)])),_:1}),g(i,{onClick:r,disabled:a.value},{default:b((()=>[L("内容区全屏")])),_:1},8,["disabled"])])),_:1})])),default:b((()=>[g(l,{name:u.value},null,8,["name"])])),_:1})):(f(),_(s,{key:0,effect:"dark",content:n.value,placement:"bottom"},{default:b((()=>[g(l,{name:o.value,onClick:r},null,8,["name"])])),_:1},8,["content"]))])}}}),[["__scopeId","data-v-9e7c36e4"]]),We={class:"card-header"},Be={class:"card-title"},$e={class:"card-time"},He={key:0,class:"card-avatar"},Xe=["src"],Ue={class:"card-body"},Ge=C(u({__name:"NotifyList",props:{list:{}},setup(e){const t=e;return(e,a)=>{const l=v("el-empty"),n=v("el-tag"),o=v("el-card");return 0===t.list.length?(f(),_(l,{key:0})):(f(!0),h(T,{key:1},V(t.list,((e,t)=>(f(),_(o,{key:t,shadow:"never",class:"card-container"},{header:b((()=>[m("div",We,[m("div",null,[m("span",null,[m("span",Be,M(e.title),1),e.extra?(f(),_(n,{key:0,type:e.status,effect:"plain",size:"small"},{default:b((()=>[L(M(e.extra),1)])),_:2},1032,["type"])):D("",!0)]),m("div",$e,M(e.datetime),1)]),e.avatar?(f(),h("div",He,[m("img",{src:e.avatar,width:"34"},null,8,Xe)])):D("",!0)])])),default:b((()=>[m("div",Ue,M(e.description??"No Data"),1)])),_:2},1024)))),128))}}}),[["__scopeId","data-v-137655f9"]]),Ye=[{avatar:"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",title:"V3 Admin Vite 上线啦",datetime:"半年前",description:"一个免费开源的中后台管理系统基础解决方案,基于 Vue3、TypeScript、Element Plus、Pinia 和 Vite 等主流技术"},{avatar:"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",title:"V3 Admin 上线啦",datetime:"一年前",description:"一个中后台管理系统基础解决方案,基于 Vue3、TypeScript、Element Plus 和 Pinia"}],Je=[{avatar:"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",title:"来自楚门的世界",description:"如果再也不能见到你,祝你早安、午安和晚安",datetime:"1998-06-05"},{avatar:"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",title:"来自大话西游",description:"如果非要在这份爱上加上一个期限,我希望是一万年",datetime:"1995-02-04"},{avatar:"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",title:"来自龙猫",description:"心存善意,定能途遇天使",datetime:"1988-04-16"}],Ze=[{title:"任务名称",description:"这家伙很懒,什么都没留下",extra:"未开始",status:"info"},{title:"任务名称",description:"这家伙很懒,什么都没留下",extra:"进行中",status:""},{title:"任务名称",description:"这家伙很懒,什么都没留下",extra:"已超时",status:"danger"}],Ke={class:"notify"},Qe={class:"notify-history"},et=C(u({__name:"index",setup(e){const t=p((()=>n.value.reduce(((e,t)=>e+t.list.length),0))),a=l("通知"),n=l([{name:"通知",type:"primary",list:Ye},{name:"消息",type:"danger",list:Je},{name:"待办",type:"warning",list:Ze}]),o=()=>{$.success(`跳转到${a.value}历史页面`)};return(e,l)=>{const r=v("el-icon"),s=v("el-tooltip"),i=v("el-badge"),c=v("el-scrollbar"),u=v("el-tab-pane"),d=v("el-tabs"),p=v("el-button"),y=v("el-popover");return f(),h("div",Ke,[g(y,{placement:"bottom",width:350,trigger:"click"},{reference:b((()=>[g(i,{value:t.value,max:99,hidden:0===t.value},{default:b((()=>[g(s,{effect:"dark",content:"消息通知",placement:"bottom"},{default:b((()=>[g(r,{size:20},{default:b((()=>[g(k(H))])),_:1})])),_:1})])),_:1},8,["value","hidden"])])),default:b((()=>[g(d,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=e=>a.value=e),class:"demo-tabs",stretch:""},{default:b((()=>[(f(!0),h(T,null,V(n.value,((e,t)=>(f(),_(u,{name:e.name,key:t},{label:b((()=>[L(M(e.name)+" ",1),g(i,{value:e.list.length,max:99,type:e.type},null,8,["value","type"])])),default:b((()=>[g(c,{height:"400px"},{default:b((()=>[g(Ge,{list:e.list},null,8,["list"])])),_:2},1024)])),_:2},1032,["name"])))),128))])),_:1},8,["modelValue"]),m("div",Qe,[g(p,{link:"",onClick:o},{default:b((()=>[L("查看"+M(a.value)+"历史",1)])),_:1})])])),_:1})])}}}),[["__scopeId","data-v-50089150"]]),tt={class:"navigation-bar"},at={class:"right-menu"},lt={class:"right-menu-avatar"},nt={target:"_blank",href:"https://juejin.cn/post/7089377403717287972"},ot={target:"_blank",href:"https://github.com/un-pany/v3-admin-vite"},rt={target:"_blank",href:"https://gitee.com/un-pany/v3-admin-vite"},st=(e=>(G("data-v-2891b4fa"),e=e(),Y(),e))((()=>m("span",{style:{display:"block"}},"退出登录",-1))),it=C(u({__name:"index",setup(e){const t=S(),a=ve(),l=N(),n=X(),{sidebar:o,device:r}=O(a),{layoutMode:s,showNotify:i,showThemeSwitch:c,showScreenfull:u}=O(l),d=p((()=>"top"===s.value)),y=p((()=>r.value===de.Mobile)),w=()=>{a.toggleSidebar(!1)},x=()=>{n.logout(),t.push("/login")};return(e,t)=>{const a=v("el-avatar"),l=v("el-dropdown-item"),r=v("el-dropdown-menu"),s=v("el-dropdown");return f(),h("div",tt,[!d.value||y.value?(f(),_(ge,{key:0,"is-active":k(o).opened,class:"hamburger",onToggleClick:w},null,8,["is-active"])):D("",!0),!d.value||y.value?(f(),_(ke,{key:1,class:"breadcrumb"})):D("",!0),d.value&&!y.value?(f(),_(De,{key:2,class:"sidebar"})):D("",!0),m("div",at,[k(u)?(f(),_(je,{key:0,class:"right-menu-item"})):D("",!0),k(c)?(f(),_(ue,{key:1,class:"right-menu-item"})):D("",!0),k(i)?(f(),_(et,{key:2,class:"right-menu-item"})):D("",!0),g(s,{class:"right-menu-item"},{dropdown:b((()=>[g(r,null,{default:b((()=>[m("a",nt,[g(l,null,{default:b((()=>[L("中文文档")])),_:1})]),m("a",ot,[g(l,null,{default:b((()=>[L("GitHub")])),_:1})]),m("a",rt,[g(l,null,{default:b((()=>[L("Gitee")])),_:1})]),g(l,{divided:"",onClick:x},{default:b((()=>[st])),_:1})])),_:1})])),default:b((()=>[m("div",lt,[g(a,{icon:k(U),size:30},null,8,["icon"]),m("span",null,M(k(n).username),1)])])),_:1})])])}}}),[["__scopeId","data-v-2891b4fa"]]),ct={class:"select-layout-mode"},ut=C(u({__name:"SelectLayoutMode",setup(e){const t=N(),{layoutMode:a}=O(t),l=p((()=>"left"===a.value)),n=p((()=>"top"===a.value)),o=p((()=>"left-top"===a.value));return(e,t)=>{const r=v("el-aside"),s=v("el-header"),i=v("el-main"),c=v("el-container"),u=v("el-tooltip");return f(),h("div",ct,[g(u,{content:"左侧模式"},{default:b((()=>[g(c,{class:z(["layout-mode left",{active:l.value}]),onClick:t[0]||(t[0]=e=>a.value="left")},{default:b((()=>[g(r),g(c,null,{default:b((()=>[g(s),g(i)])),_:1})])),_:1},8,["class"])])),_:1}),g(u,{content:"顶部模式(开发中)"},{default:b((()=>[g(c,{class:z(["layout-mode top",{active:n.value}]),onClick:t[1]||(t[1]=e=>a.value="top")},{default:b((()=>[g(s),g(i)])),_:1},8,["class"])])),_:1}),g(u,{content:"混合模式"},{default:b((()=>[g(c,{class:z(["layout-mode left-top",{active:o.value}]),onClick:t[2]||(t[2]=e=>a.value="left-top")},{default:b((()=>[g(s),g(c,null,{default:b((()=>[g(r),g(i)])),_:1})])),_:1},8,["class"])])),_:1})])}}}),[["__scopeId","data-v-302f39c3"]]),dt=e=>(G("data-v-8fb8a8fb"),e=e(),Y(),e),pt={class:"setting-container"},vt=dt((()=>m("h4",null,"布局配置",-1))),ft=dt((()=>m("h4",null,"功能配置",-1))),ht={class:"setting-name"},mt=C(u({__name:"index",setup(e){const t=N(),{layoutMode:a,showTagsView:l,showLogo:n,fixedHeader:o,showNotify:r,showThemeSwitch:s,showScreenfull:i,cacheTagsView:c,showGreyMode:u,showColorWeakness:d}=O(t),p={"显示标签栏":l,"显示 Logo":n,"固定 Header":o,"显示消息通知":r,"显示切换主题按钮":s,"显示全屏按钮":i,"是否缓存标签栏":c,"显示灰色模式":u,"显示色弱模式":d};return B((()=>{"left"!==a.value&&(o.value=!0)})),(e,t)=>{const l=v("el-divider"),n=v("el-switch"),o=v("el-button");return f(),h("div",pt,[vt,g(ut),g(l),ft,(f(),h(T,null,V(p,((e,t,l)=>m("div",{class:"setting-item",key:l},[m("span",ht,M(t),1),g(n,{modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,disabled:"left"!==k(a)&&"固定 Header"===t},null,8,["modelValue","onUpdate:modelValue","disabled"])]))),64)),g(o,{type:"danger",icon:k(J),onClick:k(Z)},{default:b((()=>[L("重 置")])),_:1},8,["icon","onClick"])])}}}),[["__scopeId","data-v-8fb8a8fb"]]),gt={class:"scroll-container"},bt=C(u({__name:"ScrollPane",props:{tagRefs:{}},setup(e){const t=e,a=r(),o=N(),s=l(),i=l();let c=0;const u=({scrollLeft:e})=>{c=e},d=({deltaY:e})=>{/^-/.test(e.toString())?y("left"):y("right")},p=()=>{const e=i.value.clientWidth,t=s.value.wrapRef.clientWidth;return{scrollbarContentRefWidth:e,scrollbarRefWidth:t,lastDistance:e-t-c}},y=(e,t=200)=>{let a=0;const{scrollbarContentRefWidth:l,scrollbarRefWidth:n,lastDistance:o}=p();n>l||(a="left"===e?Math.max(0,c-t):Math.min(c+t,c+o),s.value.setScrollLeft(a))},w=()=>{const e=t.tagRefs;for(let t=0;t<e.length;t++)if(a.path===e[t].$props.to.path){const a=e[t].$el,l=a.offsetWidth,n=a.offsetLeft,{scrollbarRefWidth:o}=p();if(n<c){return void y("left",c-n)}const r=o+c-l;if(n>r){return void y("right",n-r)}}};return n(a,(()=>{K(w)}),{deep:!0}),(e,t)=>{const a=v("el-icon");return f(),h("div",gt,[g(a,{class:"arrow left",onClick:t[0]||(t[0]=e=>y("left"))},{default:b((()=>[g(k(Q))])),_:1}),g(k(ee),{ref_key:"scrollbarRef",ref:s,onWheelPassive:d,onScroll:u},{default:b((()=>[m("div",{ref_key:"scrollbarContentRef",ref:i,class:"scrollbar-content"},[R(e.$slots,"default",{},void 0,!0)],512)])),_:3},512),g(a,{class:"arrow right",onClick:t[1]||(t[1]=e=>y("right"))},{default:b((()=>[g(k(te))])),_:1}),k(o).showScreenfull?(f(),_(je,{key:0,element:".app-main",content:!0,class:"screenfull"})):D("",!0)])}}}),[["__scopeId","data-v-01845fab"]]),yt={class:"tags-view-container"},_t=C(u({__name:"index",setup(e){const t=ae(),a=S(),o=r(),s=d(),c=W(),u=l([]),p=l(!1),y=l(0),w=l(0),x=l({});let C=[];const E=e=>e.path===o.path,A=e=>{var t;return null==(t=e.meta)?void 0:t.affix},R=(e,t="/")=>{const a=[];return e.forEach((e=>{if(A(e)){const l=Ve.resolve(t,e.path);a.push({fullPath:l,path:l,name:e.name,meta:{...e.meta}})}if(e.children){const t=R(e.children,e.path);a.push(...t)}})),a},F=()=>{o.name&&(s.addVisitedView(o),s.addCachedView(o))},P=e=>{s.delVisitedView(e),s.delCachedView(e),E(e)&&O(s.visitedViews,e)},N=()=>{const e=x.value.fullPath;e!==o.path&&void 0!==e&&a.push(e),s.delOthersVisitedViews(x.value),s.delOthersCachedViews(x.value)},O=(e,t)=>{const l=e.slice(-1)[0],n=null==l?void 0:l.fullPath;void 0!==n?a.push(n):"Dashboard"===t.name?a.push({path:"/redirect"+t.path,query:t.query}):a.push("/")},q=()=>{p.value=!1};return n(o,(()=>{F()}),{deep:!0}),n(p,(e=>{e?document.body.addEventListener("click",q):document.body.removeEventListener("click",q)})),i((()=>{(()=>{C=R(c.routes);for(const e of C)e.name&&s.addVisitedView(e)})(),F()})),(e,l)=>{const n=v("el-icon");return f(),h("div",yt,[g(bt,{class:"tags-view-wrapper","tag-refs":u.value},{default:b((()=>[(f(!0),h(T,null,V(k(s).visitedViews,(e=>(f(),_(k(le),{ref_for:!0,ref_key:"tagRefs",ref:u,key:e.path,class:z([{active:E(e)},"tags-view-item"]),to:{path:e.path,query:e.query},onMouseup:I((t=>!A(e)&&P(e)),["middle"]),onContextmenu:I((a=>((e,a)=>{const l=t.proxy.$el.getBoundingClientRect().left,n=t.proxy.$el.offsetWidth-105,o=a.clientX-l+15;w.value=o>n?n:o,y.value=a.clientY,p.value=!0,x.value=e})(e,a)),["prevent"])},{default:b((()=>{var t;return[L(M(null==(t=e.meta)?void 0:t.title)+" ",1),A(e)?D("",!0):(f(),_(n,{key:0,size:12,onClick:I((t=>P(e)),["prevent","stop"])},{default:b((()=>[g(k(ne))])),_:2},1032,["onClick"]))]})),_:2},1032,["class","to","onMouseup","onContextmenu"])))),128))])),_:1},8,["tag-refs"]),oe(m("ul",{class:"contextmenu",style:se({left:w.value+"px",top:y.value+"px"})},[m("li",{onClick:l[0]||(l[0]=e=>{return t=x.value,s.delCachedView(t),void a.replace({path:"/redirect"+t.path,query:t.query});var t})},"刷新"),A(x.value)?D("",!0):(f(),h("li",{key:0,onClick:l[1]||(l[1]=e=>P(x.value))},"关闭")),m("li",{onClick:N},"关闭其它"),m("li",{onClick:l[2]||(l[2]=e=>{return t=x.value,s.delAllVisitedViews(),s.delAllCachedViews(),void(C.some((e=>e.path===o.path))||O(s.visitedViews,t));var t})},"关闭所有")],4),[[re,p.value]])])}}}),[["__scopeId","data-v-6256a9c5"]]),wt=C(u({__name:"index",props:{buttonTop:{default:350}},setup(e){const t=e;q((e=>({"184df93f":a})));const a=t.buttonTop+"px",n=l(!1);return(e,t)=>{const a=v("el-icon"),l=v("el-drawer");return f(),h(T,null,[m("div",{class:"handle-button",onClick:t[0]||(t[0]=e=>n.value=!0)},[g(a,{size:24},{default:b((()=>[g(k(ie))])),_:1})]),g(l,{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=e=>n.value=e),size:"300px","with-header":!1},{default:b((()=>[R(e.$slots,"default",{},void 0,!0)])),_:3},8,["modelValue"])],64)}}}),[["__scopeId","data-v-79eaf320"]]),kt=C(u({__name:"LeftMode",setup(e){const t=ve(),a=N(),{showTagsView:l,fixedHeader:n}=O(a),o=p((()=>({hideSidebar:!t.sidebar.opened,openSidebar:t.sidebar.opened,withoutAnimation:t.sidebar.withoutAnimation,mobile:t.device===de.Mobile}))),r=()=>{t.closeSidebar(!1)};return(e,t)=>(f(),h("div",{class:z([o.value,"app-wrapper"])},[o.value.mobile&&o.value.openSidebar?(f(),h("div",{key:0,class:"drawer-bg",onClick:r})):D("",!0),g(k(De),{class:"sidebar-container"}),m("div",{class:z([{hasTagsView:k(l)},"main-container"])},[m("div",{class:z([{"fixed-header":k(n)},"layout-header"])},[g(k(it)),oe(g(k(_t),null,null,512),[[re,k(l)]])],2),g(k(me),{class:"app-main"})],2)],2))}}),[["__scopeId","data-v-f24dda26"]]),xt={class:"app-wrapper"},Ct={class:"fixed-header layout-header"},Et={class:"content"},At=C(u({__name:"TopMode",setup(e){const t=N(),{showTagsView:a,showLogo:l}=O(t);return(e,t)=>(f(),h("div",xt,[m("div",Ct,[m("div",Et,[k(l)?(f(),_(k(Pe),{key:0,collapse:!1,class:"logo"})):D("",!0),g(k(it),{class:"navigation-bar"})]),oe(g(k(_t),null,null,512),[[re,k(a)]])]),m("div",{class:z([{hasTagsView:k(a)},"main-container"])},[g(k(me),{class:"app-main"})],2)]))}}),[["__scopeId","data-v-8946dd49"]]),St={class:"fixed-header layout-header"},Tt={class:"content"},Vt=C(u({__name:"LeftTopMode",setup(e){const t=ve(),a=N(),{showTagsView:l,showLogo:n}=O(a),o=p((()=>({hideSidebar:!t.sidebar.opened})));return(e,t)=>(f(),h("div",{class:z([o.value,"app-wrapper"])},[m("div",St,[k(n)?(f(),_(k(Pe),{key:0,collapse:!1,class:"logo"})):D("",!0),m("div",Tt,[g(k(it)),oe(g(k(_t),null,null,512),[[re,k(l)]])])]),m("div",{class:z([{hasTagsView:k(l)},"main-container"])},[g(k(De),{class:"sidebar-container"}),g(k(me),{class:"app-main"})],2)],2))}}),[["__scopeId","data-v-08489ac9"]]),Mt="--v3-tagsview-height",It=C(u({__name:"index",setup(e){(()=>{const e=r(),t=ve(),a=()=>document.body.getBoundingClientRect().width-1<992,l=()=>{if(!document.hidden){const e=a();t.toggleDevice(e?de.Mobile:de.Desktop),e&&t.closeSidebar(!0)}};n((()=>e.name),(()=>{t.device===de.Mobile&&t.sidebar.opened&&t.closeSidebar(!1)})),s((()=>{window.addEventListener("resize",l)})),i((()=>{a()&&(t.toggleDevice(de.Mobile),t.closeSidebar(!0))})),c((()=>{window.removeEventListener("resize",l)}))})();const t=ve(),a=N(),{showSettings:l,layoutMode:o,showTagsView:u,showGreyMode:d,showColorWeakness:v}=O(a),m=p((()=>({showGreyMode:d.value,showColorWeakness:v.value}))),y=j(Mt);return B((()=>{u.value?ce(Mt,y):ce(Mt,"0px")})),(e,a)=>(f(),h("div",{class:z(m.value)},["left"===k(o)||k(t).device===k(de).Mobile?(f(),_(kt,{key:0})):"top"===k(o)?(f(),_(At,{key:1})):"left-top"===k(o)?(f(),_(Vt,{key:2})):D("",!0),k(l)?(f(),_(k(wt),{key:3},{default:b((()=>[g(k(mt))])),_:1})):D("",!0)],2))}}),[["__scopeId","data-v-606e13ce"]]);export{It as default};
|