diff --git a/index.php b/index.php index 16c6845..f559c26 100644 --- a/index.php +++ b/index.php @@ -8111,7 +8111,12 @@ $want = array_keys($want); $warns = attach_save_files($familyId, Note::ATTACH, $id, 'file', $me); flash($warns ? 'err' : 'ok', $warns ? '有附件没有保存:' . implode(';', $warns) : '附件已上传。'); - redirect('notes/form', ['id' => $id]); + /* 🔴 工单 #21:回**编辑态**(`edit=1`),不是阅读态。 + `notes/form` 的 `$editMode = $id <= 0 || !empty($_GET['edit'])` ⇒ + 原来这里不带 edit 参数,id>0 就落到阅读态,附件区(在 $editMode 分支里) + 根本不渲染。用户上传完看到的是"附件没传上"——体感就是功能坏了, + 实际只是跳错了态。 */ + redirect('notes/form', ['id' => $id, 'edit' => 1]); break; case 'notes/attach_del': @@ -8134,7 +8139,10 @@ $want = array_keys($want); } \App\Attachment::remove($aid); flash('ok', '附件已删除。'); - redirect('notes/form', ['id' => $nid]); + /* 🔴 工单 #21:删完同样回**编辑态** —— 与 attach_add 保持一致的道理: + 回阅读态的话,用户点「✕」删掉一个,跳转后看不见附件列表, + 不知道删成功了没有,也找不到继续删/继续传的入口。 */ + redirect('notes/form', ['id' => $nid, 'edit' => 1]); break; /* 段落 Markdown 的**实时预览**(v28 用户第 12 条:"允许所见即所得编辑")。 diff --git a/templates/notes/form.php b/templates/notes/form.php index 4aff1db..97faf2a 100644 --- a/templates/notes/form.php +++ b/templates/notes/form.php @@ -408,10 +408,40 @@ $imgParts = static function (string $c): array {