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