From 0c9a59a98c7b8939a9d8e832c19773d2363f73f4 Mon Sep 17 00:00:00 2001 From: chndfang Date: Tue, 29 Apr 2025 20:08:08 +0800 Subject: [PATCH] temp --- src/apis/robot/constant.ts | 17 +++++++++++++++-- src/apis/robot/type.ts | 28 +++++++++++++++++++++++++--- src/apis/scene/api.ts | 5 +++++ src/apis/scene/type.ts | 8 ++++++++ 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/apis/robot/constant.ts b/src/apis/robot/constant.ts index 5d8f333..8b29311 100644 --- a/src/apis/robot/constant.ts +++ b/src/apis/robot/constant.ts @@ -1,3 +1,16 @@ -export enum RobotType { - 叉车 = 1, +export enum RobotBrand { + '先工' = 1, +} + +export enum RobotType { + 叉车机器人 = 1, + AMR机器人, + 料箱机器人, +} + +export enum RobotState { + '任务执行中' = 1, + '充电中', + '停靠中', + '故障中', } diff --git a/src/apis/robot/type.ts b/src/apis/robot/type.ts index 476eea7..f882037 100644 --- a/src/apis/robot/type.ts +++ b/src/apis/robot/type.ts @@ -1,8 +1,30 @@ -import type { RobotType } from './constant'; +import type { RobotBrand, RobotState, RobotType } from './constant'; + +export interface RobotGroup { + id: number; // 机器人组id + label: string; // 机器人组名称 + robotIds: number[]; // 机器人id列表 +} export interface RobotInfo { + group?: number; // 机器人组id id: number; // 机器人id - name: string; // 机器人名称 - brand?: string; // 机器人品牌 + label: string; // 机器人名称 + brand: RobotBrand; // 机器人品牌 type: RobotType; // 机器人类型 + ip: string; // 机器人ip + isConnected?: boolean; // 机器人连接状态 + battery?: number; // 机器人电量 + state?: RobotState; // 机器人状态 + canOrder?: boolean; // 接单状态 + canStop?: boolean; // 急停状态 + canControl?: boolean; // 控制状态 +} + +export interface RobotDetail extends RobotInfo { + isSimulative?: boolean; // 是否仿真机器人 + minBattery?: number; // 最小电量 + maxBattery?: number; // 最大电量 + chargeBattery?: number; // 充电电量 + swapBattery?: number; // 交换电量 } diff --git a/src/apis/scene/api.ts b/src/apis/scene/api.ts index e69de29..a1afc86 100644 --- a/src/apis/scene/api.ts +++ b/src/apis/scene/api.ts @@ -0,0 +1,5 @@ +const enum API { + 获取场景 = '/scene/getById', +} + +export function getSceneById(id: number) {} diff --git a/src/apis/scene/type.ts b/src/apis/scene/type.ts index e69de29..38fb285 100644 --- a/src/apis/scene/type.ts +++ b/src/apis/scene/type.ts @@ -0,0 +1,8 @@ +import type { RobotGroup } from '@api/robot'; + +export interface SceneInfo { + id: number; // 场景id + label: string; // 场景名称 + robotGrroups?: RobotGroup[]; // 机器人组列表 + map?: string; // 地图JSON +}