feat: add CLI submitted task query

This commit is contained in:
gitea committed 2026-09-05 13:51:33 +08:00
1 parent 12247fd350
commit 97abdb4f96
7 files changed
+62 -7

No files matched your search

+10 -2
View File
@@ -25,9 +25,11 @@ export async function handleTaskCommand(parsed: CliParsedArgs, runtime: CliRunti
? "processed"
: action === "cc" || action === "carboncopy" || action === "carbon-copy"
? "cc"
: action === "submitted" || action === "mine" || action === "created"
? "submitted"
: undefined;
if (!view) {
throw new Error("未知 task 子命令。支持: todo, approved, records, cc");
throw new Error("未知 task 子命令。支持: todo, approved, records, submitted, cc");
}
const count = numberOption(parsed.options, ["count", "limit", "n"], 20);
const start = numberOption(parsed.options, ["start", "offset"], 0);
@@ -56,7 +58,13 @@ export async function handleTaskCommand(parsed: CliParsedArgs, runtime: CliRunti
item.nodeName || "-",
item.action || "-",
]);
const labels: Record<TaskView, string> = { todo: "待审批", approved: "已审批", processed: "审批记录", cc: readFilter ? "抄送(已读)" : "抄送(未读)" };
const labels: Record<TaskView, string> = {
todo: "待审批",
approved: "已审批",
processed: "审批记录",
submitted: "我发起的",
cc: readFilter ? "抄送(已读)" : "抄送(未读)",
};
return {
stdout: `====== ${labels[view]}任务 (企业: ${corp.name} | 总数: ${result.total} | 当前返回: ${result.items.length}) ======\n${printTable(headers, rows)}\n`,
stderr: "",