16 lines
15 KiB
JavaScript
16 lines
15 KiB
JavaScript
import{d as $,e as p,D as g,Y as _,I as y,aG as w,J as a,E as B,G as x,am as A,aH as L,H as b,b as st,O as dt,aI as lt,V as R,L as ut,aJ as ft,aK as ct,F as pt}from"./auth-a032821f.js";import{s as ht}from"./settings-df746de8.js";import{_ as mt,a as gt,b as yt,u as xt,c as bt,d as _t,e as $t,f as vt}from"./index.vue_vue_type_script_setup_true_lang-bae95f65.js";import{_ as F}from"./_plugin-vue_export-helper-c27b6911.js";import"./Button-c0861bca.js";import"./DarkModeSwitch.vue_vue_type_script_setup_true_lang-a1be07f6.js";import"./Card-741f1b28.js";import"./system-33051b52.js";import"./base-cfbb6113.js";var wt=Object.defineProperty,St=Object.defineProperties,Lt=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,G=(n,e,t)=>e in n?wt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,C=(n,e)=>{for(var t in e||(e={}))Ct.call(e,t)&&G(n,t,e[t]);if(q)for(var t of q(e))Tt.call(e,t)&&G(n,t,e[t]);return n},T=(n,e)=>St(n,Lt(e));function Et(n){let e=0;for(let t=0;t<n.length;++t)n[t]==="&"&&++e;return e}const J=/\s*,(?![^(]*\))\s*/g,Wt=/\s+/g;function At(n,e){const t=[];return e.split(J).forEach(i=>{let o=Et(i);if(o){if(o===1){n.forEach(r=>{t.push(i.replace("&",r))});return}}else{n.forEach(r=>{t.push((r&&r+" ")+i)});return}let s=[i];for(;o--;){const r=[];s.forEach(l=>{n.forEach(u=>{r.push(l.replace("&",u))})}),s=r}s.forEach(r=>t.push(r))}),t}function Bt(n,e){const t=[];return e.split(J).forEach(i=>{n.forEach(o=>{t.push((o&&o+" ")+i)})}),t}function Ht(n){let e=[""];return n.forEach(t=>{t=t&&t.trim(),t&&(t.includes("&")?e=At(e,t):e=Bt(e,t))}),e.join(", ").replace(Wt," ")}function Z(n){if(!n)return;const e=n.parentElement;e&&e.removeChild(n)}function I(n){return document.querySelector(`style[cssr-id="${n}"]`)}function Pt(n){const e=document.createElement("style");return e.setAttribute("cssr-id",n),e}function P(n){return n?/^\s*@(s|m)/.test(n):!1}const kt=/[A-Z]/g;function K(n){return n.replace(kt,e=>"-"+e.toLowerCase())}function zt(n,e=" "){return typeof n=="object"&&n!==null?` {
|
|
`+Object.entries(n).map(t=>e+` ${K(t[0])}: ${t[1]};`).join(`
|
|
`)+`
|
|
`+e+"}":`: ${n};`}function Ft(n,e,t){return typeof n=="function"?n({context:e.context,props:t}):n}function U(n,e,t,i){if(!e)return"";const o=Ft(e,t,i);if(!o)return"";if(typeof o=="string")return`${n} {
|
|
${o}
|
|
}`;const s=Object.keys(o);if(s.length===0)return t.config.keepEmptyBlock?n+` {
|
|
}`:"";const r=n?[n+" {"]:[];return s.forEach(l=>{const u=o[l];if(l==="raw"){r.push(`
|
|
`+u+`
|
|
`);return}l=K(l),u!=null&&r.push(` ${l}${zt(u)}`)}),n&&r.push("}"),r.join(`
|
|
`)}function z(n,e,t){n&&n.forEach(i=>{if(Array.isArray(i))z(i,e,t);else if(typeof i=="function"){const o=i(e);Array.isArray(o)?z(o,e,t):o&&t(o)}else i&&t(i)})}function X(n,e,t,i,o,s){const r=n.$;let l="";if(!r||typeof r=="string")P(r)?l=r:e.push(r);else if(typeof r=="function"){const d=r({context:i.context,props:o});P(d)?l=d:e.push(d)}else if(r.before&&r.before(i.context),!r.$||typeof r.$=="string")P(r.$)?l=r.$:e.push(r.$);else if(r.$){const d=r.$({context:i.context,props:o});P(d)?l=d:e.push(d)}const u=Ht(e),f=U(u,n.props,i,o);l?(t.push(`${l} {`),s&&f&&s.insertRule(`${l} {
|
|
${f}
|
|
}
|
|
`)):(s&&f&&s.insertRule(f),!s&&f.length&&t.push(f)),n.children&&z(n.children,{context:i.context,props:o},d=>{if(typeof d=="string"){const c=U(u,{raw:d},i,o);s?s.insertRule(c):t.push(c)}else X(d,e,t,i,o,s)}),e.pop(),l&&t.push("}"),r&&r.after&&r.after(i.context)}function Y(n,e,t,i=!1){const o=[];return X(n,[],o,e,t,i?n.instance.__styleSheet:void 0),i?"":o.join(`
|
|
|
|
`)}function It(n){for(var e=0,t,i=0,o=n.length;o>=4;++i,o-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Mt(n,e,t){const{els:i}=e;if(t===void 0)i.forEach(Z),e.els=[];else{const o=I(t);o&&i.includes(o)&&(Z(o),e.els=i.filter(s=>s!==o))}}function N(n,e){n.push(e)}function Vt(n,e,t,i,o,s,r,l,u){if(s&&!u){if(t===void 0){console.error("[css-render/mount]: `id` is required in `silent` mode.");return}const m=window.__cssrContext;m[t]||(m[t]=!0,Y(e,n,i,s));return}let f;if(t===void 0&&(f=e.render(i),t=It(f)),u){u.adapter(t,f??e.render(i));return}const d=I(t);if(d!==null&&!r)return d;const c=d??Pt(t);if(f===void 0&&(f=e.render(i)),c.textContent=f,d!==null)return d;if(l){const m=document.head.querySelector(`meta[name="${l}"]`);if(m)return document.head.insertBefore(c,m),N(e.els,c),c}return o?document.head.insertBefore(c,document.head.querySelector("style, link")):document.head.appendChild(c),N(e.els,c),c}function Ot(n){return Y(this,this.instance,n)}function Dt(n={}){const{id:e,ssr:t,props:i,head:o=!1,silent:s=!1,force:r=!1,anchorMetaName:l}=n;return Vt(this.instance,this,e,i,o,s,r,l,t)}function jt(n={}){const{id:e}=n;Mt(this.instance,this,e)}const k=function(n,e,t,i){return{instance:n,$:e,props:t,children:i,els:[],render:Ot,mount:Dt,unmount:jt}},Rt=function(n,e,t,i){return Array.isArray(e)?k(n,{$:null},null,e):Array.isArray(t)?k(n,e,null,t):Array.isArray(i)?k(n,e,t,i):k(n,e,t,null)};function E(n={}){let e=null;const t={c:(...i)=>Rt(t,...i),use:(i,...o)=>i.install(t,...o),find:I,context:{},config:n,get __styleSheet(){if(!e){const i=document.createElement("style");return document.head.appendChild(i),e=document.styleSheets[document.styleSheets.length-1],e}return e}};return t}const qt={name:"LayoutHeader"},Gt=$(T(C({},qt),{props:{fixed:{type:Boolean,default:!0},zIndex:{default:1001},useMinWidthLayout:{type:Boolean},minWidth:{default:1200},height:{default:56},paddingLeft:{default:0},transitionDuration:{default:300},transitionTimingFunction:{default:"ease-in-out"}},setup(n){const e=n,t=p(()=>{const{fixed:s,zIndex:r,minWidth:l,height:u,paddingLeft:f,transitionDuration:d,transitionTimingFunction:c}=e,m=s?"fixed":"static",v=e.useMinWidthLayout?`min-width:${l}px;`:"";return`position:${m};z-index:${r};${v}height:${u}px;padding-left:${f}px;transition-duration:${d}ms;transition-timing-function:${c};`}),{c:i}=E(),o=i(".admin-layout__header",{left:0,top:0,flexShrink:0,boxSizing:"border-box",width:"100%",transitionProperty:"padding-left"});return o.render(),o.mount(),(s,r)=>(g(),_("header",{class:"admin-layout__header",style:w(a(t))},[y(s.$slots,"default")],4))}})),Zt={name:"LayoutTab"},Ut=$(T(C({},Zt),{props:{fixed:{type:Boolean,default:!0},top:{default:56},zIndex:{default:999},useMinWidthLayout:{type:Boolean},minWidth:{default:1200},height:{default:56},paddingLeft:{default:0},transitionDuration:{default:300},transitionTimingFunction:{default:"ease-in-out"}},setup(n){const e=n,t=p(()=>{const{fixed:s,top:r,zIndex:l,minWidth:u,height:f,paddingLeft:d,transitionDuration:c,transitionTimingFunction:m}=e,v=s?"fixed":"static",W=e.useMinWidthLayout?`min-width: ${u}px;`:"";return`position:${v};top:${r}px;z-index:${l};${W}height:${f}px;padding-left:${d}px;transition-duration:${c}ms;transition-timing-function:${m};`}),{c:i}=E(),o=i(".admin-layout__tab",{left:0,flexShrink:0,boxSizing:"border-box",width:"100%",transitionProperty:"padding-left"});return o.render(),o.mount(),(s,r)=>(g(),_("div",{class:"admin-layout__tab",style:w(a(t))},[y(s.$slots,"default")],4))}})),Nt={name:"LayoutSider"},Jt=$(T(C({},Nt),{props:{zIndex:{default:1002},width:{default:200},paddingTop:{default:0},transitionDuration:{default:300},transitionTimingFunction:{default:"ease-in-out"}},setup(n){const e=n,t=p(()=>{const{zIndex:s,width:r,paddingTop:l,transitionDuration:u,transitionTimingFunction:f}=e;return`z-index:${s};width:${r}px;padding-top:${l}px;transition-duration:${u}ms;transition-timing-function:${f};`}),{c:i}=E(),o=i(".admin-layout__sider",{position:"fixed",left:0,top:0,boxSizing:"border-box",width:"100%",height:"100%",transitionProperty:"all"});return o.render(),o.mount(),(s,r)=>(g(),_("aside",{class:"admin-layout__sider",style:w(a(t))},[y(s.$slots,"default")],4))}})),Kt={name:"LayoutContent"},Xt=$(T(C({},Kt),{props:{paddingTop:{default:0},paddingBottom:{default:0},paddingLeft:{default:0},overflowHidden:{type:Boolean},transitionDuration:{default:300},transitionTimingFunction:{default:"ease-in-out"}},setup(n){const e=n,t=p(()=>{const{paddingTop:s,paddingBottom:r,paddingLeft:l,transitionDuration:u,transitionTimingFunction:f}=e,d=`overflow:${e.overflowHidden?"hidden":"visible"};`;return`padding-top:${s}px;padding-bottom:${r}px;padding-left:${l}px;${d}transition-duration:${u}ms;transition-timing-function:${f};`}),{c:i}=E(),o=i(".admin-layout__content",{flexGrow:1,boxSizing:"border-box",width:"100%",transitionProperty:"padding-left"});return o.render(),o.mount(),(s,r)=>(g(),_("main",{style:w(a(t)),class:"admin-layout__content"},[y(s.$slots,"default")],4))}})),Yt={name:"LayoutFooter"},Qt=$(T(C({},Yt),{props:{fixed:{type:Boolean,default:!0},zIndex:{default:999},useMinWidthLayout:{type:Boolean},minWidth:{default:1200},height:{default:56},paddingLeft:{default:0},transitionDuration:{default:300},transitionTimingFunction:{default:"ease-in-out"}},setup(n){const e=n,t=p(()=>{const{fixed:s,zIndex:r,minWidth:l,height:u,paddingLeft:f,transitionDuration:d,transitionTimingFunction:c}=e,m=s?"fixed":"static",v=e.useMinWidthLayout?`min-width:${l}px;`:"";return`position:${m};z-index:${r};${v}height:${u}px;padding-left:${f}px;transition-duration:${d}ms;transition-timing-function:${c};`}),{c:i}=E(),o=i(".admin-layout__footer",{left:0,bottom:0,flexShrink:0,boxSizing:"border-box",width:"100%",transitionProperty:"padding-left"});return o.render(),o.mount(),(s,r)=>(g(),_("footer",{class:"admin-layout__footer",style:w(a(t))},[y(s.$slots,"default")],4))}}));function te(n){const e=st(0),t=p(()=>`transform: translateX(${-e.value}px);`);let i=!1;function o(d){e.value=d}function s(){var d;const c=((d=document.scrollingElement)==null?void 0:d.scrollLeft)||0;o(c)}function r(){s()}function l(){document.addEventListener("scroll",s)}function u(){i&&document.removeEventListener("scroll",s)}function f(){r(),l(),i=!0}return dt(n,d=>{d?f():u()},{immediate:!0}),lt(()=>{u()}),t}const ee={name:"AdminLayout"},M=$(T(C({},ee),{props:{mode:{default:"vertical"},isMobile:{type:Boolean,default:!1},maskBg:{default:"rgba(0,0,0,0.3)"},useMinWidthLayout:{type:Boolean,default:!1},minWidth:{default:1200},headerVisible:{type:Boolean,default:!0},headerHeight:{default:56},tabVisible:{type:Boolean,default:!0},tabHeight:{default:44},fixedHeaderAndTab:{type:Boolean,default:!0},addMainOverflowHidden:{type:Boolean,default:!1},footerVisible:{type:Boolean,default:!0},footerHeight:{default:48},fixedFooter:{type:Boolean,default:!0},siderVisible:{type:Boolean,default:!0},siderWidth:{default:200},siderCollapsedWidth:{default:64},siderCollapse:{type:Boolean,default:!1},transitionDuration:{default:300},transitionTimingFunction:{default:"ease-in-out"}},emits:["update:sider-collapse"],setup(n,{emit:e}){const t=n,i=p(()=>t.useMinWidthLayout?`min-width:${t.minWidth}px;`:""),o=p(()=>t.useMinWidthLayout&&(t.fixedHeaderAndTab||t.fixedFooter)),s=te(o),r=p(()=>t.fixedHeaderAndTab?s.value:""),l=p(()=>t.fixedFooter?s.value:""),u=p(()=>{const{transitionDuration:h,transitionTimingFunction:S}=t;return{transitionDuration:h,transitionTimingFunction:S}}),f=p(()=>t.mode==="vertical"),d=1001,c=999,m=p(()=>t.isMobile||f.value?1003:1e3),v=998,W=p({get(){return t.siderCollapse},set(h){e("update:sider-collapse",h)}});function Q(){W.value=!0}const tt=p(()=>t.isMobile&&!W.value),et=p(()=>{const{transitionDuration:h,transitionTimingFunction:S}=t;return`background-color:${t.maskBg};transition-duration:${h}ms;transition-timing-function:${S};`}),V=p(()=>{const{siderWidth:h,siderCollapsedWidth:S}=t,j=t.isMobile?0:S,at=W.value?j:h;return t.siderVisible?at:0}),H=p(()=>t.isMobile?0:V.value),nt=p(()=>f.value?H.value:0),it=p(()=>!t.isMobile&&!f.value&&t.headerVisible?t.headerHeight:0),ot=p(()=>{let h=0;return t.fixedHeaderAndTab&&(t.headerVisible&&(h+=t.headerHeight),t.tabVisible&&(h+=t.tabHeight)),h}),rt=p(()=>t.fixedFooter&&t.footerVisible?t.footerHeight:0),{c:O}=E(),D=O(".admin-layout",{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[O("&__sider-mask",{position:"fixed",left:0,top:0,zIndex:1002,width:"100%",height:"100%",transitionProperty:"background-color"})]);return D.render(),D.mount(),(h,S)=>(g(),_("div",{class:"admin-layout",style:w(a(i))},[n.headerVisible?(g(),B(a(Gt),A({key:0},a(u),{fixed:n.fixedHeaderAndTab,"z-index":d,"min-width":n.minWidth,height:n.headerHeight,"padding-left":a(nt),style:a(r)}),{default:x(()=>[y(h.$slots,"header")]),_:3},16,["fixed","min-width","height","padding-left","style"])):L("",!0),n.tabVisible?(g(),B(a(Ut),A({key:1},a(u),{fixed:n.fixedHeaderAndTab,"z-index":c,"min-width":n.minWidth,top:n.headerHeight,height:n.tabHeight,"padding-left":a(H),style:a(r)}),{default:x(()=>[y(h.$slots,"tab")]),_:3},16,["fixed","min-width","top","height","padding-left","style"])):L("",!0),n.siderVisible?(g(),B(a(Jt),A({key:2},a(u),{"z-index":a(m),width:a(V),"padding-top":a(it)}),{default:x(()=>[y(h.$slots,"sider")]),_:3},16,["z-index","width","padding-top"])):L("",!0),a(tt)?(g(),_("div",{key:3,class:"admin-layout__sider-mask",style:w(a(et)),onClick:Q},null,4)):L("",!0),b(a(Xt),A(a(u),{"padding-top":a(ot),"padding-bottom":a(rt),"padding-left":a(H),"overflow-hidden":n.addMainOverflowHidden}),{default:x(()=>[y(h.$slots,"default")]),_:3},16,["padding-top","padding-bottom","padding-left","overflow-hidden"]),n.footerVisible?(g(),B(a(Qt),A({key:4},a(u),{fixed:n.fixedFooter,"z-index":v,"min-width":n.minWidth,height:n.footerHeight,"padding-left":a(H),style:a(l)}),{default:x(()=>[y(h.$slots,"footer")]),_:3},16,["fixed","min-width","height","padding-left","style"])):L("",!0)],4))}}));function ne(n){n.component("AdminLayout",M)}M.install=ne;const ie=F(mt,[["__scopeId","data-v-68dfcdf3"]]),oe=F(gt,[["__scopeId","data-v-0fd2c89d"]]),re=F(yt,[["__scopeId","data-v-bad24bd9"]]),ae=$({name:"BasicLayout"}),ge=$({...ae,setup(n){const e=d=>ht.setStore(R()).getSettingItem(d),t=R(),i=ut(),{mode:o,isMobile:s,headerProps:r,siderVisible:l,siderWidth:u,siderCollapsedWidth:f}=xt();return(d,c)=>(g(),_(pt,null,[b(a(M),{mode:a(o),"is-mobile":a(s),"fixed-header-and-tab":a(i).fixedHeaderAndTab,"header-height":a(i).header.height,"tab-visible":a(i).tab.visible,"tab-height":a(i).tab.height,"sider-visible":a(l),"sider-width":a(u),"sider-collapsed-width":a(f),"sider-collapse":a(t).siderCollapse,"fixed-footer":a(i).footer.fixed,"footer-visible":a(i).footer.visible,"onUpdate:siderCollapse":a(t).setSiderCollapse},{header:x(()=>[b(a(ie),ft(ct(a(r))),null,16)]),tab:x(()=>[b(a(oe))]),sider:x(()=>[b(a(re))]),footer:x(()=>[b(a(bt))]),default:x(()=>[b(a(_t))]),_:1},8,["mode","is-mobile","fixed-header-and-tab","header-height","tab-visible","tab-height","sider-visible","sider-width","sider-collapsed-width","sider-collapse","fixed-footer","footer-visible","onUpdate:siderCollapse"]),b(a($t)),e("show_development_tools")?(g(),B(a(vt),{key:0})):L("",!0)],64))}});export{ge as default};
|