diff --git a/app/Http/Controllers/Business/SystemizationTodos.php b/app/Http/Controllers/Business/SystemizationTodos.php index f017371b..b486001c 100644 --- a/app/Http/Controllers/Business/SystemizationTodos.php +++ b/app/Http/Controllers/Business/SystemizationTodos.php @@ -811,7 +811,10 @@ class SystemizationTodos extends Controller ->whereNotNull($column) ->where($column, '<>', '') ->pluck($column) - ->flatMap(static fn (string $value): array => array_map('trim', preg_split('/[、,,]/u', $value) ?: [])) + ->flatMap(static fn (string $value): array => array_map( + 'trim', + preg_split('/[、,,;;\/]+/u', $value) ?: [], + )) ->filter() ->unique() ->sort() diff --git a/resources/views/business/pages/systemization-todos.blade.php b/resources/views/business/pages/systemization-todos.blade.php index 62c78627..f21d55a3 100644 --- a/resources/views/business/pages/systemization-todos.blade.php +++ b/resources/views/business/pages/systemization-todos.blade.php @@ -379,7 +379,7 @@
- + 重置
@@ -1231,7 +1231,7 @@ function splitPeople(value) { return String(value || '') - .split(/[、,,]/) + .split(/[、,,;;\/]+/) .map(function (person) { return person.trim(); }) .filter(Boolean); } diff --git a/tests/Feature/Business/SystemizationTodosTest.php b/tests/Feature/Business/SystemizationTodosTest.php index 3ed0d301..ea692c5e 100644 --- a/tests/Feature/Business/SystemizationTodosTest.php +++ b/tests/Feature/Business/SystemizationTodosTest.php @@ -36,6 +36,7 @@ class SystemizationTodosTest extends FeatureTestCase ->assertSeeText('待定') ->assertSee('name="reminder"', false) ->assertSeeText('全部提醒') + ->assertSee('>查询', false) ->assertSeeText('完成情况 / 备注') ->assertSeeText('提醒') ->assertSee('data-sys-todo-default-start-date', false) @@ -257,6 +258,32 @@ class SystemizationTodosTest extends FeatureTestCase ); } + public function test_people_filter_splits_slash_separated_names(): void + { + $this->loginAs(); + + $this->createTodo( + '收入', + '筛选责任人拆分', + '核对斜杠分隔的多人姓名', + '2026-11-30', + 1, + '人参 / 周生辰', + '人参 / 周生辰', + ); + + $content = $this->get(route('business.pages.show', [ + 'section' => 'other', + 'page' => 'systemization-todos', + ]))->assertOk()->viewData('content'); + + foreach (['todoOwners', 'todoAssignees'] as $key) { + $this->assertContains('人参', $content[$key]); + $this->assertContains('周生辰', $content[$key]); + $this->assertNotContains('人参 / 周生辰', $content[$key]); + } + } + public function test_can_insert_a_todo_at_a_selected_sequence_and_shift_existing_items(): void { $this->loginAs();