diff --git a/.gitignore b/.gitignore index af9f6fa..5be44a4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ dist/ test-results/ playwright-report/ .playwright/ + +# e2e 测试重跑产物(截图/中间件),不入库 +e2e/artifacts/ diff --git a/e2e/artifacts/f2-11/drawer-after-readall.png b/e2e/artifacts/f2-11/drawer-after-readall.png deleted file mode 100644 index d76b7ee..0000000 Binary files a/e2e/artifacts/f2-11/drawer-after-readall.png and /dev/null differ diff --git a/e2e/artifacts/f2-11/topbar-notice-drawer.png b/e2e/artifacts/f2-11/topbar-notice-drawer.png deleted file mode 100644 index 5d6e1fd..0000000 Binary files a/e2e/artifacts/f2-11/topbar-notice-drawer.png and /dev/null differ diff --git a/e2e/artifacts/f2-11/workbench-notice-card.png b/e2e/artifacts/f2-11/workbench-notice-card.png deleted file mode 100644 index 1cf2918..0000000 Binary files a/e2e/artifacts/f2-11/workbench-notice-card.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/01-workbench.png b/e2e/artifacts/f2-12/01-workbench.png deleted file mode 100644 index 2325856..0000000 Binary files a/e2e/artifacts/f2-12/01-workbench.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/02-todo.png b/e2e/artifacts/f2-12/02-todo.png deleted file mode 100644 index a1e9768..0000000 Binary files a/e2e/artifacts/f2-12/02-todo.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/03-sys-user-list.png b/e2e/artifacts/f2-12/03-sys-user-list.png deleted file mode 100644 index 7ecae20..0000000 Binary files a/e2e/artifacts/f2-12/03-sys-user-list.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/04-sys-role.png b/e2e/artifacts/f2-12/04-sys-role.png deleted file mode 100644 index 705f13b..0000000 Binary files a/e2e/artifacts/f2-12/04-sys-role.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/05-sys-user-dark.png b/e2e/artifacts/f2-12/05-sys-user-dark.png deleted file mode 100644 index 2dd73cb..0000000 Binary files a/e2e/artifacts/f2-12/05-sys-user-dark.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/06-notice-drawer.png b/e2e/artifacts/f2-12/06-notice-drawer.png deleted file mode 100644 index 67af588..0000000 Binary files a/e2e/artifacts/f2-12/06-notice-drawer.png and /dev/null differ diff --git a/e2e/artifacts/f2-12/07-todo-page.png b/e2e/artifacts/f2-12/07-todo-page.png deleted file mode 100644 index 833c2c7..0000000 Binary files a/e2e/artifacts/f2-12/07-todo-page.png and /dev/null differ diff --git a/e2e/artifacts/f2-13/type1-00551ef5-title.png b/e2e/artifacts/f2-13/type1-00551ef5-title.png deleted file mode 100644 index 7269928..0000000 Binary files a/e2e/artifacts/f2-13/type1-00551ef5-title.png and /dev/null differ diff --git a/e2e/artifacts/f2-13/type200-03ec5566-data.png b/e2e/artifacts/f2-13/type200-03ec5566-data.png deleted file mode 100644 index af316ed..0000000 Binary files a/e2e/artifacts/f2-13/type200-03ec5566-data.png and /dev/null differ diff --git a/e2e/artifacts/f2-16/notify-manage-full.png b/e2e/artifacts/f2-16/notify-manage-full.png deleted file mode 100644 index 7eb5f78..0000000 Binary files a/e2e/artifacts/f2-16/notify-manage-full.png and /dev/null differ diff --git a/e2e/artifacts/f2-16/notify-manage-table.png b/e2e/artifacts/f2-16/notify-manage-table.png deleted file mode 100644 index 1c34bfa..0000000 Binary files a/e2e/artifacts/f2-16/notify-manage-table.png and /dev/null differ diff --git a/e2e/artifacts/f2-5/01-todo-list.png b/e2e/artifacts/f2-5/01-todo-list.png deleted file mode 100644 index 07ac62c..0000000 Binary files a/e2e/artifacts/f2-5/01-todo-list.png and /dev/null differ diff --git a/e2e/artifacts/f2-5/02-approval-bar-skip.png b/e2e/artifacts/f2-5/02-approval-bar-skip.png deleted file mode 100644 index 07ac62c..0000000 Binary files a/e2e/artifacts/f2-5/02-approval-bar-skip.png and /dev/null differ diff --git a/e2e/artifacts/f2-5/03-todo-after-complete.png b/e2e/artifacts/f2-5/03-todo-after-complete.png deleted file mode 100644 index 07ac62c..0000000 Binary files a/e2e/artifacts/f2-5/03-todo-after-complete.png and /dev/null differ diff --git a/e2e/artifacts/f2-5/04-done-list.png b/e2e/artifacts/f2-5/04-done-list.png deleted file mode 100644 index 0f85bb4..0000000 Binary files a/e2e/artifacts/f2-5/04-done-list.png and /dev/null differ diff --git a/e2e/artifacts/f2-8/f2-8-1-form-initial.png b/e2e/artifacts/f2-8/f2-8-1-form-initial.png deleted file mode 100644 index 6c3f866..0000000 Binary files a/e2e/artifacts/f2-8/f2-8-1-form-initial.png and /dev/null differ diff --git a/e2e/artifacts/f2-8/f2-8-1-form-success-toast.png b/e2e/artifacts/f2-8/f2-8-1-form-success-toast.png deleted file mode 100644 index cd30bc6..0000000 Binary files a/e2e/artifacts/f2-8/f2-8-1-form-success-toast.png and /dev/null differ diff --git a/e2e/artifacts/f2-8/f2-8-2-server-validation-error.png b/e2e/artifacts/f2-8/f2-8-2-server-validation-error.png deleted file mode 100644 index 0b89309..0000000 Binary files a/e2e/artifacts/f2-8/f2-8-2-server-validation-error.png and /dev/null differ diff --git a/e2e/artifacts/f2-8/f2-8-2-validation-error.png b/e2e/artifacts/f2-8/f2-8-2-validation-error.png deleted file mode 100644 index d71a8a4..0000000 Binary files a/e2e/artifacts/f2-8/f2-8-2-validation-error.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/01-list-picker-loaded.png b/e2e/artifacts/f2-9/01-list-picker-loaded.png deleted file mode 100644 index 381bd02..0000000 Binary files a/e2e/artifacts/f2-9/01-list-picker-loaded.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/02-list-picker-dropdown.png b/e2e/artifacts/f2-9/02-list-picker-dropdown.png deleted file mode 100644 index a5241c5..0000000 Binary files a/e2e/artifacts/f2-9/02-list-picker-dropdown.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/03-list-picker-options.png b/e2e/artifacts/f2-9/03-list-picker-options.png deleted file mode 100644 index 4514a46..0000000 Binary files a/e2e/artifacts/f2-9/03-list-picker-options.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/03-list-picker-selected.png b/e2e/artifacts/f2-9/03-list-picker-selected.png deleted file mode 100644 index 35a81d7..0000000 Binary files a/e2e/artifacts/f2-9/03-list-picker-selected.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/04-tree-picker-loaded.png b/e2e/artifacts/f2-9/04-tree-picker-loaded.png deleted file mode 100644 index 11af46c..0000000 Binary files a/e2e/artifacts/f2-9/04-tree-picker-loaded.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/05-tree-picker-alternative.png b/e2e/artifacts/f2-9/05-tree-picker-alternative.png deleted file mode 100644 index 11af46c..0000000 Binary files a/e2e/artifacts/f2-9/05-tree-picker-alternative.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/07-tree-picker-final.png b/e2e/artifacts/f2-9/07-tree-picker-final.png deleted file mode 100644 index 11af46c..0000000 Binary files a/e2e/artifacts/f2-9/07-tree-picker-final.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/08-multi-picker-loaded.png b/e2e/artifacts/f2-9/08-multi-picker-loaded.png deleted file mode 100644 index cb905f6..0000000 Binary files a/e2e/artifacts/f2-9/08-multi-picker-loaded.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/09-multi-picker-dropdown.png b/e2e/artifacts/f2-9/09-multi-picker-dropdown.png deleted file mode 100644 index 3513a3f..0000000 Binary files a/e2e/artifacts/f2-9/09-multi-picker-dropdown.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/10-multi-picker-selected.png b/e2e/artifacts/f2-9/10-multi-picker-selected.png deleted file mode 100644 index 8bb8acc..0000000 Binary files a/e2e/artifacts/f2-9/10-multi-picker-selected.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/11-multi-picker-final.png b/e2e/artifacts/f2-9/11-multi-picker-final.png deleted file mode 100644 index 8bb8acc..0000000 Binary files a/e2e/artifacts/f2-9/11-multi-picker-final.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/12-onevent-form-loaded.png b/e2e/artifacts/f2-9/12-onevent-form-loaded.png deleted file mode 100644 index 94b7fad..0000000 Binary files a/e2e/artifacts/f2-9/12-onevent-form-loaded.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/13-onevent-dropdown.png b/e2e/artifacts/f2-9/13-onevent-dropdown.png deleted file mode 100644 index bcc5419..0000000 Binary files a/e2e/artifacts/f2-9/13-onevent-dropdown.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/13-onevent-no-options.png b/e2e/artifacts/f2-9/13-onevent-no-options.png deleted file mode 100644 index bcc5419..0000000 Binary files a/e2e/artifacts/f2-9/13-onevent-no-options.png and /dev/null differ diff --git a/e2e/artifacts/f2-9/15-onevent-final.png b/e2e/artifacts/f2-9/15-onevent-final.png deleted file mode 100644 index bcc5419..0000000 Binary files a/e2e/artifacts/f2-9/15-onevent-final.png and /dev/null differ diff --git a/e2e/artifacts/f3-1/type200-3eedc061-3220-4b98-8965-af97a8bbe4c9.png b/e2e/artifacts/f3-1/type200-3eedc061-3220-4b98-8965-af97a8bbe4c9.png deleted file mode 100644 index f771dee..0000000 Binary files a/e2e/artifacts/f3-1/type200-3eedc061-3220-4b98-8965-af97a8bbe4c9.png and /dev/null differ diff --git a/e2e/artifacts/f3-1/type200-4d9d1ab0-d42b-4ffd-9d62-752931bc8848.png b/e2e/artifacts/f3-1/type200-4d9d1ab0-d42b-4ffd-9d62-752931bc8848.png deleted file mode 100644 index 52fd85d..0000000 Binary files a/e2e/artifacts/f3-1/type200-4d9d1ab0-d42b-4ffd-9d62-752931bc8848.png and /dev/null differ diff --git a/e2e/artifacts/f3-1/type200-7dc60c88-220b-4046-98fe-bfdae499786f.png b/e2e/artifacts/f3-1/type200-7dc60c88-220b-4046-98fe-bfdae499786f.png deleted file mode 100644 index aeccccc..0000000 Binary files a/e2e/artifacts/f3-1/type200-7dc60c88-220b-4046-98fe-bfdae499786f.png and /dev/null differ diff --git a/e2e/artifacts/f3-1/type200-b9546a6b-1ea5-4389-af34-32922bd3c3b5.png b/e2e/artifacts/f3-1/type200-b9546a6b-1ea5-4389-af34-32922bd3c3b5.png deleted file mode 100644 index 7ff646b..0000000 Binary files a/e2e/artifacts/f3-1/type200-b9546a6b-1ea5-4389-af34-32922bd3c3b5.png and /dev/null differ diff --git a/e2e/artifacts/f3-1/type200-d9cd0b65-1926-4d27-afef-df7138329ca3.png b/e2e/artifacts/f3-1/type200-d9cd0b65-1926-4d27-afef-df7138329ca3.png deleted file mode 100644 index f3b0ae9..0000000 Binary files a/e2e/artifacts/f3-1/type200-d9cd0b65-1926-4d27-afef-df7138329ca3.png and /dev/null differ diff --git a/e2e/artifacts/f4-l1/01-designer-canvas.png b/e2e/artifacts/f4-l1/01-designer-canvas.png deleted file mode 100644 index 6081dee..0000000 Binary files a/e2e/artifacts/f4-l1/01-designer-canvas.png and /dev/null differ diff --git a/e2e/artifacts/f4-l1/02-designer-restore-toast.png b/e2e/artifacts/f4-l1/02-designer-restore-toast.png deleted file mode 100644 index 90eee67..0000000 Binary files a/e2e/artifacts/f4-l1/02-designer-restore-toast.png and /dev/null differ diff --git a/e2e/artifacts/f4-l1/03-render-standard-after-restore.png b/e2e/artifacts/f4-l1/03-render-standard-after-restore.png deleted file mode 100644 index 0db6f62..0000000 Binary files a/e2e/artifacts/f4-l1/03-render-standard-after-restore.png and /dev/null differ diff --git a/e2e/artifacts/f4-l1/04-designer-save-toast.png b/e2e/artifacts/f4-l1/04-designer-save-toast.png deleted file mode 100644 index 8423656..0000000 Binary files a/e2e/artifacts/f4-l1/04-designer-save-toast.png and /dev/null differ diff --git a/e2e/artifacts/type1-00551ef5-1c76-4015-bec9-2e1c8b631deb.png b/e2e/artifacts/type1-00551ef5-1c76-4015-bec9-2e1c8b631deb.png deleted file mode 100644 index 71f9f67..0000000 Binary files a/e2e/artifacts/type1-00551ef5-1c76-4015-bec9-2e1c8b631deb.png and /dev/null differ diff --git a/e2e/artifacts/type1-009c4f52-636a-4688-8148-75cabe83fd83.png b/e2e/artifacts/type1-009c4f52-636a-4688-8148-75cabe83fd83.png deleted file mode 100644 index 557d21e..0000000 Binary files a/e2e/artifacts/type1-009c4f52-636a-4688-8148-75cabe83fd83.png and /dev/null differ diff --git a/e2e/artifacts/type1-00e7a83b-dd1f-4d7a-a574-bc362bc785d2.png b/e2e/artifacts/type1-00e7a83b-dd1f-4d7a-a574-bc362bc785d2.png deleted file mode 100644 index ed0b93c..0000000 Binary files a/e2e/artifacts/type1-00e7a83b-dd1f-4d7a-a574-bc362bc785d2.png and /dev/null differ diff --git a/e2e/artifacts/type100-00ff3f9d-b744-4e55-a731-f98d16d6f7fe.png b/e2e/artifacts/type100-00ff3f9d-b744-4e55-a731-f98d16d6f7fe.png deleted file mode 100644 index 5675dc0..0000000 Binary files a/e2e/artifacts/type100-00ff3f9d-b744-4e55-a731-f98d16d6f7fe.png and /dev/null differ diff --git a/e2e/artifacts/type100-06a1d7d2-a202-4b8f-aef3-2e25e3db0ed7.png b/e2e/artifacts/type100-06a1d7d2-a202-4b8f-aef3-2e25e3db0ed7.png deleted file mode 100644 index 21ad6c4..0000000 Binary files a/e2e/artifacts/type100-06a1d7d2-a202-4b8f-aef3-2e25e3db0ed7.png and /dev/null differ diff --git a/e2e/artifacts/type100-06fe97fa-6ebe-41e7-9f88-c6a635c1887e.png b/e2e/artifacts/type100-06fe97fa-6ebe-41e7-9f88-c6a635c1887e.png deleted file mode 100644 index d50d779..0000000 Binary files a/e2e/artifacts/type100-06fe97fa-6ebe-41e7-9f88-c6a635c1887e.png and /dev/null differ diff --git a/e2e/artifacts/type101-138b7ca7-befb-4a0c-bfc6-ed8fb4d4e434.png b/e2e/artifacts/type101-138b7ca7-befb-4a0c-bfc6-ed8fb4d4e434.png deleted file mode 100644 index 924fcfe..0000000 Binary files a/e2e/artifacts/type101-138b7ca7-befb-4a0c-bfc6-ed8fb4d4e434.png and /dev/null differ diff --git a/e2e/artifacts/type101-42861f01-14ea-482d-8031-f30612dfccf4.png b/e2e/artifacts/type101-42861f01-14ea-482d-8031-f30612dfccf4.png deleted file mode 100644 index 17f62ae..0000000 Binary files a/e2e/artifacts/type101-42861f01-14ea-482d-8031-f30612dfccf4.png and /dev/null differ diff --git a/e2e/artifacts/type101-43d2e233-08cf-4019-850e-5c2c073d1f76.png b/e2e/artifacts/type101-43d2e233-08cf-4019-850e-5c2c073d1f76.png deleted file mode 100644 index d3fd93a..0000000 Binary files a/e2e/artifacts/type101-43d2e233-08cf-4019-850e-5c2c073d1f76.png and /dev/null differ diff --git a/e2e/artifacts/type200-00654052-f899-45d6-bbd4-04457c13025a.png b/e2e/artifacts/type200-00654052-f899-45d6-bbd4-04457c13025a.png deleted file mode 100644 index af05c7f..0000000 Binary files a/e2e/artifacts/type200-00654052-f899-45d6-bbd4-04457c13025a.png and /dev/null differ diff --git a/e2e/artifacts/type200-03ec5566-7d99-4eba-85ce-31e25f5e48ab.png b/e2e/artifacts/type200-03ec5566-7d99-4eba-85ce-31e25f5e48ab.png deleted file mode 100644 index 47e7ed6..0000000 Binary files a/e2e/artifacts/type200-03ec5566-7d99-4eba-85ce-31e25f5e48ab.png and /dev/null differ diff --git a/e2e/artifacts/type200-063fdf2a-3032-4220-9974-32f0a5932aa6.png b/e2e/artifacts/type200-063fdf2a-3032-4220-9974-32f0a5932aa6.png deleted file mode 100644 index 65c1db2..0000000 Binary files a/e2e/artifacts/type200-063fdf2a-3032-4220-9974-32f0a5932aa6.png and /dev/null differ diff --git a/e2e/artifacts/type3-0211a0e2-2073-4b24-b59f-e6757e5dcff0.png b/e2e/artifacts/type3-0211a0e2-2073-4b24-b59f-e6757e5dcff0.png deleted file mode 100644 index d27ee05..0000000 Binary files a/e2e/artifacts/type3-0211a0e2-2073-4b24-b59f-e6757e5dcff0.png and /dev/null differ diff --git a/e2e/artifacts/type3-0246d4bd-232b-465d-9265-8c1fc1ecbdf2.png b/e2e/artifacts/type3-0246d4bd-232b-465d-9265-8c1fc1ecbdf2.png deleted file mode 100644 index d1c0611..0000000 Binary files a/e2e/artifacts/type3-0246d4bd-232b-465d-9265-8c1fc1ecbdf2.png and /dev/null differ diff --git a/e2e/artifacts/type3-082f27b4-7ae9-4b21-acc9-2b2a6f7d9797.png b/e2e/artifacts/type3-082f27b4-7ae9-4b21-acc9-2b2a6f7d9797.png deleted file mode 100644 index 68fd10b..0000000 Binary files a/e2e/artifacts/type3-082f27b4-7ae9-4b21-acc9-2b2a6f7d9797.png and /dev/null differ diff --git a/e2e/artifacts/type4-19e418d1-ea62-47c1-9fb4-c33f94c306c4.png b/e2e/artifacts/type4-19e418d1-ea62-47c1-9fb4-c33f94c306c4.png deleted file mode 100644 index 8bd4ebe..0000000 Binary files a/e2e/artifacts/type4-19e418d1-ea62-47c1-9fb4-c33f94c306c4.png and /dev/null differ diff --git a/e2e/artifacts/type4-1b7af860-f11d-4b64-931c-13264207d57c.png b/e2e/artifacts/type4-1b7af860-f11d-4b64-931c-13264207d57c.png deleted file mode 100644 index 1cefb1e..0000000 Binary files a/e2e/artifacts/type4-1b7af860-f11d-4b64-931c-13264207d57c.png and /dev/null differ diff --git a/e2e/artifacts/type4-21d82b1c-1db0-499a-b2c7-48befd42a9d7.png b/e2e/artifacts/type4-21d82b1c-1db0-499a-b2c7-48befd42a9d7.png deleted file mode 100644 index d83e053..0000000 Binary files a/e2e/artifacts/type4-21d82b1c-1db0-499a-b2c7-48befd42a9d7.png and /dev/null differ diff --git a/e2e/artifacts/type5-062041e3-0862-49b1-a304-34c873ac5b9e.png b/e2e/artifacts/type5-062041e3-0862-49b1-a304-34c873ac5b9e.png deleted file mode 100644 index b74e42d..0000000 Binary files a/e2e/artifacts/type5-062041e3-0862-49b1-a304-34c873ac5b9e.png and /dev/null differ diff --git a/e2e/artifacts/type5-f4446608-68e3-40f3-8546-2511de73fbdc.png b/e2e/artifacts/type5-f4446608-68e3-40f3-8546-2511de73fbdc.png deleted file mode 100644 index dd44598..0000000 Binary files a/e2e/artifacts/type5-f4446608-68e3-40f3-8546-2511de73fbdc.png and /dev/null differ diff --git a/e2e/artifacts/type6-05226af5-5c77-470f-b039-d894fc55714d.png b/e2e/artifacts/type6-05226af5-5c77-470f-b039-d894fc55714d.png deleted file mode 100644 index 383f338..0000000 Binary files a/e2e/artifacts/type6-05226af5-5c77-470f-b039-d894fc55714d.png and /dev/null differ diff --git a/e2e/artifacts/type6-08158341-1b41-48be-9226-90a206960e8f.png b/e2e/artifacts/type6-08158341-1b41-48be-9226-90a206960e8f.png deleted file mode 100644 index fdce99e..0000000 Binary files a/e2e/artifacts/type6-08158341-1b41-48be-9226-90a206960e8f.png and /dev/null differ diff --git a/e2e/artifacts/type6-1d9e666d-8923-4d9a-8644-05ba3fa533aa.png b/e2e/artifacts/type6-1d9e666d-8923-4d9a-8644-05ba3fa533aa.png deleted file mode 100644 index 3f2d5b0..0000000 Binary files a/e2e/artifacts/type6-1d9e666d-8923-4d9a-8644-05ba3fa533aa.png and /dev/null differ diff --git a/e2e/artifacts/type7-00511ac1-ee64-4ecd-a550-22842ee5be72.png b/e2e/artifacts/type7-00511ac1-ee64-4ecd-a550-22842ee5be72.png deleted file mode 100644 index db23f61..0000000 Binary files a/e2e/artifacts/type7-00511ac1-ee64-4ecd-a550-22842ee5be72.png and /dev/null differ diff --git a/e2e/artifacts/type7-00a64619-0014-412f-8ca9-95edcf988c2f.png b/e2e/artifacts/type7-00a64619-0014-412f-8ca9-95edcf988c2f.png deleted file mode 100644 index e087a71..0000000 Binary files a/e2e/artifacts/type7-00a64619-0014-412f-8ca9-95edcf988c2f.png and /dev/null differ diff --git a/e2e/artifacts/type7-0267be11-591a-4533-b7cc-079cef81086e.png b/e2e/artifacts/type7-0267be11-591a-4533-b7cc-079cef81086e.png deleted file mode 100644 index df2bd8a..0000000 Binary files a/e2e/artifacts/type7-0267be11-591a-4533-b7cc-079cef81086e.png and /dev/null differ diff --git a/src/api/approval.ts b/src/api/approval.ts index 0cca59c..0e38620 100644 --- a/src/api/approval.ts +++ b/src/api/approval.ts @@ -51,3 +51,63 @@ export async function fetchTrace(processInstanceId: string): Promise { + const { data } = await http.get(`/api/task/${taskId}/approval-meta`); + return data; +} + +export async function submitApprovalAction( + taskId: string, + req: ApprovalActionRequest, +): Promise> { + const { data } = await http.post>(`/api/task/${taskId}/action`, req); + return data; +} diff --git a/src/components/ApprovalBar.tsx b/src/components/ApprovalBar.tsx deleted file mode 100644 index a6feb23..0000000 --- a/src/components/ApprovalBar.tsx +++ /dev/null @@ -1,309 +0,0 @@ -// ApprovalBar —— 办理动作条(同意/驳回/转办 + 审批意见 + 流程轨迹抽屉) -// 布局参照原型 ApprovalDetail 操作条:底部固定条,意见输入区+三按钮+轨迹入口 -import { useState } from 'react'; -import { Drawer } from './ui/Dialog'; -import { toast } from './ui/Toast'; -import { completeTask, delegateTask, fetchTrace } from '../api/approval'; -import type { TraceNode } from '../api/approval'; - -export interface ApprovalBarProps { - taskId: string; - processInstanceId?: string; - businessKey?: string; - tableName?: string; - /** 办理成功后回调(刷新待办列表/铃铛) */ - onCompleted?: () => void; -} - -// --------------------------------------------------------------------------- -// 流程轨迹时间线 -// --------------------------------------------------------------------------- -function TraceTimeline({ nodes }: { nodes: TraceNode[] }) { - if (nodes.length === 0) { - return ( -
- 暂无轨迹记录 -
- ); - } - return ( -
- {nodes.map((node, idx) => { - const isLast = idx === nodes.length - 1; - const resultMap: Record = { - agree: { text: '同意', color: 'var(--ok)' }, - approved: { text: '同意', color: 'var(--ok)' }, - reject: { text: '驳回', color: 'var(--err)' }, - rejected: { text: '驳回', color: 'var(--err)' }, - transfer: { text: '转办', color: 'var(--warn)' }, - complete: { text: '完成', color: 'var(--ok)' }, - }; - const res = node.result ? (resultMap[node.result.toLowerCase()] ?? { text: node.result, color: 'var(--text-2)' }) : null; - const dotColor = node.current ? 'var(--brand)' : node.endTime ? 'var(--ok)' : 'var(--text-3)'; - - return ( -
- {/* 时间线竖线 + 圆点 */} -
-
- {!isLast && ( -
- )} -
- - {/* 节点内容 */} -
-
- - {node.taskName || '(未命名节点)'} - - {node.current && ( - 当前 - )} - {res && ( - {res.text} - )} -
-
- {node.assigneeName || node.assignee || '—'} - {node.startTime && ( - - {new Date(node.startTime).toLocaleString('zh-CN', { hour12: false }).slice(0, 16)} - - )} -
- {node.comment && ( -
- {node.comment} -
- )} -
-
- ); - })} -
- ); -} - -// --------------------------------------------------------------------------- -// 转办弹窗内容 -// --------------------------------------------------------------------------- -function DelegateForm({ - taskId, - onSuccess, - onCancel, -}: { - taskId: string; - onSuccess: () => void; - onCancel: () => void; -}) { - const [userId, setUserId] = useState(''); - const [submitting, setSubmitting] = useState(false); - - const submit = async () => { - if (!userId.trim()) { - toast('请输入转办人账号', 'warn'); - return; - } - setSubmitting(true); - try { - await delegateTask(taskId, { delegateUserId: userId.trim() }); - toast('转办成功'); - onSuccess(); - } catch { - toast('转办失败,请重试', 'err'); - } finally { - setSubmitting(false); - } - }; - - return ( -
- - setUserId(e.target.value)} - autoFocus - /> -
- - -
-
- ); -} - -// --------------------------------------------------------------------------- -// 主组件:ApprovalBar -// --------------------------------------------------------------------------- -export function ApprovalBar({ - taskId, - processInstanceId, - businessKey, - tableName, - onCompleted, -}: ApprovalBarProps) { - const [comment, setComment] = useState(''); - const [submitting, setSubmitting] = useState(false); - const [showTrace, setShowTrace] = useState(false); - const [showDelegate, setShowDelegate] = useState(false); - const [traceNodes, setTraceNodes] = useState([]); - const [traceLoading, setTraceLoading] = useState(false); - - const openTrace = async () => { - setShowTrace(true); - if (processInstanceId) { - setTraceLoading(true); - try { - const nodes = await fetchTrace(processInstanceId); - setTraceNodes(nodes); - } catch { - toast('轨迹加载失败', 'err'); - } finally { - setTraceLoading(false); - } - } - }; - - const handleComplete = async (action: 'agree' | 'reject') => { - setSubmitting(true); - try { - await completeTask(taskId, { - variables: { - approveResult: action, - comment: comment.trim() || undefined, - }, - processInstanceId, - businessKey, - tableName, - }); - toast(action === 'agree' ? '已同意' : '已驳回'); - if (onCompleted) onCompleted(); - } catch { - toast('办理失败,请重试', 'err'); - } finally { - setSubmitting(false); - } - }; - - return ( - <> - {/* 办理条 */} -
- {/* 审批意见输入 */} -