去掉设备信息中的status字段

This commit is contained in:
2025-09-08 19:56:05 +08:00
parent 7819773562
commit 9d36ae6b00
5 changed files with 168 additions and 324 deletions

View File

@@ -292,15 +292,6 @@
color: white;
}
.status-active {
color: #28a745;
font-weight: bold;
}
.status-inactive {
color: #dc3545;
font-weight: bold;
}
@media (max-width: 768px) {
.dashboard-grid {
@@ -378,13 +369,6 @@
<option value="">请选择上级设备</option>
</select>
</div>
<div class="form-group">
<label for="deviceStatus">设备状态</label>
<select id="deviceStatus" required>
<option value="active">启用</option>
<option value="inactive">停用</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
@@ -450,7 +434,6 @@
name: "一号中继器",
type: "relay",
parent_id: null,
status: "active",
created_at: "2023-01-01T00:00:00Z"
},
{
@@ -458,7 +441,6 @@
name: "A区主控",
type: "pig_pen_controller",
parent_id: 1,
status: "active",
created_at: "2023-01-02T00:00:00Z"
},
{
@@ -466,7 +448,6 @@
name: "A区1号风机",
type: "fan",
parent_id: 2,
status: "active",
created_at: "2023-01-03T00:00:00Z"
},
{
@@ -474,7 +455,6 @@
name: "A区2号风机",
type: "fan",
parent_id: 2,
status: "inactive",
created_at: "2023-01-03T00:00:00Z"
},
{
@@ -482,7 +462,6 @@
name: "B区主控",
type: "pig_pen_controller",
parent_id: 1,
status: "active",
created_at: "2023-01-02T00:00:00Z"
},
{
@@ -490,7 +469,6 @@
name: "B区水帘",
type: "water_curtain",
parent_id: 5,
status: "active",
created_at: "2023-01-04T00:00:00Z"
}
];
@@ -522,7 +500,6 @@
<div class="node-title">
<span>${relay.name}</span>
<span class="node-type relay-type">中继</span>
<span class="status-${relay.status}">${relay.status === 'active' ? '启用' : '停用'}</span>
</div>
<div class="node-actions">
<button class="action-btn edit-btn" onclick="editDevice(${relay.id})">编辑</button>
@@ -565,7 +542,6 @@
<div class="node-title">
<span>${controller.name}</span>
<span class="node-type controller-type">${typeText}</span>
<span class="status-${controller.status}">${controller.status === 'active' ? '启用' : '停用'}</span>
</div>
<div class="node-actions">
<button class="action-btn edit-btn" onclick="editDevice(${controller.id})">编辑</button>
@@ -606,7 +582,6 @@
<div class="node-title">
<span>${device.name}</span>
<span class="node-type device-type">${typeText}</span>
<span class="status-${device.status}">${device.status === 'active' ? '启用' : '停用'}</span>
</div>
<div class="node-actions">
<button class="action-btn edit-btn" onclick="editDevice(${device.id})">编辑</button>
@@ -697,8 +672,6 @@
const name = document.getElementById('deviceName').value;
const type = document.getElementById('deviceType').value;
const parentId = document.getElementById('parentId').value;
const status = document.getElementById('deviceStatus').value;
if (!name || !type) {
alert('请填写必填字段');
return;
@@ -707,7 +680,6 @@
const deviceData = {
name: name,
type: type,
status: status,
parent_id: parentId ? parseInt(parentId) : null
};