vue3+tailwindcss实现pc端智慧停车场管理系统后台仪表盘ui原型图代码
代码语言:html
所属分类:布局界面
代码描述:vue3+tailwindcss实现pc端智慧停车场管理系统后台仪表盘ui原型图代码
代码标签: vue tailwindcss pc端 智慧 停车场 管理 系统 后台 仪表盘 ui 原型图 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>智慧停车管理系统</title> <!-- Vue 3 CDN --> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue.global.prod.3.5.17.js"></script> <!-- ECharts CDN --> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/echarts.5.4.2.js"></script> <!-- Tailwind CSS CDN --> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tailwindcss.3.4.16.js"></script> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; } .app { display: flex; height: 100vh; } /* 侧边栏 */ .sidebar { width: 250px; background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%); color: white; transition: all 0.3s ease; } .sidebar.collapsed { width: 70px; } .logo { padding: 20px; text-align: center; display: flex; border-bottom: 1px solid rgba(255,255,255,0.1); } .logo h2 { font-size: 20px; margin-top: 10px; } .sidebar.collapsed .logo h2 { display: none; } .nav-menu { padding: 20px 0; } .nav-item { display: flex; align-items: center; padding: 15px 20px; cursor: pointer; transition: all 0.3s ease; border: none; background: none; color: white; width: 100%; text-align: left; } .nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); border-right: 3px solid #60a5fa; } .nav-item svg { width: 20px; height: 20px; margin-right: 12px; min-width: 20px; } .sidebar.collapsed .nav-item span { display: none; } /* 主内容区 */ .main-content { flex: 1; display: flex; flex-direction: column; } /* 顶部栏 */ .header { height: 60px; background: white; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); } .header-left { display: flex; align-items: center; } .toggle-btn { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 4px; margin-right: 15px; } .toggle-btn:hover { background: #f3f4f6; } .breadcrumb { font-size: 16px; font-weight: 500; } .header-right { display: flex; align-items: center; gap: 15px; } .user-info { display: flex; align-items: center; gap: 10px; } .avatar { width: 32px; height: 32px; border-radius: 50%; background: #3b82f6; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; } /* 内容区域 */ .content { flex: 1; padding: 20px; overflow-y: auto; } /* 卡片样式 */ .card { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; } .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #e5e7eb; } .card-title { font-size: 18px; font-weight: 600; color: #111827; } /* 统计卡片 */ .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; } .stat-card { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); display: flex; align-items: center; gap: 16px; } .stat-icon { width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; } .stat-content h3 { font-size: 24px; font-weight: bold; margin-bottom: 4px; } .stat-content p { color: #6b7280; font-size: 14px; } /* 表格样式 */ .table-container { overflow-x: auto; } table { width: 100%; border-collapse: collapse; background: white; } th, td { padding: 12px; text-align: left; border-bottom: 1px solid #e5e7eb; } th { background: #f9fafb; font-weight: 600; color: #374151; } tr:hover { background: #f9fafb; } /* 按钮样式 */ .btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 6px; } .btn-primary { background: #3b82f6; color: white; } .btn-primary:hover { background: #2563eb; } .btn-secondary { background: #6b7280; color: white; } .btn-success { background: #10b981; color: white; } .btn-danger { background: #ef4444; color: white; } .btn-sm { padding: 6px 12px; font-size: 12px; } /* 表单样式 */ .form-group { margin-bottom: 20px; } .form-label { display: block; margin-bottom: 6px; font-weight: 500; color: #374151; } .form-input { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; transition: border-color 0.2s ease; } .form-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); } .form-select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: white; font-size: 14px; } /* 模态框样式 */ .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; } .modal { background: white; border-radius: 8px; padding: 24px; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; } .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #e5e7eb; } .modal-title { font-size: 18px; font-weight: 600; } .close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: #6b7280; } .modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #e5e7eb; } /* 状态标签 */ .status-badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; } .status-success { background: #d1fae5; color: #065f46; } .status-warning { background: #fef3c7; color: #92400e; } .status-danger { background: #fee2e2; color: #991b1b; } /* 图表容器 */ .chart-container { height: 400px; margin: 20px 0; } /* 工具栏 */ .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; } .search-box { display: flex; align-items: center; gap: 10px; } .search-input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; width: 250px; } /* 响应式 */ @media (max-width: 768px) { .sidebar { width: 70px; } .stats-grid { grid-template-columns: 1fr; } .toolbar { flex-direction: column; align-items: stretch; } .search-input { width: 100%; } } /* 隐藏类 */ .hidden { display: none !important; } /* 加载动画 */ .loading { display: inline-block; width: 16px; height: 16px; border: 2px solid #f3f4f6; border-top: 2px solid #3b82f6; border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px; } .pagination button { padding: 8px 12px; border: 1px solid #d1d5db; background: white; border-radius: 4px; cursor: pointer; } .pagination button:hover { background: #f9fafb; } .pagination button.active { background: #3b82f6; color: white; border-color: #3b82f6; } .pagination button:disabled { cursor: not-allowed; opacity: 0.5; } </style> </head> <body> <div id="app"> <div class="app"> <!-- 侧边栏 --> <aside class="sidebar" :class="{ collapsed: sidebarCollapsed }"> <div class="logo"> <svg width="40" height="40" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M19 7H5C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V9C21 7.89543 20.1046 7 19 7Z" stroke="white" stroke-width="2"/> <path d="M8 7V5C8 3.89543 8.89543 3 10 3H14C15.1046 3 16 3.89543 16 5V7" stroke="white" stroke-width="2"/> <circle cx="12" cy="13" r="2" stroke="white" stroke-width="2"/> </svg> <span style="font-size: 20px;margin: 7px 0px 0px 17px;" v-show="!sidebarCollapsed">智慧停车</span> </div> <nav class="nav-menu"> <button v-for="item in menuItems" :key="item.key" class="nav-item" :class="{ active: currentPage === item.key }" @click="navigateTo(item.key)" > <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" v-html="item.icon"></svg> <span>{{ item.label }}</span> </button> </nav> </aside> <!-- 主内容区 --> <main class="main-content"> <!-- 顶部栏 --> <header class="header"> <div class="header-left"> <button class="toggle-btn" @click="toggleSidebar"> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M3 12H21M3 6H21M3 18H21" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> </svg> </button> <div class="breadcrumb">{{ getCurrentPageTitle() }}</div> </div> <div class="header-right"> <div class="user-info"> <span>管理员</span> <div class="avatar">A</div> </div> </div> </header> <!-- 内容区域 --> <div class="content"> <!-- 仪表盘页面 --> <div v-show="currentPage === 'dashboard'"> <div class="stats-grid"> <div class="stat-card"> <div class="stat-icon" style="background: #dbeafe; color: #1d4ed8;"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M19 7H5C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V9C21 7.89543 20.1046 7 19 7Z" stroke="currentColor" stroke-width="2"/> <path d="M8 7V5C8 3.89543 8.89543 3 10 3H14C15.1046 3 16 3.89543 16 5V7" stroke="currentColor" stroke-width="2"/> </svg> </div> <div class="stat-content"> <h3>{{ stats.totalSpaces }}</h3> <p>总停车位</p> </div> </div> <div class="stat-card"> <div class="stat-icon" style="background: #dcfce7; color: #166534;"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8 17L16 17M8 17C8 18.1046 7.10457 19 6 19C4.89543 19 4 18.1046 4 17C4 15.8954 4.89543 15 6 15C7.10457 15 8 15.8954 8 17ZM16 17C16 18.1046 16.8954 19 18 19C19.1046 19 20 18.1046 20 17C20 15.8954 19.1046 15 18 15C16.8954 15 16 15.8954 16 17ZM10 5L14 5M10 5L8 15L16 15M10 5C10 3.89543 10.8954 3 12 3C13.1046 3 14 3.89543 14 5M14 5L16 15" stroke="currentColor" stroke-width="2"/> </svg> </div> <div class="stat-content"> <h3>{{ stats.occupiedSpaces }}</h3> <p>已占用</p> </div> </div> <div class="stat-card"> <div class="stat-icon" style="background: #fef3c7; color: #92400e;"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12 2L2 7L12 12L22 7L12 2Z" stroke="currentColor" stroke-width="2"/> <path d="M2 17L12 22L22 17" stroke="currentColor" stroke-width="2"/> <path d="M2 12L12 17L22 12" stroke="currentColor" stroke-width="2"/> </svg> .........完整代码请登录后点击上方下载按钮下载查看
网友评论0