mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
dev-webui 设备管理页面UI更新
This commit is contained in:
parent
72fa13b0e7
commit
e0318d3960
3 changed files with 571 additions and 310 deletions
BIN
ZhiKongTaiWeb/src/assets/welcome_banner.png
Normal file
BIN
ZhiKongTaiWeb/src/assets/welcome_banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 600 KiB |
|
|
@ -1,34 +1,46 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="device-card">
|
<div class="device-card">
|
||||||
<div class="device-header">
|
<div class="card-header">
|
||||||
<h2 class="device-id">{{ deviceId }} <span class="note">[{{ deviceNote || '备注' }}]</span></h2>
|
<div class="device-code">{{ deviceId }}</div>
|
||||||
|
<div class="card-actions">
|
||||||
|
<button class="action-btn delete" @click="handleDelete">🗑️</button>
|
||||||
|
<button class="action-btn info">ℹ️</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="device-details">
|
<div class="card-body">
|
||||||
<p class="device-type">设备型号:{{ deviceType }}</p>
|
<div class="device-info">
|
||||||
<p class="device-role">角色昵称:{{ deviceRole }}</p>
|
<div class="info-label">设备型号:</div>
|
||||||
<p class="device-modules">
|
<div class="info-value">{{ deviceType }}</div>
|
||||||
当前模型:
|
</div>
|
||||||
<span class="module-item">LLM: {{ selectedModules?.LLM || '-' }}</span>
|
|
||||||
<span class="module-item">TTS: {{ selectedModules?.TTS || '-' }}</span>
|
<div class="device-actions">
|
||||||
</p>
|
<button class="device-action-btn" @click="handleConfigure">配置角色</button>
|
||||||
<p class="last-activity">最近对话:{{ lastActivity }}</p>
|
<button class="device-action-btn">声纹识别</button>
|
||||||
</div>
|
<button class="device-action-btn">历史对话</button>
|
||||||
|
|
||||||
<div class="device-actions">
|
<div class="ota-toggle">
|
||||||
<button class="action-btn primary" @click="handleConfigure">配置角色</button>
|
<span class="ota-label">OTA升级:</span>
|
||||||
<button class="action-btn" @click="$emit('voiceprint')">声纹识别</button>
|
<label class="toggle">
|
||||||
<button class="action-btn" @click="$emit('history')">历史对话</button>
|
<input type="checkbox" :checked="false">
|
||||||
<div class="delete-container">
|
<span class="slider round"></span>
|
||||||
<button class="action-btn danger" @click="handleDelete">
|
</label>
|
||||||
<i class="icon-delete"></i> 删除设备
|
</div>
|
||||||
</button>
|
</div>
|
||||||
<div class="delete-warning">删除后设备配置将不可恢复</div>
|
|
||||||
|
<div class="device-footer">
|
||||||
|
<div class="last-active">最近对话:{{ lastActivity}}</div>
|
||||||
|
<div class="app-version">客户端版本:{{ "v1.0.0" }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, computed } from 'vue';
|
import { ref, watch, computed } from 'vue';
|
||||||
import SwitchToggle from './SwitchToggle.vue';
|
import SwitchToggle from './SwitchToggle.vue';
|
||||||
|
|
@ -97,110 +109,181 @@ const handleConfigure = () => {
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.device-card {
|
.device-card {
|
||||||
background: white;
|
background-color: var(--card-bg);
|
||||||
border-radius: 4px;
|
border-radius: 8px;
|
||||||
padding: 20px;
|
overflow: hidden;
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||||
margin-bottom: 16px;
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.device-id {
|
.device-card:hover {
|
||||||
font-size: 18px;
|
transform: translateY(-3px);
|
||||||
font-weight: bold;
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.note {
|
.card-header {
|
||||||
color: #4178EE;
|
display: flex;
|
||||||
font-size: 14px;
|
justify-content: space-between;
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-details p {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ota-upgrade {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 16px;
|
padding: 1rem;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-code {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn:hover {
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn.delete:hover {
|
||||||
|
background-color: #ffebee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-info {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
color: var(--light-text);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.device-actions {
|
.device-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 20px;
|
flex-wrap: wrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn {
|
.device-action-btn {
|
||||||
padding: 8px 16px;
|
padding: 0.4rem 0.8rem;
|
||||||
margin-right: 12px;
|
background-color: #f0f4ff;
|
||||||
border: 1px solid #ddd;
|
border: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: white;
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-color);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn.primary {
|
.device-action-btn:hover {
|
||||||
background: #4178EE;
|
background-color: #e6f0ff;
|
||||||
color: white;
|
|
||||||
border-color: #4178EE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn.danger {
|
.ota-toggle {
|
||||||
background: #fff3f3;
|
display: flex;
|
||||||
border-color: #ffa4a4;
|
align-items: center;
|
||||||
color: #f56c6c;
|
margin-top: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn.danger:hover {
|
.ota-label {
|
||||||
background: #fde2e2;
|
font-size: 0.8rem;
|
||||||
border-color: #f56c6c;
|
color: var(--light-text);
|
||||||
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.device-modules {
|
/* 开关样式 */
|
||||||
margin-bottom: 12px;
|
.toggle {
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.module-item {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 16px;
|
|
||||||
padding: 4px 8px;
|
|
||||||
background: #f5f7fa;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-role {
|
|
||||||
color: #666;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-container {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: auto; /* Push delete button to the right */
|
display: inline-block;
|
||||||
|
width: 40px;
|
||||||
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delete-warning {
|
.toggle input {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: calc(100% + 5px); /* Position above the button */
|
cursor: pointer;
|
||||||
left: 50%;
|
top: 0;
|
||||||
transform: translateX(-50%);
|
left: 0;
|
||||||
white-space: nowrap;
|
right: 0;
|
||||||
background: #fff3f3;
|
bottom: 0;
|
||||||
padding: 4px 8px;
|
background-color: #ccc;
|
||||||
border-radius: 4px;
|
transition: .4s;
|
||||||
border: 1px solid #ffa4a4;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #f56c6c;
|
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.delete-container:hover .delete-warning {
|
.slider:before {
|
||||||
display: block;
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
left: 2px;
|
||||||
|
bottom: 2px;
|
||||||
|
background-color: white;
|
||||||
|
transition: .4s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-delete {
|
input:checked + .slider {
|
||||||
margin-right: 4px;
|
background-color: var(--primary-color);
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
input:checked + .slider:before {
|
||||||
|
transform: translateX(20px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round {
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider.round:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--lighter-text);
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
border-top: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 576px) {
|
||||||
|
.device-actions {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-action-btn {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,20 +1,53 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app">
|
<div class="app-container">
|
||||||
<NavBar current-tab="device" @tab-change="handleTabChange"/>
|
<!-- 顶部导航栏 -->
|
||||||
<main class="content">
|
<header class="header">
|
||||||
<div class="page-header">
|
<div class="logo-container">
|
||||||
<div class="header-left">
|
<div class="logo">
|
||||||
|
<img src="../assets/robot.png" alt="小智AI" />
|
||||||
<div class="breadcrumb">
|
|
||||||
<router-link to="/">首页</router-link> /
|
|
||||||
<span>设备管理</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<span class="logo-text"><router-link to="/">小智.AI</router-link></span>
|
||||||
|
<!-- <span class="logo-text">小智.AI</span> -->
|
||||||
</div>
|
</div>
|
||||||
<button class="add-btn" @click="showBindDialog = true">
|
|
||||||
<i class="icon-plus"></i>添加设备
|
<div class="nav-buttons">
|
||||||
</button>
|
<button class="nav-button active">
|
||||||
<!-- 绑定设备弹窗 -->
|
<span class="icon">⚙️</span>
|
||||||
|
设备管理
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="search-container">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="search-input"
|
||||||
|
placeholder="输入关键搜索..."
|
||||||
|
v-model="searchQuery"
|
||||||
|
/>
|
||||||
|
<button class="search-button">🔍</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="user-info">
|
||||||
|
<div class="user-avatar">👤</div>
|
||||||
|
<span class="user-notification">158</span>
|
||||||
|
<span class="user-balance">B642</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- 主要内容区域 -->
|
||||||
|
<main class="main-content">
|
||||||
|
<!-- 欢迎横幅 -->
|
||||||
|
<section class="welcome-banner">
|
||||||
|
<div class="welcome-text">
|
||||||
|
<h1>您好,小智</h1>
|
||||||
|
<h2>让我们度过<span class="highlight">美好的一天</span>!</h2>
|
||||||
|
<p class="subtitle">Hello, Let's have a wonderful day!</p>
|
||||||
|
|
||||||
|
<button class="add-device-btn" @click="showBindDialog = true">
|
||||||
|
添加设备
|
||||||
|
<span class="arrow">→</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<!-- 绑定设备弹窗 -->
|
||||||
<div v-if="showBindDialog" class="dialog-overlay">
|
<div v-if="showBindDialog" class="dialog-overlay">
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<h3>绑定新设备</h3>
|
<h3>绑定新设备</h3>
|
||||||
|
|
@ -41,10 +74,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="welcome-image">
|
||||||
|
<img src="../assets/welcome_banner.png" alt="AI图像" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<template v-if="devices.length > 0">
|
<!-- 设备卡片网格 -->
|
||||||
<div class="device-list">
|
<section class="device-grid">
|
||||||
<DeviceCard
|
<DeviceCard
|
||||||
v-for="device in devices"
|
v-for="device in devices"
|
||||||
:key="device.id"
|
:key="device.id"
|
||||||
:device-id="device.id"
|
:device-id="device.id"
|
||||||
|
|
@ -58,13 +95,20 @@
|
||||||
@history="handleHistory(device)"
|
@history="handleHistory(device)"
|
||||||
@delete="handleDelete(device)"
|
@delete="handleDelete(device)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</section>
|
||||||
</template>
|
|
||||||
|
<!-- 分页控制 -->
|
||||||
|
<div class="pagination">
|
||||||
|
<button class="pagination-btn prev">
|
||||||
|
<span class="arrow">←</span>
|
||||||
|
</button>
|
||||||
|
<button class="pagination-btn next">
|
||||||
|
<span class="arrow">→</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
@ -210,219 +254,287 @@ const handleTabChange = (tab) => {
|
||||||
onMounted(loadDevices);
|
onMounted(loadDevices);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style>
|
||||||
.app {
|
:root {
|
||||||
min-height: 100%;
|
--primary-color: #4e6ef2;
|
||||||
width: 100%;
|
--secondary-color: #f0f4ff;
|
||||||
display: flex;
|
--text-color: #333;
|
||||||
flex-direction: column;
|
--light-text: #666;
|
||||||
|
--lighter-text: #999;
|
||||||
|
--border-color: #eaeaea;
|
||||||
|
--card-bg: #fff;
|
||||||
|
--hover-color: #e6f0ff;
|
||||||
|
--gradient-start: #4e6ef2;
|
||||||
|
--gradient-end: #7986cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
color: var(--text-color);
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 60px;
|
|
||||||
padding: 0 20px;
|
|
||||||
background-color: #001529;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-right: 40px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: opacity 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo:hover {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 20px;
|
|
||||||
height: 60px;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item.active {
|
|
||||||
background-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-device {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
flex: 1;
|
|
||||||
padding: 20px;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.breadcrumb {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.breadcrumb a {
|
|
||||||
color: #666;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-bar {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.add-device-btn {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 8px 16px;
|
|
||||||
background: white;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-plus {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-card {
|
|
||||||
background: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-id {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note {
|
|
||||||
color: #4178EE;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-details p {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ota-upgrade {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-actions {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn {
|
|
||||||
padding: 8px 16px;
|
|
||||||
margin-right: 12px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: white;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.primary {
|
|
||||||
background: #4178EE;
|
|
||||||
color: white;
|
|
||||||
border-color: #4178EE;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.danger {
|
|
||||||
color: #f56c6c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-state {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 300px;
|
|
||||||
background: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-message {
|
|
||||||
text-align: center;
|
|
||||||
color: #666;
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-message p {
|
|
||||||
margin: 8px 0 0;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-info {
|
.app-container {
|
||||||
display: inline-block;
|
display: flex;
|
||||||
width: 24px;
|
flex-direction: column;
|
||||||
height: 24px;
|
min-height: 100vh;
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
|
max-width: 100%;
|
||||||
background-size: contain;
|
margin: 0 auto;
|
||||||
opacity: 0.6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
/* 顶部导航栏样式 */
|
||||||
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 20px;
|
padding: 0.8rem 1.5rem;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-left {
|
.logo-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
margin-right: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-btn {
|
.logo {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
margin-right: 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
}
|
||||||
padding: 8px 16px;
|
|
||||||
background-color: #28a745;
|
.logo img {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-text {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-buttons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background-color: var(--primary-color);
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 14px;
|
font-size: 0.9rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-button .icon {
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-item {
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-close {
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background-color: var(--secondary-color);
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 0.3rem 0.8rem;
|
||||||
|
margin: 0 1rem;
|
||||||
|
flex-grow: 0.5;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 0.5rem;
|
||||||
|
outline: none;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-avatar {
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-notification, .user-balance {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
padding: 0.3rem 0.8rem;
|
||||||
|
border-radius: 15px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 主要内容区域样式 */
|
||||||
|
.main-content {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 1.5rem;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 欢迎横幅样式 */
|
||||||
|
.welcome-banner {
|
||||||
|
display: flex;
|
||||||
|
background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
|
||||||
|
border-radius: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
|
||||||
|
position: relative;
|
||||||
|
min-height: 200px; /* 原高度300px缩减为200px */
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-text {
|
||||||
|
padding: 1.8rem; /* 原2.5rem减少28% */
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-text h1 {
|
||||||
|
font-size: 1.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-text h2 {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
color: var(--light-text);
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-device-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.7rem 1.5rem;
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 25px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 0.9rem;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
height: 36px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-btn:hover {
|
.add-device-btn:hover {
|
||||||
background-color: #218838;
|
background-color: #3d5bd9;
|
||||||
|
transform: translateY(-2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-plus {
|
.arrow {
|
||||||
font-size: 16px;
|
margin-left: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.welcome-image {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-image img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover; /* 改为cover保持图片比例 */
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设备卡片网格样式 */
|
||||||
|
.device-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||||
|
gap: 1.5rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 分页控制样式 */
|
||||||
|
.pagination {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination-btn {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: white;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 0 0.5rem;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination-btn:hover {
|
||||||
|
background-color: var(--hover-color);
|
||||||
|
}
|
||||||
.dialog-overlay {
|
.dialog-overlay {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -493,8 +605,74 @@ onMounted(loadDevices);
|
||||||
border-color: #90be9c;
|
border-color: #90be9c;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
/* 响应式设计 */
|
||||||
.breadcrumb {
|
@media (max-width: 1200px) {
|
||||||
margin-bottom: 0;
|
.welcome-banner {
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 160px; /* 同步降低响应式高度 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-image {
|
||||||
|
height: 120px; /* 原200px缩减为120px */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.header {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-container {
|
||||||
|
order: 3;
|
||||||
|
width: 100%;
|
||||||
|
margin: 1rem 0 0;
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-grid {
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-text h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-text h2 {
|
||||||
|
font-size: 1.7rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 576px) {
|
||||||
|
.header {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-text {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-button {
|
||||||
|
padding: 0.4rem 0.8rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-container {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-notification, .user-balance {
|
||||||
|
padding: 0.2rem 0.5rem;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-text {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue