修改设备管理页面卡片样式
This commit is contained in:
@@ -64,7 +64,7 @@ onMounted(() => {
|
||||
<el-container>
|
||||
<el-aside :width="isSidebarCollapsed ? '64px' : '200px'">
|
||||
<div class="logo">
|
||||
<span v-if="!isSidebarCollapsed">树莓派设备管理系统</span>
|
||||
<span v-if="!isSidebarCollapsed">设备管理系统</span>
|
||||
</div>
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
@@ -101,9 +101,6 @@ onMounted(() => {
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<div class="main-container" :class="{ 'sidebar-collapsed': isSidebarCollapsed }">
|
||||
<header class="header">
|
||||
<h1>测偏仪管理后台</h1>
|
||||
</header>
|
||||
<main class="main-content">
|
||||
<div class="content-wrapper">
|
||||
<router-view></router-view>
|
||||
|
||||
@@ -11,12 +11,18 @@
|
||||
<div v-for="device in devices" :key="device.id" class="device-card">
|
||||
<div class="device-header">
|
||||
<h3>{{ device.name }}</h3>
|
||||
<div class="device-header-right">
|
||||
<div class="device-status-container">
|
||||
<div class="device-enabled" :class="device.enabled ? 'enabled' : 'disabled'">
|
||||
<span class="device-enabled" :class="device.enabled ? 'enabled' : 'disabled'">
|
||||
{{ device.enabled ? '已启用' : '已禁用' }}
|
||||
</div>
|
||||
<div class="device-status" :class="typeof device.status === 'object' && device.status.online ? 'online' : 'offline'">
|
||||
</span>
|
||||
<span class="device-status" :class="typeof device.status === 'object' && device.status.online ? 'online' : 'offline'">
|
||||
{{ typeof device.status === 'object' && device.status.online ? '在线' : '离线' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="device-header-actions">
|
||||
<el-button type="text" @click="editDevice(device)">编辑</el-button>
|
||||
<el-button type="text" @click="deleteDevice(device)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,8 +110,6 @@
|
||||
@click="controlDevice2(device, 'emergency_stop', 0)"
|
||||
>急停</el-button>
|
||||
</template>
|
||||
<el-button type="primary" @click="editDevice(device)">编辑</el-button>
|
||||
<el-button type="danger" @click="deleteDevice(device)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -749,41 +753,63 @@ onMounted(() => {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.device-header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.device-status-container {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.device-enabled {
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9rem;
|
||||
padding: 2px 6px;
|
||||
border-radius: 2px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.device-enabled.enabled {
|
||||
background-color: #67C23A;
|
||||
color: white;
|
||||
background-color: #E8F5E9;
|
||||
color: #2E7D32;
|
||||
border: 1px solid #C8E6C9;
|
||||
}
|
||||
|
||||
.device-enabled.disabled {
|
||||
background-color: #909399;
|
||||
color: white;
|
||||
background-color: #F5F5F5;
|
||||
color: #757575;
|
||||
border: 1px solid #E0E0E0;
|
||||
}
|
||||
|
||||
.device-status {
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9rem;
|
||||
padding: 2px 6px;
|
||||
border-radius: 2px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.device-status.online {
|
||||
background-color: #67C23A;
|
||||
color: white;
|
||||
background-color: #E3F2FD;
|
||||
color: #1565C0;
|
||||
border: 1px solid #BBDEFB;
|
||||
}
|
||||
|
||||
.device-status.offline {
|
||||
background-color: #F56C6C;
|
||||
color: white;
|
||||
background-color: #FFEBEE;
|
||||
color: #C62828;
|
||||
border: 1px solid #FFCDD2;
|
||||
}
|
||||
|
||||
.device-header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.device-header-actions .el-button--text {
|
||||
padding: 4px 8px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.device-info {
|
||||
|
||||
Reference in New Issue
Block a user