+
+
📋 工单面板
+
+
+
+ {creating &&
+
新建工单
+
+
📌 常用模板:
+
+ {[{ label: "跑通新模块", summary: "在测试环境跑通新模块并验证", scope: "modules/" },
+ { label: "迁移文档", summary: "把 N 份 Notion 文档迁移到 yeye 仓库", scope: "knowledge/" },
+ { label: "写 GLS 标准", summary: "起草一份 GLS 标准草案", scope: "knowledge/gls-foundation/" },
+ { label: "回执补录", summary: "补录历史操作的 HLDP 回执", scope: "receipts/" },
+ ].map((t, i) => (
+
+ ))}
+
+
+
setSummary(e.target.value)} placeholder="一句话描述要做什么" />
+
+
💡 创建后存为本地草稿。接入仓库写入后同步至 yeye/receipts/。
+
+
}
+
+
+ {(["all","draft","executing","completed"] as const).map(f => (
+
+ ))}
+
+
+ {loading &&
加载中...
}
+ {!loading && filtered.length === 0 &&
暂无工单
}
+
+ {filtered.map(o => {
+ const isExpanded = expanded === o.id;
+ const authState = authorizations[o.id] || "pending";
+ const needsAuth = o.status === "draft";
+ return
setExpanded(isExpanded ? null : o.id)}>
+
+
+
{o.summary}
+
{o.id} · {o.operator} · {o.timestamp.split("T")[0]}
+
+
+ {authState !== "pending" && {authState==="approved"?"已批准":"已拒绝"}}
+
+ {o.status==="completed"?"已完成":o.status==="draft"?"草稿":"执行中"}
+
+
+
+
+ {isExpanded &&
+
+ {o.scope.length>0 && <>| 范围 | {o.scope.join(" · ")} | >}
+ | 风险 | {o.risk} |
+ | 来源 | {o.source==="repo"?"yeye仓库 · receipts/":"本地草稿"} |
+ | 时间 | {o.timestamp} |
+
+
+ {needsAuth && authState === "pending" &&
+
🔑 需要授权
+
+ | 授权范围 | {o.scope.length>0 ? o.scope.join(" · ") : "全部"} |
+ | 有效期 | 单次 · 24小时内 |
+ | 风险 | {o.risk} |
+ | 回滚 | git revert |
+ | 执行者 | 小线 · PER-YE-LN-001 |
+
+
e.stopPropagation()}>
+
+
+
+
}
+
+ {needsAuth && authState !== "pending" &&
+ {authState==="approved" ? "✅ 已批准 · 单次执行 · 有效期 24 小时" : "⛔ 已拒绝"}
+
}
+
}
+
+
+ {isExpanded ? "▲ 收起" : "▼ 展开详情"}{o.source==="draft" && " · 本地草稿"}
+
+
;
+ })}
+
+
+ 数据源:yeye 仓库 receipts/ · 本地草稿 localStorage
+
+
;
+}
\ No newline at end of file