15 lines
28 KiB
JavaScript
15 lines
28 KiB
JavaScript
import{i as ge,d as F,u as ae,r as U,w as G,o as Ve,a as B,b as v,c as V,e as y,f as g,g as b,h as se,F as ee,T as Le,t as j,j as T,k as ne,_ as W,l as _e,n as Y,m as h,p as O,q as ve,s as E,v as C,x as N,E as $e,y as xe,z as Fe,K as De,A as be,B as Ce,C as Ee,D as le,G as ke,H as Pe,I as fe,J as Te,L as we,M as Me,N as He,O as Ie,P as Re,Q as Ne,R as Oe}from"./index.3aa93515.js";import{_ as ze}from"./plugin-vue_export-helper.41ffa612.js";import{S as z}from"./index.d002fc82.js";function Ue(r){for(var e=[],t=0;t<r.length;){var a=r[t];if(a==="*"||a==="+"||a==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(a==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(a==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(a==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(a===":"){for(var o="",n=t+1;n<r.length;){var i=r.charCodeAt(n);if(i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||i===95){o+=r[n++];continue}break}if(!o)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:o}),t=n;continue}if(a==="("){var l=1,s="",n=t+1;if(r[n]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(n));for(;n<r.length;){if(r[n]==="\\"){s+=r[n++]+r[n++];continue}if(r[n]===")"){if(l--,l===0){n++;break}}else if(r[n]==="("&&(l++,r[n+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(n));s+=r[n++]}if(l)throw new TypeError("Unbalanced pattern at ".concat(t));if(!s)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:s}),t=n;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function We(r,e){e===void 0&&(e={});for(var t=Ue(r),a=e.prefixes,o=a===void 0?"./":a,n=e.delimiter,i=n===void 0?"/#?":n,l=[],s=0,f=0,c="",u=function(x){if(f<t.length&&t[f].type===x)return t[f++].value},d=function(x){var S=u(x);if(S!==void 0)return S;var P=t[f],te=P.type,ie=P.index;throw new TypeError("Unexpected ".concat(te," at ").concat(ie,", expected ").concat(x))},_=function(){for(var x="",S;S=u("CHAR")||u("ESCAPED_CHAR");)x+=S;return x},w=function(x){for(var S=0,P=i;S<P.length;S++){var te=P[S];if(x.indexOf(te)>-1)return!0}return!1},$=function(x){var S=l[l.length-1],P=x||(S&&typeof S=="string"?S:"");if(S&&!P)throw new TypeError('Must have text between two parameters, missing text after "'.concat(S.name,'"'));return!P||w(P)?"[^".concat(ue(i),"]+?"):"(?:(?!".concat(ue(P),")[^").concat(ue(i),"])+?")};f<t.length;){var L=u("CHAR"),H=u("NAME"),Q=u("PATTERN");if(H||Q){var k=L||"";o.indexOf(k)===-1&&(c+=k,k=""),c&&(l.push(c),c=""),l.push({name:H||s++,prefix:k,suffix:"",pattern:Q||$(k),modifier:u("MODIFIER")||""});continue}var J=L||u("ESCAPED_CHAR");if(J){c+=J;continue}c&&(l.push(c),c="");var X=u("OPEN");if(X){var k=_(),q=u("NAME")||"",M=u("PATTERN")||"",K=_();d("CLOSE"),l.push({name:q||(M?s++:""),pattern:q&&!M?$(k):M,prefix:k,suffix:K,modifier:u("MODIFIER")||""});continue}d("END")}return l}function Qe(r,e){return qe(We(r,e),e)}function qe(r,e){e===void 0&&(e={});var t=Ke(e),a=e.encode,o=a===void 0?function(s){return s}:a,n=e.validate,i=n===void 0?!0:n,l=r.map(function(s){if(typeof s=="object")return new RegExp("^(?:".concat(s.pattern,")$"),t)});return function(s){for(var f="",c=0;c<r.length;c++){var u=r[c];if(typeof u=="string"){f+=u;continue}var d=s?s[u.name]:void 0,_=u.modifier==="?"||u.modifier==="*",w=u.modifier==="*"||u.modifier==="+";if(Array.isArray(d)){if(!w)throw new TypeError('Expected "'.concat(u.name,'" to not repeat, but got an array'));if(d.length===0){if(_)continue;throw new TypeError('Expected "'.concat(u.name,'" to not be empty'))}for(var $=0;$<d.length;$++){var L=o(d[$],u);if(i&&!l[c].test(L))throw new TypeError('Expected all "'.concat(u.name,'" to match "').concat(u.pattern,'", but got "').concat(L,'"'));f+=u.prefix+L+u.suffix}continue}if(typeof d=="string"||typeof d=="number"){var L=o(String(d),u);if(i&&!l[c].test(L))throw new TypeError('Expected "'.concat(u.name,'" to match "').concat(u.pattern,'", but got "').concat(L,'"'));f+=u.prefix+L+u.suffix;continue}if(!_){var H=w?"an array":"a string";throw new TypeError('Expected "'.concat(u.name,'" to be ').concat(H))}}return f}}function ue(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ke(r){return r&&r.sensitive?"":"i"}function re(r){return ge.global.te("route."+r)?ge.global.t("route."+r):r}const Ye={key:0,class:"no-redirect"},Je=["onClick"],Ge=F({__name:"index",setup(r){const e=ae(),t=l=>{const{params:s}=e;return Qe(l)(s)},a=U([]);function o(){let l=e.matched.filter(f=>f.meta&&f.meta.title);const s=l[0];n(s)||(l=[{path:"/dashboard",meta:{title:"dashboard"}}].concat(l)),a.value=l.filter(f=>f.meta&&f.meta.title&&f.meta.breadcrumb!==!1)}function n(l){const s=l&&l.name;return s?s.toString().trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase():!1}function i(l){const{redirect:s,path:f}=l;if(s){_e.push(s).catch(c=>{console.warn(c)});return}_e.push(t(f)).catch(c=>{console.warn(c)})}return G(()=>e.path,l=>{l.startsWith("/redirect/")||o()}),Ve(()=>{o()}),(l,s)=>{const f=B("el-breadcrumb-item"),c=B("el-breadcrumb");return v(),V(c,{class:"app-breadcrumb","separator-class":"el-icon-arrow-right"},{default:y(()=>[g(Le,{name:"breadcrumb"},{default:y(()=>[(v(!0),b(ee,null,se(a.value,(u,d)=>(v(),V(f,{key:u.path},{default:y(()=>[u.redirect==="noredirect"||d===a.value.length-1?(v(),b("span",Ye,j(T(re)(u.meta.title)),1)):(v(),b("a",{key:1,onClick:ne(_=>i(u),["prevent"])},j(T(re)(u.meta.title)),9,Je))]),_:2},1024))),128))]),_:1})]),_:1})}}});var je=W(Ge,[["__scopeId","data-v-b50ef614"]]);const Xe=F({__name:"index",props:{isActive:{required:!0,type:Boolean,default:!1}},emits:["toggleClick"],setup(r,{emit:e}){const t=e;function a(){t("toggleClick")}return(o,n)=>(v(),b("div",{style:{padding:"0 15px"},onClick:a},[(v(),b("svg",{class:Y([{"is-active":r.isActive},"hamburger"]),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},[...n[0]||(n[0]=[h("path",{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"},null,-1)])],2))]))}});var Ze=W(Xe,[["__scopeId","data-v-4e6f274c"]]);const et=F({name:"CaretBottom"}),tt={viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},nt=h("path",{fill:"currentColor",d:"m192 384 320 384 320-384z"},null,-1),rt=[nt];function at(r,e,t,a,o,n){return v(),b("svg",tt,rt)}var st=ze(et,[["render",at]]);const it={class:"navbar"},ot={class:"right-menu"},lt={class:"avatar-wrapper"},ut={style:{"line-height":"40px"}},ct=F({__name:"Navbar",setup(r){O();const{app:e,user:t,tagsView:a}=O(),o=ae(),n=ve(),i=E(()=>e.sidebar),l=E(()=>e.device),s=E(()=>t.nickname);function f(){e.toggleSidebar()}function c(){$e.confirm("\u786E\u5B9A\u6CE8\u9500\u5E76\u9000\u51FA\u7CFB\u7EDF\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{t.logout().then(()=>{a.delAllViews()}).then(()=>{n.push(`/login?redirect=${o.fullPath}`)})})}return(u,d)=>{const _=B("el-dropdown-item"),w=B("el-dropdown-menu"),$=B("el-dropdown");return v(),b("div",it,[g(Ze,{id:"hamburger-container","is-active":i.value.opened,class:"hamburger-container",onToggleClick:f},null,8,["is-active"]),g(je,{id:"breadcrumb-container",class:"breadcrumb-container"}),h("div",ot,[l.value!=="mobile"?(v(),b(ee,{key:0},[C(` <search id="header-search" class="right-menu-item" />\r
|
|
<error-log class="errLog-container right-menu-item hover-effect" />`),C(` <screenfull id="screenfull" class="right-menu-item hover-effect" />\r
|
|
<el-tooltip content="\u5E03\u5C40\u5927\u5C0F" effect="dark" placement="bottom">\r
|
|
<size-select id="size-select" class="right-menu-item hover-effect" />\r
|
|
</el-tooltip>\r
|
|
<lang-select class="right-menu-item hover-effect" /> `)],64)):C("v-if",!0),g($,{class:"avatar-container right-menu-item hover-effect",trigger:"click"},{dropdown:y(()=>[g(w,null,{default:y(()=>[C(` <router-link to="/">\r
|
|
<el-dropdown-item>{{ $t('navbar.dashboard') }}</el-dropdown-item>\r
|
|
<a target="_blank" href="https://www.cnblogs.com/haoxianrui/">\r
|
|
<el-dropdown-item>{{ $t('navbar.document') }}</el-dropdown-item>\r
|
|
</a> `),C(` <el-dropdown-item divided @click="password">\r
|
|
{{ $t('navbar.password') }}\r
|
|
</el-dropdown-item> `),g(_,{divided:"",onClick:c},{default:y(()=>[N(j(u.$t("navbar.logout")),1)]),_:1})]),_:1})]),default:y(()=>[h("div",lt,[h("span",ut,j(s.value),1),g(T(st),{style:{width:"0.6em",height:"0.6em","margin-left":"5px"}})])]),_:1})])])}}});var ft=W(ct,[["__scopeId","data-v-d16d6306"]]);const dt={class:"app-main"},vt=F({__name:"AppMain",setup(r){const{tagsView:e}=O(),t=E(()=>e.cachedViews);return(a,o)=>{const n=B("router-view");return v(),b("section",dt,[g(n,null,{default:y(({Component:i,route:l})=>[g(xe,{name:"router-fade",mode:"out-in"},{default:y(()=>[(v(),V(De,{include:t.value},[(v(),V(Fe(i),{key:l.fullPath}))],1032,["include"]))]),_:2},1024)]),_:1})])}}});var mt=W(vt,[["__scopeId","data-v-078753dd"]]);function ye(r,e,t){t=Math.max(Math.min(Number(t),1),0);const a=parseInt(r.substring(1,3),16),o=parseInt(r.substring(3,5),16),n=parseInt(r.substring(5,7),16),i=parseInt(e.substring(1,3),16),l=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16),f=Math.round(a*(1-t)+i*t),c=Math.round(o*(1-t)+l*t),u=Math.round(n*(1-t)+s*t),d=("0"+(f||0).toString(16)).slice(-2),_=("0"+(c||0).toString(16)).slice(-2),w=("0"+(u||0).toString(16)).slice(-2);return"#"+d+_+w}const pt="#ffffff",ht="#000000",gt=F({__name:"index",setup(r){const e=document.documentElement,{setting:t}=O(),a=E(()=>t.theme);return G(a,o=>{e.style.setProperty("--el-color-primary",o),be.set("theme",o);for(let n=1;n<10;n+=1)e.style.setProperty(`--el-color-primary-light-${n}`,ye(o,pt,n*.1));e.style.setProperty("--el-color-primary-dark",ye(o,ht,.1)),be.set("style",e.style.cssText)}),(o,n)=>{const i=B("el-color-picker");return v(),V(i,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=l=>a.value=l),predefine:["#409EFF","#1890ff","#304156","#212121","#11a983","#13c2c2","#6959CD","#f5222d"],class:"theme-picker","popper-class":"theme-picker-dropdown"},null,8,["modelValue"])}}});const _t={class:"drawer-container"},bt={class:"drawer-item"},wt={style:{float:"right",height:"26px",margin:"-3px 8px 0 0"}},yt={class:"drawer-item"},At={class:"drawer-item"},xt={class:"drawer-item"},Ct={class:"navbar"};F({__name:"index",setup(r){const{setting:e}=O(),t=Ce({fixedHeader:e.fixedHeader,tagsView:e.tagsView,sidebarLogo:e.sidebarLogo}),{fixedHeader:a,tagsView:o,sidebarLogo:n}=Ee(t);function i(l){e.changeSetting({key:"theme",value:l})}return G(()=>t.fixedHeader,l=>{e.changeSetting({key:"fixedHeader",value:l})}),G(()=>t.tagsView,l=>{e.changeSetting({key:"tagsView",value:l})}),G(()=>t.sidebarLogo,l=>{e.changeSetting({key:"sidebarLogo",value:l})}),(l,s)=>{const f=B("el-switch"),c=B("el-divider"),u=B("el-tooltip");return v(),b("div",_t,[s[11]||(s[11]=h("h3",{class:"drawer-title"},"\u7CFB\u7EDF\u5E03\u5C40\u914D\u7F6E",-1)),h("div",bt,[s[3]||(s[3]=h("span",null,"\u4E3B\u9898\u989C\u8272",-1)),h("div",wt,[g(gt,{onChange:i})])]),h("div",yt,[s[4]||(s[4]=h("span",null,"\u5F00\u542F Tags-View",-1)),g(f,{modelValue:T(o),"onUpdate:modelValue":s[0]||(s[0]=d=>le(o)?o.value=d:null),class:"drawer-switch"},null,8,["modelValue"])]),h("div",At,[s[5]||(s[5]=h("span",null,"\u56FA\u5B9A Header",-1)),g(f,{modelValue:T(a),"onUpdate:modelValue":s[1]||(s[1]=d=>le(a)?a.value=d:null),class:"drawer-switch"},null,8,["modelValue"])]),h("div",xt,[s[6]||(s[6]=h("span",null,"\u4FA7\u8FB9\u680F Logo",-1)),g(f,{modelValue:T(n),"onUpdate:modelValue":s[2]||(s[2]=d=>le(n)?n.value=d:null),class:"drawer-switch"},null,8,["modelValue"])]),g(c,null,{default:y(()=>[...s[7]||(s[7]=[N("\u5BFC\u822A\u680F\u6A21\u5F0F",-1)])]),_:1}),h("ul",Ct,[g(u,{content:"\u5DE6\u4FA7\u6A21\u5F0F",placement:"bottom"},{default:y(()=>[...s[8]||(s[8]=[h("li",{class:"navbar__item navbar__item--left"},[h("div"),h("div")],-1)])]),_:1}),g(u,{content:"\u9876\u90E8\u6A21\u5F0F",placement:"bottom"},{default:y(()=>[...s[9]||(s[9]=[h("li",{class:"navbar__item navbar__item--top"},[h("div"),h("div")],-1)])]),_:1}),g(u,{content:"\u6DF7\u5408\u6A21\u5F0F",placement:"bottom"},{default:y(()=>[...s[10]||(s[10]=[h("li",{class:"navbar__item navbar__item--mix"},[h("div"),h("div")],-1)])]),_:1})])])}}});function R(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function Ae(r,e){for(var t="",a=0,o=-1,n=0,i,l=0;l<=r.length;++l){if(l<r.length)i=r.charCodeAt(l);else{if(i===47)break;i=47}if(i===47){if(!(o===l-1||n===1))if(o!==l-1&&n===2){if(t.length<2||a!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){var s=t.lastIndexOf("/");if(s!==t.length-1){s===-1?(t="",a=0):(t=t.slice(0,s),a=t.length-1-t.lastIndexOf("/")),o=l,n=0;continue}}else if(t.length===2||t.length===1){t="",a=0,o=l,n=0;continue}}e&&(t.length>0?t+="/..":t="..",a=2)}else t.length>0?t+="/"+r.slice(o+1,l):t=r.slice(o+1,l),a=l-o-1;o=l,n=0}else i===46&&n!==-1?++n:n=-1}return t}function Et(r,e){var t=e.dir||e.root,a=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+a:t+r+a:a}var Z={resolve:function(){for(var e="",t=!1,a,o=arguments.length-1;o>=-1&&!t;o--){var n;o>=0?n=arguments[o]:(a===void 0&&(a=process.cwd()),n=a),R(n),n.length!==0&&(e=n+"/"+e,t=n.charCodeAt(0)===47)}return e=Ae(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(R(e),e.length===0)return".";var t=e.charCodeAt(0)===47,a=e.charCodeAt(e.length-1)===47;return e=Ae(e,!t),e.length===0&&!t&&(e="."),e.length>0&&a&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return R(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t<arguments.length;++t){var a=arguments[t];R(a),a.length>0&&(e===void 0?e=a:e+="/"+a)}return e===void 0?".":Z.normalize(e)},relative:function(e,t){if(R(e),R(t),e===t||(e=Z.resolve(e),t=Z.resolve(t),e===t))return"";for(var a=1;a<e.length&&e.charCodeAt(a)===47;++a);for(var o=e.length,n=o-a,i=1;i<t.length&&t.charCodeAt(i)===47;++i);for(var l=t.length,s=l-i,f=n<s?n:s,c=-1,u=0;u<=f;++u){if(u===f){if(s>f){if(t.charCodeAt(i+u)===47)return t.slice(i+u+1);if(u===0)return t.slice(i+u)}else n>f&&(e.charCodeAt(a+u)===47?c=u:u===0&&(c=0));break}var d=e.charCodeAt(a+u),_=t.charCodeAt(i+u);if(d!==_)break;d===47&&(c=u)}var w="";for(u=a+c+1;u<=o;++u)(u===o||e.charCodeAt(u)===47)&&(w.length===0?w+="..":w+="/..");return w.length>0?w+t.slice(i+c):(i+=c,t.charCodeAt(i)===47&&++i,t.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(R(e),e.length===0)return".";for(var t=e.charCodeAt(0),a=t===47,o=-1,n=!0,i=e.length-1;i>=1;--i)if(t=e.charCodeAt(i),t===47){if(!n){o=i;break}}else n=!1;return o===-1?a?"/":".":a&&o===1?"//":e.slice(0,o)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');R(e);var a=0,o=-1,n=!0,i;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var l=t.length-1,s=-1;for(i=e.length-1;i>=0;--i){var f=e.charCodeAt(i);if(f===47){if(!n){a=i+1;break}}else s===-1&&(n=!1,s=i+1),l>=0&&(f===t.charCodeAt(l)?--l===-1&&(o=i):(l=-1,o=s))}return a===o?o=s:o===-1&&(o=e.length),e.slice(a,o)}else{for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!n){a=i+1;break}}else o===-1&&(n=!1,o=i+1);return o===-1?"":e.slice(a,o)}},extname:function(e){R(e);for(var t=-1,a=0,o=-1,n=!0,i=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!n){a=l+1;break}continue}o===-1&&(n=!1,o=l+1),s===46?t===-1?t=l:i!==1&&(i=1):t!==-1&&(i=-1)}return t===-1||o===-1||i===0||i===1&&t===o-1&&t===a+1?"":e.slice(t,o)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Et("/",e)},parse:function(e){R(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var a=e.charCodeAt(0),o=a===47,n;o?(t.root="/",n=1):n=0;for(var i=-1,l=0,s=-1,f=!0,c=e.length-1,u=0;c>=n;--c){if(a=e.charCodeAt(c),a===47){if(!f){l=c+1;break}continue}s===-1&&(f=!1,s=c+1),a===46?i===-1?i=c:u!==1&&(u=1):i!==-1&&(u=-1)}return i===-1||s===-1||u===0||u===1&&i===s-1&&i===l+1?s!==-1&&(l===0&&o?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(l,s)):(l===0&&o?(t.name=e.slice(1,i),t.base=e.slice(1,s)):(t.name=e.slice(l,i),t.base=e.slice(l,s)),t.ext=e.slice(i,s)),l>0?t.dir=e.slice(0,l-1):o&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Z.posix=Z;var Be=Z;const kt=F({__name:"ScrollPane",emits:["scroll"],setup(r,{expose:e,emit:t}){const a=U(4),{proxy:o}=Te(),n=t,i=()=>{n("scroll")},{tagsView:l}=O(),s=E(()=>l.visitedViews),f=E(()=>o==null?void 0:o.$refs.scrollContainer.$refs.wrap$);ke(()=>{}),Pe(()=>{var d;(d=f.value)==null||d.removeEventListener("scroll",i)});function c(d){const _=f.value;if(!_)return;const w=d.wheelDelta||-d.deltaY*40;_.scrollLeft=_.scrollLeft+w/4}function u(d){var Q;const _=f.value;if(!_)return;const w=(Q=o.$refs.scrollContainer)==null?void 0:Q.$el;if(!w)return;const $=w.offsetWidth;let L=null,H=null;if(s.value.length>0&&(L=s.value[0],H=s.value[s.value.length-1]),L===d)_.scrollLeft=0;else if(H===d)_.scrollLeft=_.scrollWidth-$;else{const k=document.getElementsByClassName("tags-view__item"),J=s.value.findIndex(x=>x===d);let X=null,q=null;for(const x in k)x!=="length"&&Object.hasOwnProperty.call(k,x)&&(k[x].dataset.path===s.value[J-1].path&&(X=k[x]),k[x].dataset.path===s.value[J+1].path&&(q=k[x]));const M=q.offsetLeft+q.offsetWidth+a.value,K=X.offsetLeft-a.value;M>_.scrollLeft+$?_.scrollLeft=M-$:K<_.scrollLeft&&(_.scrollLeft=K)}}return e({moveToTarget:u}),(d,_)=>{const w=B("el-scrollbar");return v(),V(w,{ref:"scrollContainer",vertical:!1,class:"scroll-container",onWheel:ne(c,["prevent"])},{default:y(()=>[fe(d.$slots,"default",{},void 0,!0)]),_:3},512)}}});var Tt=W(kt,[["__scopeId","data-v-be6b7bae"]]);const Bt={class:"tags-view__container"},St=["onClick"],Vt=F({__name:"index",setup(r){const{tagsView:e,permission:t}=O(),{proxy:a}=Te(),o=ve(),n=ae(),i=E(()=>e.visitedViews),l=E(()=>t.routes),s=U([]),f=U(!1),c=U({}),u=U(),d=U(0),_=U(0);G(n,()=>{L(),H()},{immediate:!0}),G(f,p=>{p?document.body.addEventListener("click",oe):document.body.removeEventListener("click",oe)});function w(p,m="/"){let D=[];return p.forEach(A=>{if(A.meta&&A.meta.affix){const I=Be.resolve(m,A.path);D.push({fullPath:I,path:I,name:A.name,meta:{...A.meta}})}if(A.children){const I=w(A.children,A.path);I.length>=1&&(D=D.concat(I))}}),D}function $(){const p=w(l.value);s.value=p;for(const m of p)m.name&&e.addVisitedView(m)}function L(){n.name&&e.addView(n)}function H(){we(()=>{var p;for(const m of i.value)m.path===n.path&&((p=u.value)==null||p.moveToTarget(m),m.fullPath!==n.fullPath&&e.updateVisitedView(n))})}function Q(p){return p.path===n.path}function k(p){return p.meta&&p.meta.affix}function J(){try{return c.value.fullPath===i.value[1].fullPath||c.value.fullPath==="/index"}catch{return!1}}function X(){try{return c.value.fullPath===i.value[i.value.length-1].fullPath}catch{return!1}}function q(p){e.delCachedView(p);const{fullPath:m}=p;we(()=>{o.replace({path:"/redirect"+m}).catch(D=>{console.warn(D)})})}function M(p,m){const D=p.slice(-1)[0];D&&D.fullPath?o.push(D.fullPath):m.name==="Dashboard"?o.replace({path:"/redirect"+m.fullPath}):o.push("/")}function K(p){e.delView(p).then(m=>{Q(p)&&M(m.visitedViews,p)})}function x(){e.delLeftViews(c.value).then(p=>{p.visitedViews.find(m=>m.fullPath===n.fullPath)||M(p.visitedViews)})}function S(){e.delRightViews(c.value).then(p=>{p.visitedViews.find(m=>m.fullPath===n.fullPath)||M(p.visitedViews)})}function P(){o.push(c.value),e.delOtherViews(c.value).then(()=>{H()})}function te(p){e.delAllViews().then(m=>{M(m.visitedViews,p)})}function ie(p,m){const A=a==null?void 0:a.$el.getBoundingClientRect().left,pe=(a==null?void 0:a.$el.offsetWidth)-105,he=m.clientX-A+15;he>pe?d.value=pe:d.value=he,_.value=m.clientY,f.value=!0,c.value=p}function oe(){f.value=!1}function Se(){oe()}return ke(()=>{$()}),(p,m)=>{const D=B("router-link");return v(),b("div",Bt,[g(Tt,{ref_key:"scrollPaneRef",ref:u,class:"tags-view__wrapper",onScroll:Se},{default:y(()=>[(v(!0),b(ee,null,se(i.value,A=>(v(),V(D,{key:A.path,"data-path":A.path,class:Y([Q(A)?"active":"","tags-view__item"]),to:{path:A.path,query:A.query},onMouseup:ne(I=>k(A)?"":K(A),["middle"]),onContextmenu:ne(I=>ie(A,I),["prevent"])},{default:y(()=>[N(j(T(re)(A.meta.title))+" ",1),k(A)?C("v-if",!0):(v(),b("span",{key:0,class:"icon-close",onClick:ne(I=>K(A),["prevent","stop"])},[g(z,{"icon-class":"close"})],8,St))]),_:2},1032,["data-path","class","to","onMouseup","onContextmenu"]))),128))]),_:1},512),Me(h("ul",{style:Ie({left:d.value+"px",top:_.value+"px"}),class:"tags-view__menu"},[h("li",{onClick:m[0]||(m[0]=A=>q(c.value))},[g(z,{"icon-class":"refresh"}),m[3]||(m[3]=N(" \u5237\u65B0 ",-1))]),k(c.value)?C("v-if",!0):(v(),b("li",{key:0,onClick:m[1]||(m[1]=A=>K(c.value))},[g(z,{"icon-class":"close"}),m[4]||(m[4]=N(" \u5173\u95ED ",-1))])),h("li",{onClick:P},[g(z,{"icon-class":"close_other"}),m[5]||(m[5]=N(" \u5173\u95ED\u5176\u5B83 ",-1))]),J()?C("v-if",!0):(v(),b("li",{key:1,onClick:x},[g(z,{"icon-class":"close_left"}),m[6]||(m[6]=N(" \u5173\u95ED\u5DE6\u4FA7 ",-1))])),X()?C("v-if",!0):(v(),b("li",{key:2,onClick:S},[g(z,{"icon-class":"close_right"}),m[7]||(m[7]=N(" \u5173\u95ED\u53F3\u4FA7 ",-1))])),h("li",{onClick:m[2]||(m[2]=A=>te(c.value))},[g(z,{"icon-class":"close_all"}),m[8]||(m[8]=N(" \u5173\u95ED\u6240\u6709 ",-1))])],4),[[He,f.value]])])}}});var Lt=W(Vt,[["__scopeId","data-v-fac8ca64"]]);function de(r){return/^(https?:|http?:|mailto:|tel:)/.test(r)}const{app:me}=O(),$t=E(()=>me.sidebar),Ft=E(()=>me.device),Dt=F({props:{to:{type:String,required:!0}},setup(r){const e=ve();return{push:()=>{Ft.value==="mobile"&&$t.value.opened==!0&&me.closeSideBar(!1),e.push(r.to).catch(a=>{console.log(a)})},isExternal:de}}}),Pt=["href"];function Mt(r,e,t,a,o,n){return r.isExternal(r.to)?(v(),b("a",{key:0,href:r.to,target:"_blank",rel:"noopener"},[fe(r.$slots,"default")],8,Pt)):(v(),b("div",{key:1,onClick:e[0]||(e[0]=(...i)=>r.push&&r.push(...i))},[fe(r.$slots,"default")]))}var Ht=W(Dt,[["render",Mt]]);const It={key:0},Rt={key:1},Nt=F({__name:"SidebarItem",props:{item:{type:Object,required:!0},isNest:{type:Boolean,required:!1},basePath:{type:String,required:!0}},setup(r){const e=r,t=U();function a(n=[],i){n||(n=[]);const l=n.filter(s=>s.meta&&s.meta.hidden?!1:(t.value=s,!0));return l.length===1?!0:l.length===0?(t.value={...i,path:"",noShowingChildren:!0},!0):!1}function o(n){return de(n)?n:de(e.basePath)?e.basePath:Be.resolve(e.basePath,n)}return(n,i)=>{const l=B("el-menu-item"),s=B("sidebar-item",!0),f=B("el-sub-menu");return!r.item.meta||!r.item.meta.hidden?(v(),b("div",It,[a(r.item.children,r.item)&&(!t.value.children||t.value.noShowingChildren)&&(!r.item.meta||!r.item.meta.alwaysShow)?(v(),b(ee,{key:0},[t.value.meta?(v(),V(Ht,{key:0,to:o(t.value.path)},{default:y(()=>[g(l,{index:o(t.value.path),class:Y({"submenu-title-noDropdown":!r.isNest})},{title:y(()=>[N(j(T(re)(t.value.meta.title)),1)]),default:y(()=>[t.value.meta&&t.value.meta.icon?(v(),V(z,{key:0,"icon-class":t.value.meta.icon},null,8,["icon-class"])):C("v-if",!0)]),_:1},8,["index","class"])]),_:1},8,["to"])):C("v-if",!0)],64)):(v(),V(f,{key:1,index:o(r.item.path),"popper-append-to-body":""},{title:y(()=>[r.item.meta&&r.item.meta.icon?(v(),V(z,{key:0,"icon-class":r.item.meta.icon},null,8,["icon-class"])):C("v-if",!0),r.item.meta&&r.item.meta.title?(v(),b("span",Rt,j(T(re)(r.item.meta.title)),1)):C("v-if",!0)]),default:y(()=>[(v(!0),b(ee,null,se(r.item.children,c=>(v(),V(s,{key:c.path,item:c,"is-nest":!0,"base-path":o(c.path),class:"nest-menu"},null,8,["item","base-path"]))),128))]),_:1},8,["index"]))])):C("v-if",!0)}}});const Ot=["src"],zt={key:1,class:"sidebar-title"},Ut=["src"],Wt=F({__name:"Logo",props:{collapse:{type:Boolean,required:!0}},setup(r){const t=Ce({isCollapse:r.collapse,logo:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADLUlEQVR4AbxWS08TURQ+c9siLWJbigyFBnkJKaJIjK+4wSCJGxNjTIwxMdEELbpwYWLij3ChUQFJ2Lpw41JDiFEXJLowIigooMHyqKatgEAfw4znDDI6bbnThHaa+809c+e75/vmvjoMUn5u0d3srPA8cHo9Y1gnsFa2iCT2H0N07yj3HEyRA82AKIpFTm9Jj8zYe1DgGhIbsbZhvdVixQSNiIAgwBvUeOTz+ex4rxbVADXEBGkAQLgK8M8UxnkoQueStDpIL0zJVQNLayt3QYCj1GAKUCvGkndIi63Pi9BJN+ZC6KT1xnBeLpsrrKkx2cK6aAqOa01mBwq0k4E6s3U1PQFqyQBtE63N1EABGxkwVTNVTGfAXmYHT2spF64mNwhMgFz9dAbqLzZCwyU/F/5AM1Sdqs6Vvv7Ui45EskosHvOC1Z6bpaMbgfmXsyCtSoYmLIUW8LZVGvKyIegMkHjo9Vw2/aC8rQJYgSUrLo+kM0DE+VezIEsyhVzQFJQdEVVO/YUG8Af26FB3frf6zOiSZiCxmIAfQyGjfurzyhM+YFYGsXAMEdchHomrHLq4/G6wFRdQmIY0A8SYGfgOyppCIRcFrm2w87AIwWfT8PXJhA7B59NgdVjVHeXvaoaas3UZc2U0kPgVh/C7nxk7pDZ6cS3gX3lqMzgbXNBy+4B6ptBDz/5ScHiLKNQhowFizAwEAb+IKOTCLjqAkm+QaEqqz9RC0/W9UOD8b9jx7Krs8G3QtHpTAytzyxAZDmtEXuA7WaWejkW+7bDvVuv6FkXB1D4lOAq27TZd86YGiPXt6RRERyOwOLHAhbQsQe25eth1ugaSv5ObcumgS11bXANxXN1jvaMwem/YEJOPv8DH+x+4vM/9n9IOOq4BGoV8g+EKTuZbhJNfYrjSpziEfD+apBEYzLcKJ/8LxtbkbiQYH/5IynVRFOhn0VB0BE+cvlwnN86n9C3Oh98yIhbKtpu4FoYoNgUKDBVbHDdISzUQCoWWi632dhNGAqda6S1UrB3BYHBVM0ABNSzMRa7gvBzC+x7EOML48whJvPJ3m49j/ZDJcgtqBOiFN/r8AQAA//9Dvcu9AAAABklEQVQDAHP5SvjMDfHiAAAAAElFTkSuQmCC",self.location).href}),{logo:a}=Ee(t);return(o,n)=>{const i=B("router-link");return v(),b("div",{class:Y(["sidebar-logo-container",{collapse:r.collapse}])},[g(xe,{name:"sidebarLogoFade"},{default:y(()=>[r.collapse?(v(),V(i,{key:"collapse",class:"sidebar-logo-link",to:"/"},{default:y(()=>[T(a)?(v(),b("img",{key:0,src:T(a),class:"sidebar-logo"},null,8,Ot)):(v(),b("h1",zt,"\u76AE\u80A4\u68C0\u6D4B\u4EEA\u7BA1\u7406\u5E73\u53F0"))]),_:1})):(v(),V(i,{key:"expand",class:"sidebar-logo-link",to:"/"},{default:y(()=>[T(a)?(v(),b("img",{key:0,src:T(a),class:"sidebar-logo"},null,8,Ut)):C("v-if",!0),n[0]||(n[0]=h("h1",{class:"sidebar-title"},"\u76AE\u80A4\u68C0\u6D4B\u4EEA\u7BA1\u7406\u5E73\u53F0",-1))]),_:1}))]),_:1})],2)}}});var Qt=W(Wt,[["__scopeId","data-v-6494804b"]]);const qt="#606266",Kt="#409eff",Yt="#409eff",Jt="#ebf1f6",Gt="#dce8f2",jt="#e4edf5",Xt="#d5e3ef",Zt="210px",en="#ebf1f6";var ce={menuText:qt,menuActiveText:Kt,subMenuActiveText:Yt,menuBg:Jt,menuHover:Gt,subMenuBg:jt,subMenuHover:Xt,sideBarWidth:Zt,headerBarBg:en};const tn=F({__name:"index",setup(r){const{permission:e,setting:t,app:a}=O(),o=ae(),n=E(()=>i(e.routes));function i(c){if(!c)return[];for(var u=[],d=0;d<c.length;d++)c[d].children==null||c[d].children.length<1?c[d].type==Re.authTypeUrl&&(c[d]={path:c[d].path,children:[{path:c[d].path.slice(1),meta:{title:c[d].meta.title,icon:c[d].meta.icon}}]}):c[d].children=i(c[d].children),u.push(c[d]);return u}const l=E(()=>t.sidebarLogo),s=E(()=>!a.sidebar.opened),f=E(()=>{const{meta:c,path:u}=o;return c.activeMenu?c.activeMenu:u});return(c,u)=>{const d=B("el-menu"),_=B("el-scrollbar");return v(),b("div",{class:Y({"has-logo":l.value})},[l.value?(v(),V(Qt,{key:0,collapse:s.value},null,8,["collapse"])):C("v-if",!0),g(_,null,{default:y(()=>[g(d,{"default-active":f.value,collapse:s.value,"background-color":T(ce).menuBg,"text-color":T(ce).menuText,"active-text-color":T(ce).menuActiveText,"unique-opened":!1,"collapse-transition":!1,mode:"vertical"},{default:y(()=>[(v(!0),b(ee,null,se(n.value,w=>(v(),V(Nt,{item:w,key:w.path,"base-path":w.path,"is-collapse":s.value},null,8,["item","base-path","is-collapse"]))),128))]),_:1},8,["default-active","collapse","background-color","text-color","active-text-color"])]),_:1})],2)}}});const nn=992,rn=F({__name:"index",setup(r){const{width:e}=Ne(),{app:t,setting:a}=O(),o=E(()=>t.sidebar),n=E(()=>t.device),i=E(()=>a.tagsView),l=E(()=>a.fixedHeader),s=E(()=>({hideSidebar:!o.value.opened,openSidebar:o.value.opened,withoutAnimation:o.value.withoutAnimation,mobile:n.value==="mobile"}));Oe(()=>{e.value<nn?(t.toggleDevice("mobile"),t.closeSideBar(!0)):t.toggleDevice("desktop")});function f(){t.closeSideBar(!1)}return(c,u)=>(v(),b("div",{class:Y([s.value,"app-wrapper"])},[n.value==="mobile"&&o.value.opened?(v(),b("div",{key:0,class:"drawer-bg",onClick:f})):C("v-if",!0),g(tn,{class:"sidebar-container"}),h("div",{class:Y([{hasTagsView:i.value},"main-container"])},[h("div",{class:Y({"fixed-header":l.value})},[g(T(ft)),i.value?(v(),V(T(Lt),{key:0})):C("v-if",!0)],2),C("\u4E3B\u9875\u9762"),g(T(mt)),C(" \u8BBE\u7F6E\u9762\u677F "),C(` <RightPanel v-if="showSettings">\r
|
|
<settings />\r
|
|
</RightPanel> `)],2)],2))}});var ln=W(rn,[["__scopeId","data-v-13877386"]]);export{ln as default};
|