feat: add find page, breadcrumb components and canvas workbench updates

This commit is contained in:
2026-08-30 14:38:09 +08:00
parent ee3b7745b7
commit bceb3a1542
21 changed files with 2239 additions and 73 deletions
+27 -3
View File
@@ -22,7 +22,7 @@
### GET `/api/jobs`
返回内存中的任务状态列表,最新任务在前。
返回任务状态列表,最新任务在前。除内存中登记的任务外,还会扫描 `service_workspace` 补充磁盘上已完成但未登记的任务(有 `wordcloud_hd.db` 即认为是成功可查找)。
### POST `/api/jobs`
@@ -128,13 +128,14 @@ SSE 事件流。事件数据模型:
### GET `/api/jobs/{job_id}/locations`
查询词语位置。
查询词语位置(单任务内查找)
查询参数:
| 参数 | 说明 |
|------|------|
| `name` | 可选;为空返回全部,非空精确匹配 |
| `name` | 可选;为空返回全部,非空时按 `mode` 匹配 |
| `mode` | 可选;`exact`(默认,精确匹配)/ `contains`(子串包含,转义通配符后 `LIKE %name%` |
返回:
@@ -142,6 +143,7 @@ SSE 事件流。事件数据模型:
{
"job_id": "...",
"query": "",
"mode": "exact",
"total": 1,
"canvas_width": 8000,
"canvas_height": 4000,
@@ -163,6 +165,28 @@ SSE 事件流。事件数据模型:
}
```
### GET `/api/jobs/{job_id}/find`
单任务内查找名字的**受保护接口**,供独立查找页使用(与 `/locations` 响应结构相同)。
- 需要鉴权:`Authorization: Bearer <token>`token 由 `POST /api/login` 获取
- 查询参数与 `/locations` 一致:`name``mode``exact` / `contains`
- 无 token 或 token 错误返回 `403`
### POST `/api/login`
管理口令登录,返回查找页 / 订单页共用的鉴权 token。
请求体(JSON):
```json
{"password": "管理口令"}
```
- 口令错误返回 `401`
- 成功返回:`{"token": "..."}`;后续请求带 `Authorization: Bearer <token>`
- 默认口令 `zhihui2024`,生产可用环境变量 `ORDERS_ADMIN_PASSWORD` 覆盖(见 `backend/service/app.py`
### GET `/api/jobs/{job_id}/occupancy_mask`
返回 PNG,显示每个已放置词语的 bounding box。