From 381ddf836c56306e643ea9ac74c9c0090121a1c4 Mon Sep 17 00:00:00 2001 From: baobao Date: Mon, 2 Nov 2026 09:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E6=98=93=E6=8C=87=E4=BB=A4=E6=8C=89?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E5=88=86=E7=BB=84=E5=B9=B6=E9=9A=94=E7=A6=BB?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=92=A4=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/web/main.py | 24 +++++++--- app/web/static/index.html | 85 +++++++++++++++++++++++++---------- scripts/run_tests.py | 2 +- scripts/test_batch49_units.py | 80 ++++++++++++++++++++++++++++++++- 4 files changed, 160 insertions(+), 31 deletions(-) diff --git a/app/web/main.py b/app/web/main.py index cd200cc..4f245e5 100644 --- a/app/web/main.py +++ b/app/web/main.py @@ -444,12 +444,17 @@ def api_lots(ts_code: str, status: str = Query("OPEN"), @app.get("/api/instructions") def api_instructions(status: str = Query(None), limit: int = 200, - include_archived: bool = Query(False)): + include_archived: bool = Query(False), + book_id: Literal["original", "micro30"] = Query("original")): statuses = [s for s in (status or "").split(",") if s] or None def _list(): + from app.core import strategy_book as books from app.services.execution_conflicts import instruction_progress - return instruction_progress(pms_repo.list_instructions(statuses=statuses, limit=limit, - include_archived=include_archived)) + if book_id == books.MICRO and not settings.INFRA_STRATEGY_BOOK_SCHEMA: + return [] + with books.scope(book_id): + return instruction_progress(pms_repo.list_instructions(statuses=statuses, limit=limit, + include_archived=include_archived)) return ok(_list) @@ -790,11 +795,18 @@ def api_sweep_windows(): @app.post("/api/instructions/{instruction_id}/cancel") -def api_cancel_instruction(instruction_id: str, payload: dict = Body(default={})): +def api_cancel_instruction(instruction_id: str, payload: dict = Body(default={}), + book_id: Literal["original", "micro30"] = Query("original")): + from app.core import strategy_book as books from app.services import executor - return ok_logged("cancel_instruction", executor.cancel_instruction, instruction_id, + def _cancel(iid, reason): + if book_id == books.MICRO and not settings.INFRA_STRATEGY_BOOK_SCHEMA: + return {"ok": False, "error": "微盘轮动账本尚未启用"} + with books.scope(book_id): + return executor.cancel_instruction(iid, reason) + return ok_logged("cancel_instruction", _cancel, instruction_id, payload.get("reason") or "页面人工撤销", - params={"instruction_id": instruction_id}) + params={"instruction_id": instruction_id, "book_id": book_id}) @app.post("/api/ops/scan-proposals") diff --git a/app/web/static/index.html b/app/web/static/index.html index bf359f1..70047e2 100644 --- a/app/web/static/index.html +++ b/app/web/static/index.html @@ -368,6 +368,10 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;} 状态芯片一行、「下一步」短语一行放下, 具体说明进悬停。 */ .position-tabs > .el-tabs__header{margin-bottom:8px;} .position-tabs .tabn{margin-left:6px;} +.instruction-books .el-tabs__item{padding:0 14px;} +.instruction-status > .el-tabs__header{margin-bottom:8px;} +.instruction-status .el-tabs__item{font-size:12px;height:32px;padding:0 9px;} +.instruction-status .el-tabs__nav-wrap::after{height:0;} .book-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;margin:10px 0;} .book-heading .book-stat{font-size:12px;color:var(--muted);} .postbl .el-scrollbar__wrap{overflow-x:auto;} @@ -1184,10 +1188,16 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;} -
+

当日指令

在办买卖安排及今日成交;跨日买入须重新复核
- + + + + + + + @@ -1196,7 +1206,7 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;} - + @@ -1216,7 +1226,7 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;} - +
未建仓候选
@@ -1999,11 +2009,17 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;}
-
+

在途指令 显示已了结

- + + + + + + +