feat(08-05-interaction-pattern-unification): 统一前端交互与反馈模式
这个提交包含在:
@@ -60,7 +60,7 @@ const pendingTask = {
|
||||
duration: "1 天",
|
||||
businessStatus: "reviewing",
|
||||
},
|
||||
allowedActions: ["approve", "reject", "return"],
|
||||
allowedActions: ["approve", "reject", "return", "transfer"],
|
||||
};
|
||||
|
||||
const pendingTaskDetail = {
|
||||
@@ -190,7 +190,7 @@ async function mockWorkflowConfirmApis(page: Page) {
|
||||
sections: {
|
||||
main: [
|
||||
navigationItem("portal", "/portal", "工作台", "home_app_logo"),
|
||||
navigationItem("workflow", "/workflow/tasks", "待我处理", "fact_check"),
|
||||
navigationItem("workflow", "/workflow/tasks", "待我审批", "fact_check"),
|
||||
],
|
||||
admin: [],
|
||||
backup: [],
|
||||
@@ -262,7 +262,12 @@ async function mockWorkflowConfirmApis(page: Page) {
|
||||
}
|
||||
|
||||
if (path === "/api/workflow/approvers") {
|
||||
await fulfillJson(route, { page: 1, pageSize: 100, total: 0, items: [] });
|
||||
await fulfillJson(route, {
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
total: 1,
|
||||
items: [{ id: "employee-transfer-1", employeeNo: "E-transfer", name: "周审批" }],
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -293,6 +298,8 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await login(page, MANAGER);
|
||||
await page.goto(`/workflow/tasks/${pendingTask.id}`);
|
||||
await expect(page.getByTestId("workflow-task-overview")).toBeVisible();
|
||||
await expect(page.getByTestId("workflow-action-consequence-help")).toContainText("退回:");
|
||||
await expect(page.getByTestId("workflow-action-consequence-help")).toContainText("驳回:");
|
||||
|
||||
await page.getByTestId("workflow-task-approve").click();
|
||||
await expect(page.getByTestId("workflow-action-confirm-dialog")).toContainText("确认后将进入下一审批节点");
|
||||
@@ -306,6 +313,27 @@ test.describe("R7E 审批动作二次确认", () => {
|
||||
await page.getByTestId("workflow-action-confirm-cancel").click();
|
||||
expect(actionCalls.reject).toBe(0);
|
||||
|
||||
await page.locator("summary", { hasText: "更多" }).click();
|
||||
await page.getByTestId("workflow-task-transfer-menu-item").click();
|
||||
await expect(page.getByTestId("workflow-task-transfer-disabled-reason")).toHaveText("请先选择目标审批人。");
|
||||
await expect(page.getByTestId("workflow-task-transfer")).toBeDisabled();
|
||||
const transferApprover = page.getByTestId("workflow-task-transfer-approver");
|
||||
const transferReason = page.getByTestId("workflow-task-transfer-reason");
|
||||
await transferApprover.focus();
|
||||
await expect(transferApprover).toBeFocused();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(transferReason).toBeFocused();
|
||||
await transferApprover.selectOption("employee-transfer-1");
|
||||
await transferReason.fill("理由太短");
|
||||
await expect(page.getByTestId("workflow-task-transfer-disabled-reason")).toContainText("至少 10 个字");
|
||||
await expect(page.getByTestId("workflow-task-transfer")).toBeDisabled();
|
||||
await transferReason.fill("当前事项需转交对应审批人继续处理");
|
||||
await expect(page.getByTestId("workflow-task-transfer-disabled-reason")).toHaveText("转审理由已满足要求。");
|
||||
await expect(page.getByTestId("workflow-task-transfer")).toBeEnabled();
|
||||
await transferReason.focus();
|
||||
await page.keyboard.press("Tab");
|
||||
await expect(page.getByTestId("workflow-task-transfer")).toBeFocused();
|
||||
|
||||
await page.getByTestId("workflow-task-return-toggle").click();
|
||||
await page.getByTestId("workflow-task-return-comment").fill("请补充附件后重新提交。");
|
||||
await page.getByTestId("workflow-task-return").click();
|
||||
|
||||
在新工单中引用
屏蔽一个用户