Files
filecodebox/themes/2024/assets/AdminLayout-YzQVrzCC.js
T
2025-02-17 20:51:24 +08:00

22 lines
4.9 KiB
Python

import{c as i,d as k,r as h,o as u,I as v,a as d,b as x,e as t,n as o,g as e,i as n,X as w,F as _,p as M,A as C,x as z,z as L,J as B,K as D,q as F,t as I}from"./index-EADe6V-l.js";import{B as j}from"./box-brjUM9cP.js";/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const S=i("CogIcon",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const V=i("FolderIcon",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const q=i("LayoutDashboardIcon",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const A=i("MenuIcon",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),E={class:"flex items-center"},N={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},R={class:"flex-1 overflow-y-auto"},Z={class:"p-4 space-y-2"},H=["onClick"],J={class:"flex-1 flex flex-col min-h-screen"},K={class:"flex items-center justify-between h-16 px-4"},$=k({__name:"AdminLayout",setup(O){const c=C(),a=z("isDarkMode"),p=[{id:"Dashboard",name:"仪表盘",icon:q,redirect:"/admin/dashboard"},{id:"FileManage",name:"文件管理",icon:V,redirect:"/admin/files"},{id:"Settings",name:"系统设置",icon:S,redirect:"/admin/settings"}],s=h(!0),y=()=>{s.value=!s.value},l=()=>{window.innerWidth>=1024?s.value=!0:s.value=!1};u(()=>{l(),window.addEventListener("resize",l)}),v(()=>{window.removeEventListener("resize",l)});const m=h({page:1,size:10,total:0}),b=async()=>{try{m.value.total=85}catch(g){console.error("加载文件列表失败:",g)}};return u(()=>{b()}),(g,T)=>{const f=L("router-view");return d(),x("div",{class:o(["min-h-screen flex flex-col lg:flex-row transition-colors duration-300",[e(a)?"bg-gray-900":"bg-gray-50"]])},[t("aside",{class:o(["fixed inset-y-0 left-0 z-50 w-64 transform transition-all duration-300 ease-in-out lg:relative lg:translate-x-0 border-r",[e(a)?"bg-gray-800 bg-opacity-90 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200",{"-translate-x-full":!s.value}]])},[t("div",{class:o(["flex items-center justify-between h-16 px-4 border-b",[e(a)?"border-gray-700":"border-gray-200"]])},[t("div",E,[t("div",N,[t("div",{class:o(["rounded-full p-1",[e(a)?"bg-gray-800":"bg-white"]])},[n(e(j),{class:o(["w-6 h-6",[e(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2)]),t("h1",{class:o(["ml-2 text-xl font-semibold",[e(a)?"text-white":"text-gray-800"]])}," FileCodeBox ",2)]),t("button",{onClick:y,class:"lg:hidden"},[n(e(w),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])],2),t("nav",R,[t("ul",Z,[(d(),x(_,null,M(p,r=>t("li",{key:r.id},[t("a",{onClick:U=>e(c).push(r.redirect),class:o(["flex items-center p-2 rounded-lg transition-colors duration-200",[e(c).currentRoute.value.name===r.id?e(a)?"bg-indigo-900 text-indigo-400":"bg-indigo-100 text-indigo-600":e(a)?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-100"]])},[(d(),B(D(r.icon),{class:"w-5 h-5 mr-3"})),F(" "+I(r.name),1)],10,H)])),64))])])],2),t("div",J,[t("header",{class:o(["shadow-md border-b transition-colors duration-300",[e(a)?"bg-gray-800 border-gray-700":"bg-white border-gray-200"]])},[t("div",K,[t("button",{onClick:y,class:"lg:hidden"},[n(e(A),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])])],2),t("main",{class:o(["flex-1 p-6 overflow-y-auto transition-colors duration-300",[e(a)?"bg-gray-900":"bg-gray-50"]])},[n(f)],2)])],2)}}});export{$ as default};