feat(workbench): refine dynamic task collaboration

This commit is contained in:
2026-09-24 16:36:12 +08:00
parent b64d2b78bb
commit 87cc7785da
25 changed files with 1216 additions and 470 deletions
+11 -9
View File
@@ -19,6 +19,7 @@ test("审批动作展示中文参数和证据,viewer 不可审批,冲突后
body: `globalThis.__TJWATER_CONFIG__=${JSON.stringify({
TJWATER_AUTH_MODE: "disabled",
TJWATER_SERVER_API_BASE_URL: "http://server.test",
TJWATER_PERIPHERAL_SAMPLE_API_BASE_URL: "http://sample.test",
TJWATER_MAP_URL: "http://map.test/geoserver",
TJWATER_GEOSERVER_WORKSPACE: "tjwater_next"
})}`
@@ -280,7 +281,7 @@ test("审批动作展示中文参数和证据,viewer 不可审批,冲突后
await expect(page.getByText("正在重连,业务数据可能陈旧", { exact: true })).toHaveCount(0);
await page.evaluate(() => document.fonts.ready);
await testInfo.attach("workbench-reconnect-notice", {
body: await reconnectNotice.screenshot({ path: testInfo.outputPath("workbench-reconnect-notice.png") }),
body: await page.screenshot({ path: testInfo.outputPath("workbench-reconnect-notice.png") }),
contentType: "image/png"
});
let conditionPanel = await openTask();
@@ -296,23 +297,24 @@ test("审批动作展示中文参数和证据,viewer 不可审批,冲突后
const refreshingButton = conditionPanel.getByRole("button", { name: "正在刷新工况任务" });
await expect(refreshingButton).toBeDisabled();
await refreshingButton.evaluate((button: HTMLButtonElement) => button.click());
await page.waitForTimeout(500);
expect(snapshotRequests).toBe(2);
await expect(conditionRefreshButton).toBeEnabled({ timeout: 4_000 });
expect(Date.now() - refreshStartedAt).toBeGreaterThanOrEqual(2_900);
await conditionPanel.getByRole("button", { name: "配置定时流程" }).click();
await conditionPanel.getByLabel("定时流程名称").fill("夜间阀门巡检");
await conditionPanel.getByLabel("任务说明").fill("每十五分钟检查预约维修涉及的边界阀门。");
await conditionPanel.getByRole("button", { name: "创建定时流程" }).click();
await expect(conditionPanel.getByText("夜间阀门巡检", { exact: true }).first()).toBeVisible();
await expect(conditionPanel.getByRole("button", { name: "配置定时流程" })).toHaveCount(0);
await expect(conditionPanel.getByRole("button", { name: "创建定时流程" })).toHaveCount(0);
await conditionPanel.getByRole("button", { name: /预约任务/ }).click();
await expect(conditionPanel.getByText("最近工况", { exact: true })).toHaveCount(1);
await expect(conditionPanel.getByText("城北阀井预约维修", { exact: true }).first()).toBeVisible();
await conditionPanel.getByText("城北阀井预约维修", { exact: true }).first().click();
await expect(conditionPanel.getByText("回执要求", { exact: true })).toBeVisible();
await expect(conditionPanel.getByText("复令要求", { exact: true })).toBeVisible();
await expect(conditionPanel.getByText("回填现场处理结果", { exact: true })).toBeVisible();
const appointmentDetail = conditionPanel.getByTestId("scheduled-condition-detail-scroll");
await expect(appointmentDetail.getByText("工单报告", { exact: true })).toBeVisible();
await expect(appointmentDetail.getByText("派单信息", { exact: true })).toBeVisible();
await expect(appointmentDetail.getByText("活动记录", { exact: true })).toHaveCount(0);
await expect(appointmentDetail.getByText("关键证据", { exact: true })).toHaveCount(0);
await expect(conditionPanel.getByText("测试班组乙", { exact: true }).first()).toBeVisible();
await expect(conditionPanel.getByText(/位置:联调测试点东侧/)).toBeVisible();
await expect(appointmentDetail.getByText("联调测试点东侧", { exact: true })).toBeVisible();
await expect(conditionPanel.getByText("编辑后的预约维修说明", { exact: true })).toBeVisible();
await expect(conditionPanel.getByText("预约 09/23 18:00 由北片区维修组处理", { exact: true })).toHaveCount(0);
await page.waitForTimeout(3_500);