feat: 新增OPS模块API接口定义
- 新增区域管理API(Area):区域树、区域设备关联 - 新增保洁管理API(Cleaning):工牌状态、工单时间轴、设备通知 - 新增工单中心API(OrderCenter):工单查询、统计、操作接口 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 区域类型 */
|
||||
export type AreaType = 'PARK' | 'BUILDING' | 'FLOOR' | 'FUNCTION';
|
||||
export type AreaType = 'BUILDING' | 'FLOOR' | 'FUNCTION' | 'PARK';
|
||||
|
||||
/** 功能类型 */
|
||||
export type FunctionType =
|
||||
| 'MALE_TOILET'
|
||||
| 'FEMALE_TOILET'
|
||||
| 'PUBLIC'
|
||||
| 'ELEVATOR'
|
||||
| 'FEMALE_TOILET'
|
||||
| 'MALE_TOILET'
|
||||
| 'PUBLIC'
|
||||
| string;
|
||||
|
||||
/** 区域等级 */
|
||||
export type AreaLevel = 'HIGH' | 'MEDIUM' | 'LOW';
|
||||
export type AreaLevel = 'HIGH' | 'LOW' | 'MEDIUM';
|
||||
|
||||
/** 关联类型 */
|
||||
export type RelationType = 'TRAFFIC_COUNTER' | 'BEACON' | 'BADGE' | string;
|
||||
export type RelationType = 'BADGE' | 'BEACON' | 'TRAFFIC_COUNTER' | string;
|
||||
|
||||
export namespace OpsAreaApi {
|
||||
/** 业务区域 */
|
||||
|
||||
@@ -74,12 +74,12 @@ export namespace OpsCleaningApi {
|
||||
deviceId: number; // 设备ID
|
||||
deviceKey: string; // 设备Key
|
||||
status: BadgeStatus | string; // 设备状态(兼容大小写)
|
||||
batteryLevel: number | null; // 电量(可能为空)
|
||||
batteryLevel: null | number; // 电量(可能为空)
|
||||
lastHeartbeatTime: string; // 最后心跳时间
|
||||
rssi?: number | null; // 信号强度(可能为空)
|
||||
rssi?: null | number; // 信号强度(可能为空)
|
||||
isInArea: boolean; // 是否在区域内
|
||||
areaId?: number; // 当前区域ID
|
||||
areaName?: string | null; // 当前区域名称(可能为空)
|
||||
areaName?: null | string; // 当前区域名称(可能为空)
|
||||
}
|
||||
|
||||
/** 业务日志类型 */
|
||||
@@ -117,22 +117,28 @@ export interface IotDeviceStatus {
|
||||
/** 获取 IoT 设备状态 */
|
||||
export function getIotDeviceStatus(deviceId: number) {
|
||||
return requestClient.get<IotDeviceStatus>(`/iot/device/status/get-status`, {
|
||||
params: { deviceId }
|
||||
params: { deviceId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量获取 IoT 设备状态 */
|
||||
export function batchGetIotDeviceStatus(deviceIds: number[]) {
|
||||
return requestClient.get<IotDeviceStatus[]>(`/iot/device/status/batch-get-status`, {
|
||||
params: { deviceIds }
|
||||
});
|
||||
return requestClient.get<IotDeviceStatus[]>(
|
||||
`/iot/device/status/batch-get-status`,
|
||||
{
|
||||
params: { deviceIds },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取 IoT 设备最新属性(含电量、RSSI等) */
|
||||
export function getIotDeviceProperties(deviceId: number) {
|
||||
return requestClient.get<Record<string, any>>(`/iot/device/property/get-latest`, {
|
||||
params: { deviceId }
|
||||
});
|
||||
return requestClient.get<Record<string, any>>(
|
||||
`/iot/device/property/get-latest`,
|
||||
{
|
||||
params: { deviceId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// ==================== 保洁专属接口 ====================
|
||||
|
||||
@@ -40,9 +40,9 @@ export namespace OpsOrderCenterApi {
|
||||
export enum TriggerSource {
|
||||
IOT_BEACON = 'IOT_BEACON', // 蓝牙信标
|
||||
IOT_TRAFFIC = 'IOT_TRAFFIC', // 客流阈值(IoT设备)
|
||||
TRAFFIC = 'TRAFFIC', // 客流阈值
|
||||
PEOPLE_FLOW = 'PEOPLE_FLOW', // 客流阈值(旧版)
|
||||
MANUAL = 'MANUAL', // 手动创建
|
||||
PEOPLE_FLOW = 'PEOPLE_FLOW', // 客流阈值(旧版)
|
||||
TRAFFIC = 'TRAFFIC', // 客流阈值
|
||||
}
|
||||
|
||||
/** 工单查询参数 */
|
||||
@@ -78,8 +78,8 @@ export namespace OpsOrderCenterApi {
|
||||
areaId?: number; // 区域ID
|
||||
location?: string; // 位置描述
|
||||
assigneeId?: number; // 执行人ID
|
||||
assigneeName?: string | null; // 执行人姓名(可能为空)
|
||||
createTime: string | number; // 创建时间(支持时间戳或字符串)
|
||||
assigneeName?: null | string; // 执行人姓名(可能为空)
|
||||
createTime: number | string; // 创建时间(支持时间戳或字符串)
|
||||
sourceType?: TriggerSource; // 触发来源
|
||||
extInfo?: CleaningExtInfo; // 保洁扩展信息
|
||||
}
|
||||
@@ -91,9 +91,9 @@ export namespace OpsOrderCenterApi {
|
||||
triggerDeviceId?: number; // 触发设备ID
|
||||
triggerDeviceKey?: string; // 触发设备Key
|
||||
triggerRule?: string; // 触发规则
|
||||
startTime?: string | number | null; // 开始时间(到岗时间,支持时间戳或字符串)
|
||||
endTime?: string | number | null; // 结束时间(支持时间戳或字符串)
|
||||
updateTime?: string | number; // 更新时间(支持时间戳或字符串)
|
||||
startTime?: null | number | string; // 开始时间(到岗时间,支持时间戳或字符串)
|
||||
endTime?: null | number | string; // 结束时间(支持时间戳或字符串)
|
||||
updateTime?: number | string; // 更新时间(支持时间戳或字符串)
|
||||
remark?: string; // 备注
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user