fix:some bug

This commit is contained in:
Lan
2024-12-20 19:46:24 +08:00
parent 5238975484
commit 63b5be31e8
47 changed files with 245 additions and 241 deletions
@@ -0,0 +1,21 @@
import{c as i,B as M,r as h,o as u,I as C,p as d,b as x,d as t,n as o,e,f as n,j as z,t as m,X as I,F as L,x as B,y as D,z as F,m as p,J as S,K as j,k as N}from"./index-Du-dk8JL.js";import{B as V}from"./box-C2fXqZ8a.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 E=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 R=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 Z=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 q=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"}]]),A={class:"flex items-center"},J={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},O={class:"flex-1 overflow-y-auto"},H={class:"p-4 space-y-2"},K=["onClick"],T={class:"flex-1 flex flex-col min-h-screen"},U={class:"flex items-center justify-between h-16 px-4"},Q=M({__name:"AdminLayout",setup(W){const b=JSON.parse(localStorage.getItem("config")||"{}"),c=D(),a=F("isDarkMode"),f=[{id:"Dashboard",name:"仪表盘",icon:Z,redirect:"/admin/dashboard"},{id:"FileManage",name:"文件管理",icon:R,redirect:"/admin/files"},{id:"Settings",name:"系统设置",icon:E,redirect:"/admin/settings"}],r=h(!0),g=()=>{r.value=!r.value},l=()=>{window.innerWidth>=1024?r.value=!0:r.value=!1};u(()=>{l(),window.addEventListener("resize",l)}),C(()=>{window.removeEventListener("resize",l)});const k=h({page:1,size:10,total:0}),v=async()=>{try{k.value.total=85}catch(y){console.error("加载文件列表失败:",y)}};return u(()=>{v()}),(y,X)=>{const w=p("router-link"),_=p("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":!r.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",A,[t("div",J,[t("div",{class:o(["rounded-full p-1",[e(a)?"bg-gray-800":"bg-white"]])},[n(e(V),{class:o(["w-6 h-6",[e(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2)]),n(w,{to:"/"},{default:z(()=>[t("h1",{class:o(["ml-2 text-xl font-semibold",[e(a)?"text-white":"text-gray-800"]])},m(e(b).name),3)]),_:1})]),t("button",{onClick:g,class:"lg:hidden"},[n(e(I),{class:o(["w-6 h-6",[e(a)?"text-gray-400":"text-gray-600"]])},null,8,["class"])])],2),t("nav",O,[t("ul",H,[(d(),x(L,null,B(f,s=>t("li",{key:s.id},[t("a",{onClick:$=>e(c).push(s.redirect),class:o(["flex items-center p-2 rounded-lg transition-colors duration-200",[e(c).currentRoute.value.name===s.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(),S(j(s.icon),{class:"w-5 h-5 mr-3"})),N(" "+m(s.name),1)],10,K)])),64))])])],2),t("div",T,[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",U,[t("button",{onClick:g,class:"lg:hidden"},[n(e(q),{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(_)],2)])],2)}}});export{Q as default};