fix(V0.2): BUILD_ID 时区 / 新建弹框残留 / 项目信息块
Docker Build and Push / build-image (push) Successful in 4m19s

1. BUILD_ID 改用 UTC+8 生成: CI runner 是 UTC 时区, 原来取本地时间会错位;
   统一偏移 +8h 后按 UTC 读取 (vite.config.js makeBuildId)

2. 修复「我的项目」页反复弹新建框: createSignal 一次性消费,
   ProjectList 处理后回调清零 (此前 TaskPage 状态在 /task 与 /task/list
   间保留, 信号残留导致每次进入都触发)

3. 新增项目信息块 (T-PJ-13):
   - Project.notes Json ([{title,content}], <=50 块 / 标题<=50 字 / 内容<=20000 字)
   - 迁移 20261024130000: 加列(NULL)->回填'[]'->收紧 NOT NULL, 存量行安全
   - GET 详情返回 notes; PUT 接受 notes 整体替换
   - 项目管理新增「信息块」分区: 列表预览 + 底部弹层独立编辑(标题+多行
     textarea+删除), 键盘弹出复用 useKeyboardInset 抬升
   - 文档: 需求 T-PJ-13 (149 条) + 功能设计对应行

已验证: 109 文件语法 0 错误、文档 149/149 覆盖
This commit is contained in:
jif2.zhang
2026-10-24 21:37:05 +08:00
parent 1fd7522fa6
commit b71ceca3f2
9 changed files with 189 additions and 54 deletions
+11 -2
View File
@@ -107,18 +107,19 @@ router.get('/:id', async (req, res, next) => {
...projectSummary(project),
members: members.map((m) => ({ userId: m.userId, name: m.user.name, email: m.user.email, permission: m.permission })),
columns,
notes: Array.isArray(project.notes) ? project.notes : [],
},
})
} catch (e) { next(e) }
})
// PUT /api/projects/:id { name?, archived? }
// PUT /api/projects/:id { name?, archived?, notes? }
router.put('/:id', async (req, res, next) => {
try {
const userId = req.user.sub
const project = await loadProjectForUser(req.params.id, userId)
if (!project) return res.status(404).json({ error: '项目不存在或无权限' })
const { name, archived } = req.body || {}
const { name, archived, notes } = req.body || {}
const data = {}
if (name !== undefined) {
const t = String(name).trim()
@@ -127,6 +128,14 @@ router.put('/:id', async (req, res, next) => {
data.name = t
}
if (archived !== undefined) data.archived = !!archived
// 项目信息块 (T-PJ-13): 任意多个 { title, content }, 整体替换
if (notes !== undefined) {
if (!Array.isArray(notes)) return res.status(400).json({ error: '信息块格式非法' })
data.notes = notes.slice(0, 50).map((n) => ({
title: String(n?.title ?? '').slice(0, 50),
content: String(n?.content ?? '').slice(0, 20000),
}))
}
const row = await prisma.project.update({ where: { id: project.id }, data })
res.json({ item: projectSummary(row) })
} catch (e) { next(e) }