修复前端降噪审计问题(frontend-simplification-audit-fixes)

这个提交包含在:
2026-05-29 14:34:06 +08:00
父节点 6cb26798d0
当前提交 7b6e7050d2
共修改 10 个文件,包含 203 行新增和 3 行删除
+1 -1
查看文件
@@ -1077,7 +1077,7 @@ export function PortalHomePage() {
roleCapabilities.canManageSystem
? {
key: "system-audit",
href: "/audit",
href: "/audit-logs",
label: "审计日志",
value: "查看",
note: "查询关键操作留痕。",
+1 -1
查看文件
@@ -1176,7 +1176,7 @@ export function ReimbursementDetailPage() {
<div className="detail-fact-grid xl:grid-cols-4" data-testid="reimbursement-summary">
<div className="detail-fact-card">
<div className="detail-fact-card__label">状态</div>
<div className="detail-fact-card__value">状态:{reimbursementStatusLabel(detail.status)}</div>
<div className="detail-fact-card__value">{reimbursementStatusLabel(detail.status)}</div>
</div>
<div className="detail-fact-card">
<div className="detail-fact-card__label">处理人</div>
@@ -6,6 +6,10 @@ import { Textarea } from "../../components/ui/textarea";
type PaymentChannel = "bank" | "alipay" | "wechat" | "cash" | "other";
function todayDateString() {
return new Date().toISOString().slice(0, 10);
}
export type PayPayload = {
paymentVoucherNo: string;
paymentDate: string;
@@ -46,7 +50,7 @@ export function ReimbursementActions({
}: ReimbursementActionsProps) {
const [withdrawComment, setWithdrawComment] = useState("申请撤回并补充说明后重提");
const [paymentVoucherNo, setPaymentVoucherNo] = useState("");
const [paymentDate, setPaymentDate] = useState("2026-02-08");
const [paymentDate, setPaymentDate] = useState(todayDateString);
const [paymentChannel, setPaymentChannel] = useState<PaymentChannel>("bank");
const [paymentNote, setPaymentNote] = useState("");
const canShowSubmit = showSubmitAction && ["draft", "rejected"].includes(status);
+15
查看文件
@@ -660,6 +660,21 @@ test("Portal 域管理角色也进入经理视图", async ({ page }) => {
await expect(page.locator('[aria-label="portal-card-team_presence"]')).toBeVisible();
});
test("Portal 系统摘要审计日志入口指向实际路由", async ({ page }) => {
await mockPasswordLogin(page);
await mockNavigation(page, "manager");
await mockPortalHome(page, "manager");
await mockAttendanceToday(page);
await mockNotificationList(page);
await mockMe(page, ["admin"], "Admin");
await login(page, ADMIN);
await page.locator("summary").filter({ hasText: "角色重点" }).click();
await expect(page.getByRole("heading", { name: "系统管理" })).toBeVisible();
await expect(page.getByRole("link", { name: /审计日志.*查看/ })).toHaveAttribute("href", "/audit-logs");
});
test("企微 WebView 下默认进入移动工作台", async ({ page }) => {
await page.addInitScript(() => {
Object.defineProperty(window.navigator, "userAgent", {