index-c4963466.js 9.0 KB

1
  1. import{d as C,c as t,u as T,r as B,p as re,a as he,_ as y,b as P,e as xe,A as le,i as ye,f as Ce,w as Y,o as be,g as Se,h as Z,P as f,t as K,j as Oe,k as oe,l as k,m as we,n as I}from"./index-10bc4fd3.js";import{S as ie,a as Ae,R as q,L as ee,b as Be,D as Pe,M as O,A as ke}from"./index-6f2dd177.js";import"./useFlexGapSupport-7e6d6fda.js";var Ne=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};const Fe=Ne;var _=function(){return{prefixCls:String,hasSider:{type:Boolean,default:void 0},tagName:String}};function N(n){var e=n.suffixCls,a=n.tagName,r=n.name;return function(l){var v=C({compatConfig:{MODE:3},name:r,props:_(),setup:function(b,m){var o=m.slots,s=T(e,b),d=s.prefixCls;return function(){var F=P(P({},b),{},{prefixCls:d.value,tagName:a});return t(l,F,o)}}});return v}}var R=C({compatConfig:{MODE:3},props:_(),setup:function(e,a){var r=a.slots;return function(){return t(e.tagName,{class:e.prefixCls},r)}}}),je=C({compatConfig:{MODE:3},props:_(),setup:function(e,a){var r=a.slots,l=T("",e),v=l.direction,g=B([]),b={addSider:function(s){g.value=[].concat(xe(g.value),[s])},removeSider:function(s){g.value=g.value.filter(function(d){return d!==s})}};re(ie,b);var m=he(function(){var o,s=e.prefixCls,d=e.hasSider;return o={},y(o,"".concat(s),!0),y(o,"".concat(s,"-has-sider"),typeof d=="boolean"?d:g.value.length>0),y(o,"".concat(s,"-rtl"),v.value==="rtl"),o});return function(){var o=e.tagName;return t(o,{class:m.value},r)}}}),Le=N({suffixCls:"layout",tagName:"section",name:"ALayout"})(je),z=N({suffixCls:"layout-header",tagName:"header",name:"ALayoutHeader"})(R),$=N({suffixCls:"layout-footer",tagName:"footer",name:"ALayoutFooter"})(R),D=N({suffixCls:"layout-content",tagName:"main",name:"ALayoutContent"})(R);const E=Le;var Me={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"};const ze=Me;function te(n){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable}))),r.forEach(function(l){$e(n,l,a[l])})}return n}function $e(n,e,a){return e in n?Object.defineProperty(n,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[e]=a,n}var U=function(e,a){var r=te({},e,a.attrs);return t(le,te({},r,{icon:ze}),null)};U.displayName="BarsOutlined";U.inheritAttrs=!1;const De=U;var ne={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px",xxxl:"1999.98px"},Ee=function(){return{prefixCls:String,collapsible:{type:Boolean,default:void 0},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean,default:void 0},reverseArrow:{type:Boolean,default:void 0},zeroWidthTriggerStyle:{type:Object,default:void 0},trigger:f.any,width:f.oneOfType([f.number,f.string]),collapsedWidth:f.oneOfType([f.number,f.string]),breakpoint:f.oneOf(K("xs","sm","md","lg","xl","xxl","xxxl")),theme:f.oneOf(K("light","dark")).def("dark"),onBreakpoint:Function,onCollapse:Function}},He=function(){var n=0;return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n+=1,"".concat(e).concat(n)}}();const H=C({compatConfig:{MODE:3},name:"ALayoutSider",inheritAttrs:!1,props:ye(Ee(),{collapsible:!1,defaultCollapsed:!1,reverseArrow:!1,width:200,collapsedWidth:80}),emits:["breakpoint","update:collapsed","collapse"],setup:function(e,a){var r=a.emit,l=a.attrs,v=a.slots,g=T("layout-sider",e),b=g.prefixCls,m=Ce(ie,void 0),o=B(!!(e.collapsed!==void 0?e.collapsed:e.defaultCollapsed)),s=B(!1);Y(function(){return e.collapsed},function(){o.value=!!e.collapsed}),re(Ae,o);var d=function(u,h){e.collapsed===void 0&&(o.value=u),r("update:collapsed",u),r("collapse",u,h)},F=B(function(i){s.value=i.matches,r("breakpoint",i.matches),o.value!==i.matches&&d(i.matches,"responsive")}),p;function x(i){return F.value(i)}var G=He("ant-sider-");m&&m.addSider(G),be(function(){Y(function(){return e.breakpoint},function(){try{var i;(i=p)===null||i===void 0||i.removeEventListener("change",x)}catch{var u;(u=p)===null||u===void 0||u.removeListener(x)}if(typeof window<"u"){var h=window,c=h.matchMedia;if(c&&e.breakpoint&&e.breakpoint in ne){p=c("(max-width: ".concat(ne[e.breakpoint],")"));try{p.addEventListener("change",x)}catch{p.addListener(x)}x(p)}}},{immediate:!0})}),Se(function(){try{var i;(i=p)===null||i===void 0||i.removeEventListener("change",x)}catch{var u;(u=p)===null||u===void 0||u.removeListener(x)}m&&m.removeSider(G)});var J=function(){d(!o.value,"clickTrigger")};return function(){var i,u,h,c=b.value,w=e.collapsedWidth,ue=e.width,j=e.reverseArrow,se=e.zeroWidthTriggerStyle,Q=e.trigger,A=Q===void 0?(i=v.trigger)===null||i===void 0?void 0:i.call(v):Q,X=e.collapsible,ce=e.theme,L=o.value?w:ue,S=Fe(L)?"".concat(L,"px"):String(L),M=parseFloat(String(w||0))===0?t("span",{onClick:J,class:Z("".concat(c,"-zero-width-trigger"),"".concat(c,"-zero-width-trigger-").concat(j?"right":"left")),style:se},[A||t(De,null,null)]):null,de={expanded:j?t(q,null,null):t(ee,null,null),collapsed:j?t(ee,null,null):t(q,null,null)},fe=o.value?"collapsed":"expanded",ve=de[fe],ge=A!==null?M||t("div",{class:"".concat(c,"-trigger"),onClick:J,style:{width:S}},[A||ve]):null,me=[l.style,{flex:"0 0 ".concat(S),maxWidth:S,minWidth:S,width:S}],pe=Z(c,"".concat(c,"-").concat(ce),(u={},y(u,"".concat(c,"-collapsed"),!!o.value),y(u,"".concat(c,"-has-trigger"),X&&A!==null&&!M),y(u,"".concat(c,"-below"),!!s.value),y(u,"".concat(c,"-zero-width"),parseFloat(S)===0),u),l.class);return t("aside",P(P({},l),{},{class:pe,style:me}),[t("div",{class:"".concat(c,"-children")},[(h=v.default)===null||h===void 0?void 0:h.call(v)]),X||s.value&&M?ge:null])}}}),W=Oe(E,{Header:z,Footer:$,Content:D,Sider:H,install:function(e){return e.component(E.name,E),e.component(z.name,z),e.component($.name,$),e.component(H.name,H),e.component(D.name,D),e}});var Ie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"};const We=Ie;function ae(n){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable}))),r.forEach(function(l){Te(n,l,a[l])})}return n}function Te(n,e,a){return e in n?Object.defineProperty(n,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[e]=a,n}var V=function(e,a){var r=ae({},e,a.attrs);return t(le,ae({},r,{icon:We}),null)};V.displayName="UserOutlined";V.inheritAttrs=!1;const _e=V,Re=C(()=>{const n=oe(),e=a=>{switch(a.key){case"logout":n.logout();break}};return()=>t("div",{class:"h-1/1 flex justify-between items-center text-light-50"},[t("div",{class:"text-20px flex-1"},[k("米系列直升机尾传动轴机上维护测量虚拟训练系统管理后台")]),t(Be,{size:20},{default:()=>[t(Pe,{overlay:t(O,{onClick:e},{default:()=>[t(O.Item,{key:"logout"},{default:()=>[k("退出登录")]})]})},{default:()=>{var a;return[t("div",{class:"flex items-center"},[t(ke,{icon:t(_e,null,null)},null),t("span",{class:"ml-10px leading-normal"},[(a=n.userInfo)==null?void 0:a.name])])]}})]})])});const Ue=C({setup(){const n=we(),e=oe();return()=>{var r,l;const a=((l=(r=e.userInfo)==null?void 0:r.roles)==null?void 0:l.includes("admin"))||!1;return t("div",{class:Ve},[t(O,{mode:"inline",inlineIndent:12,selectedKeys:[n.currentRoute.value.path]},{default:()=>[t(O.Item,{key:"/exam"},{default:()=>[t(I("router-link"),{to:"/exam"},{default:()=>[k("试题管理")]})]}),a&&t(O.Item,{key:"/user"},{default:()=>[t(I("router-link"),{to:"/user"},{default:()=>[k("用户管理")]})]})]})])}}}),Ve="mlgg4eb";const{Header:Ge,Content:Je,Sider:Qe}=W,et=C(()=>()=>t(W,{class:Xe},{default:()=>[t(Ge,null,{default:()=>[t(Re,null,null)]}),t(W,null,{default:()=>[t(Qe,{class:Ye},{default:()=>[t(Ue,null,null)]}),t(Je,{class:"page_content"},{default:()=>[t(I("router-view"),null,null)]})]})]})),Xe="pq3nqh9",Ye="sr2c0hp";export{et as default};