feat(device): 增强导出功能,支持按筛选条件导出全部设备

- 导出接口从 GET 改为 POST,避免 URL 长度限制

- 新增 filters 参数支持按关键词、状态、类型、机房、机柜筛选导出

- 修复删除/编辑设备后分页跳回第一页的问题

- 导出模态框改为传递计数而非数组,支持显示总数

- 使用唯一文件名避免并发导出冲突

- 补充 idle 状态映射
This commit is contained in:
zhang1106
2026-06-12 09:39:06 +08:00
parent b075c23374
commit 170997ef61
5 changed files with 208 additions and 84 deletions
+32 -23
View File
@@ -786,30 +786,39 @@ paths:
description: 导入成功
/api/devices/enhanced-export:
get:
summary: 增强导出设备数据
post:
summary: 增强导出设备数据(支持按筛选条件导出全部设备)
tags: [devices]
parameters:
- name: deviceIds
in: query
schema:
type: string
- name: format
in: query
schema:
type: string
enum: [csv, json]
default: csv
- name: fields
in: query
schema:
type: string
description: JSON格式的字段列表
- name: fieldLabels
in: query
schema:
type: string
description: JSON格式的字段标签映射
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
deviceIds:
type: array
items:
type: string
description: 指定导出的设备ID列表(与filters二选一)
format:
type: string
enum: [csv, json]
default: csv
filters:
type: object
description: 筛选条件(导出全部设备时使用)
properties:
keyword:
type: string
status:
type: string
type:
type: string
roomId:
type: string
rackId:
type: string
responses:
'200':
description: 导出成功