From e97f5d969c1ddd858c8480f9daddbfd83f264788 Mon Sep 17 00:00:00 2001 From: yueyang <2495544247@qq.com> Date: Mon, 26 Oct 2026 19:37:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8C=96=E5=BE=85=E5=8A=9E=E9=80=90=E6=9D=A1=E5=90=8E=E6=8F=92?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/systemization-todos.blade.php | 45 +++++++++++++++++-- .../Business/SystemizationTodosTest.php | 13 ++++++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/resources/views/business/pages/systemization-todos.blade.php b/resources/views/business/pages/systemization-todos.blade.php index 9ce1b6d1..7eb418f4 100644 --- a/resources/views/business/pages/systemization-todos.blade.php +++ b/resources/views/business/pages/systemization-todos.blade.php @@ -47,8 +47,13 @@ .sys-todo-table [data-sys-todo-row-edit], .sys-todo-table [data-sys-todo-group-edit] { cursor:pointer; } .sys-todo-table [data-sys-todo-row-edit]:hover, .sys-todo-table [data-sys-todo-group-edit]:hover { background:#fff4cf; } .sys-todo-table [data-sys-todo-row-edit]:focus-visible, .sys-todo-table [data-sys-todo-group-edit]:focus-visible { outline:2px solid var(--sys-gold); outline-offset:-2px; } - .sys-todo-table__index-cell { width:3.6rem; min-width:3.6rem; text-align:center; } + .sys-todo-table__index-cell { width:4.8rem; min-width:4.8rem; text-align:center; } + .sys-todo-table__index-actions { display:inline-flex; align-items:center; justify-content:center; gap:.32rem; } .sys-todo-table__index { color:#6d5630; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; } + .sys-todo-table__insert-after { display:inline-flex; align-items:center; justify-content:center; width:1.45rem; height:1.45rem; padding:0; border:1px solid #d8c9aa; border-radius:999px; background:#fffaf0; color:var(--sys-gold); cursor:pointer; } + .sys-todo-table__insert-after:hover { border-color:var(--sys-gold); background:var(--sys-gold-soft); color:#6a5129; } + .sys-todo-table__insert-after:focus-visible { outline:2px solid var(--sys-gold); outline-offset:2px; } + .sys-todo-table__insert-after .material-icons-outlined { font-size:.95rem; line-height:1; } .sys-todo-table__group { padding-top:.9rem; padding-bottom:.9rem; background:#fcfaf5; font-weight:600; line-height:1.7; vertical-align:middle; } .sys-todo-table__group-content { display:inline-flex; align-items:flex-start; gap:.38rem; min-width:0; } .sys-todo-table__group-text { min-width:0; white-space:pre-line; overflow-wrap:anywhere; } @@ -330,7 +335,7 @@ @endphp
- 共 {{ number_format($items->count()) }} 条,已全部显示。点击待办事项编辑详情;点击类型或内容可单独修改该组名称。 + 共 {{ number_format($items->count()) }} 条,已全部显示。点击序号旁的+可在该条之后插入,原后续序号自动顺延;点击待办事项编辑详情,点击类型或内容可单独修改该组名称。 + + 0) { + var insertPosition = Number(payload.insertPosition); + positionSelect.value = String(Math.min( + Math.max(insertPosition, 1), + Math.max(positionSelect.options.length, 1) + )); } existing.replaceChildren(); @@ -1057,6 +1084,16 @@ }); return; } + var insertAfter = event.target.closest('[data-sys-todo-insert-after]'); + if (insertAfter) { + openDialog({ + category: insertAfter.getAttribute('data-sys-todo-insert-category') || '', + section: insertAfter.getAttribute('data-sys-todo-insert-section') || '', + insertPosition: Number(insertAfter.getAttribute('data-sys-todo-insert-position') || 1), + afterSequence: Number(insertAfter.getAttribute('data-sys-todo-insert-after-sequence') || 0), + }); + return; + } var groupCell = event.target.closest('[data-sys-todo-group-edit]'); if (groupCell) { var groupRow = groupCell.closest('tr'); diff --git a/tests/Feature/Business/SystemizationTodosTest.php b/tests/Feature/Business/SystemizationTodosTest.php index 91461e94..4ddfda9d 100644 --- a/tests/Feature/Business/SystemizationTodosTest.php +++ b/tests/Feature/Business/SystemizationTodosTest.php @@ -43,6 +43,7 @@ class SystemizationTodosTest extends FeatureTestCase ->assertSee('data-sys-todo-section-select', false) ->assertSee('data-sys-todo-new-section-input', false) ->assertSee('data-sys-todo-position', false) + ->assertSee('data-sys-todo-insert-after', false) ->assertSeeText('待办事项序号') ->assertDontSee('name="type_sequence"', false) ->assertDontSee('name="content_sequence"', false) @@ -52,6 +53,7 @@ class SystemizationTodosTest extends FeatureTestCase ->assertDontSee('sys-todo-table__clamp', false) ->assertSeeText('+ 新增类型') ->assertSeeText('+ 新增内容') + ->assertSeeText('点击序号旁的+可在该条之后插入') ->assertSee('data-sys-todo-choose-files', false) ->assertSee('data-sys-todo-open-delete', false) ->assertSee('id="sysTodoDeleteConfirm"', false) @@ -151,6 +153,17 @@ class SystemizationTodosTest extends FeatureTestCase ); } + $initialPage = $this->get(route('business.pages.show', [ + 'section' => 'other', + 'page' => 'systemization-todos', + ]))->assertOk() + ->assertSee('title="在第 3 条后新增一条"', false) + ->assertSee('data-sys-todo-insert-position="4"', false); + $this->assertMatchesRegularExpression( + '/id="sys-todo-row-' . $items[3]->id . '".*?data-sys-todo-insert-position="4"/s', + (string) $initialPage->getContent(), + ); + $this->post(route('business.systemization-todos.store'), [ 'category' => '收入', 'section' => '平台收入核对', -- 2.47.2