PicoBot/.qoder/skills/lark-okr/references/lark-okr-progress-update.md
ooodc a7883dbed9 refactor(todo): 重构待办事项管理逻辑及更新状态规则
- 移除 TodoItem 中的 priority、created_at 和 updated_at 字段
- 强制每个任务都必须有唯一 id,且由用户负责生成
- 修改合并模式逻辑,merge=true 下保留未提及的旧任务
- 支持已完成和已取消任务重新激活(状态改回 pending 或 in_progress)
- 禁止 in_progress 状态退回到 pending,必须标记为 completed 或 cancelled
- 优化状态转换校验,允许特定状态间合法切换
- 简化任务变更消息,移除详细的新增/更新/移除统计
- 更新文档和示例,明确 id 必须由用户生成和使用
- 修复和补充测试,增强状态转换和合并模式验证
- 调整任务时间戳生成逻辑,统一使用当前时间及索引
- 该变更提供更合理的任务状态机械及管理模式,提升稳定性和易用性
2026-06-13 09:22:33 +08:00

82 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# okr +progress-update
> **前置条件:** 先阅读 [`lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
更新指定 ID 的 OKR 进展记录内容。
## 推荐命令
```bash
# 更新进展记录内容
lark-cli okr +progress-update \
--progress-id 1234567890123456789 \
--content '{"blocks":[{"block_element_type":"paragraph","paragraph":{"elements":[{"paragraph_element_type":"textRun","text_run":{"text":"更新后的进展内容"}}]}}]}'
# 更新进展记录内容并同时更新进度
lark-cli okr +progress-update \
--progress-id 1234567890123456789 \
--content '{"blocks":[{"block_element_type":"paragraph","paragraph":{"elements":[{"paragraph_element_type":"textRun","text_run":{"text":"进度已更新至 90%"}}]}}]}' \
--progress-percent 90 \
--progress-status normal
# 从文件读取 content适用于较长的进展内容
lark-cli okr +progress-update \
--progress-id 1234567890123456789 \
--content @updated_progress.json
# 预览 API 调用而不实际执行
lark-cli okr +progress-update \
--progress-id 1234567890123456789 \
--content '{"blocks":[{"block_element_type":"paragraph","paragraph":{"elements":[{"paragraph_element_type":"textRun","text_run":{"text":"test"}}]}}]}' \
--dry-run
```
## 参数
| 参数 | 必填 | 默认值 | 说明 |
|----------------------|----|-----------|----------------------------------------------------------------------------------------------------------------|
| `--progress-id` | 是 | — | 进展记录 IDint64 类型,正整数) |
| `--content` | 是 | — | 进展内容ContentBlock JSON 格式。支持 `@文件路径` 从文件读取。请参考 [ContentBlock 格式](lark-okr-contentblock.md)。 |
| `--progress-percent` | 否 | — | 进度百分比(-99999999999 - 99999999999)。百分比的取值通常在 0-100但允许超过此范围以表示超额完成或负增长等情况。挂载的目标或关键结果的量化指标不使用百分比单位时以这个字段更新当前值。系统内最多保留两位小数 |
| `--progress-status` | 否 | — | 进度状态:`normal`(正常) \| `overdue`(逾期) \| `done`(已完成)。仅在指定 `--progress-percent` 时生效。 |
| `--user-id-type` | 否 | `open_id` | 用户 ID 类型:`open_id` \| `union_id` \| `user_id` |
| `--dry-run` | 否 | — | 预览 API 调用而不实际执行。 |
| `--format` | 否 | `json` | 输出格式。 |
## 工作流程
1. 使用 `+progress-get` 获取要更新的进展记录的 ID 和当前内容。
2. 修改 ContentBlock JSON 格式的进展内容。请参考 [ContentBlock 格式](lark-okr-contentblock.md)。
3. 执行 `lark-cli okr +progress-update --progress-id "..." --content "..."`
4. 报告结果:更新后的进展记录 ID、修改时间、进度百分比等。
## 输出
返回 JSON
```json
{
"progress": {
"progress_id": "1234567890123456789",
"modify_time": "2025-01-15 14:30:00",
"content": "{...}",
"progress_rate": {
"percent": 90.0,
"status": "normal"
}
}
}
```
其中:
- `content` 字段是 JSON 字符串,为 OKR ContentBlock
富文本格式。请参考 [lark-okr-contentblock.md](lark-okr-contentblock.md) 了解详细信息。
- `progress_rate.status` 返回可读字符串:`normal`(正常)、`overdue`(逾期)、`done`(已完成)。
## 参考
- [lark-okr](../SKILL.md) -- 所有 OKR 命令(shortcut 和 API 接口)
- [ContentBlock 格式](lark-okr-contentblock.md) -- 进展内容使用的富文本格式
- [lark-shared](../../lark-shared/SKILL.md) -- 认证和全局参数