This commit is contained in:
chndfang 2025-05-20 17:55:56 +08:00
parent 713cf8a022
commit e0c6f4df7b
5 changed files with 79 additions and 109 deletions

2
.env
View File

@ -1,3 +1,3 @@
ENV_APP_TITLE=运输控制系统
ENV_APP_TITLE=大众一汽发动机AMR调度系统
ENV_HTTP_BASE=/api
ENV_WEBSOCKET_BASE=/ws

131
README.md

File diff suppressed because one or more lines are too long

View File

@ -1,46 +0,0 @@
# 标准地图数据结构
```typescript
interface StandardScene {
robotGroups?: Array<RobotGroup>; // 机器人组信息
robots?: Array<RobotInfo>; // 机器人信息
points?: Array<StandardScenePoint>; // 标准点位信息
routes?: Array<StandardSceneRoute>; // 标准线路信息
areas?: Array<StandardSceneArea>; // 标准区域信息
blocks?: Array<[number, number]>; // 障碍点集合
}
interface StandardScenePoint {
id: string;
name: string;
x: number;
y: number;
type: number; // 点位类型
robots?: Array<string>; // 绑定机器人id集合
actions?: Array<string>; // 绑定动作点id集合
config?: object; // 其它属性配置(可按需增加)
properties?: unknown; // 附加数据(前端不做任何处理)
}
interface StandardSceneRoute {
id: string;
connect: [string, string]; // 连接点位id
type: 'line' | 'bezier2' | 'bezier3'; // 线路类型
pass?: number; // 可通行类型
c1?: { x?: number; y?: number }; // 控制点1
c2?: { x?: number; y?: number }; // 控制点2
config?: object; // 其它属性配置(可按需增加)
properties?: unknown; // 附加数据(前端不做任何处理)
}
interface StandardSceneArea {
id: string;
name: string;
x: number;
y: number;
w: number;
h: number;
type: number; // 区域类型
points?: Array<string>; // 绑定点位id集合
routes?: Array<string>; // 绑定线路id集合
config?: object; // 其它属性配置(可按需增加)
properties?: unknown; // 附加数据(前端不做任何处理)
}
```

View File

@ -26,12 +26,12 @@ export async function getSceneById(id: SceneInfo['id']): Promise<SceneDetail | n
}
}
export async function saveSceneById(id: SceneInfo['id'], json: string): Promise<boolean> {
export async function saveSceneById(id: SceneInfo['id'], json: string, png?: string): Promise<boolean> {
if (!id) return false;
type B = { id: string; json: string };
type B = { id: string; json: string; png?: string };
type D = void;
try {
const body = { id, json };
const body = { id, json, png };
await http.post<D, B>(API., body);
return true;
} catch (error) {

View File

@ -22,7 +22,8 @@ const updateScene = async () => {
if (props.sid) {
await saveSceneByGroupId(props.id, props.sid, json);
} else {
await saveSceneById(props.id, json);
const png = editor.value.toPng(8, undefined, true);
await saveSceneById(props.id, json, png);
}
};
//#endregion