完成了机柜可视化功能,鼠标悬停显示设备信息

This commit is contained in:
zhang1106
2025-12-20 08:20:51 +08:00
parent a5f8b3cc97
commit ad5cb31569
9 changed files with 1271 additions and 8 deletions
+6 -1
View File
@@ -14,7 +14,7 @@ const DeviceField = require('../models/DeviceField');
// 获取所有设备(支持搜索和筛选)
router.get('/', async (req, res) => {
try {
const { keyword, status, type, page = 1, pageSize = 10 } = req.query;
const { keyword, status, type, rackId, page = 1, pageSize = 10 } = req.query;
const offset = (page - 1) * pageSize;
// 构建查询条件
@@ -44,6 +44,11 @@ router.get('/', async (req, res) => {
where.type = type;
}
// 机柜筛选(用于机柜可视化功能)
if (rackId) {
where.rackId = rackId;
}
// 执行查询
const { count, rows } = await Device.findAndCountAll({
where,