全局中文化
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
import { TEXT } from "../../locales";
|
||||
|
||||
export interface AuditExportColumn {
|
||||
key: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export const auditExportColumns: AuditExportColumn[] = [
|
||||
{ key: "timestamp", label: "审计时间" },
|
||||
{ key: "actorName", label: "操作人姓名" },
|
||||
{ key: "actorId", label: "操作人账号" },
|
||||
{ key: "actorRoleLabel", label: "操作人角色" },
|
||||
{ key: "eventLabel", label: "操作类型" },
|
||||
{ key: "targetTypeLabel", label: "操作对象类型" },
|
||||
{ key: "targetIdentifier", label: "操作对象标识" },
|
||||
{ key: "description", label: "操作描述" },
|
||||
{ key: "beforeStatus", label: "操作前状态" },
|
||||
{ key: "afterStatus", label: "操作后状态" },
|
||||
{ key: "resultLabel", label: "操作结果" },
|
||||
{ key: "reason", label: "拒绝原因" },
|
||||
{ key: "ip", label: "IP 地址" },
|
||||
{ key: "remark", label: "备注" },
|
||||
{ key: "timestamp", label: TEXT.audit.exportColumns.timestamp },
|
||||
{ key: "actorName", label: TEXT.audit.exportColumns.actorName },
|
||||
{ key: "actorId", label: TEXT.audit.exportColumns.actorId },
|
||||
{ key: "actorRoleLabel", label: TEXT.audit.exportColumns.actorRoleLabel },
|
||||
{ key: "eventLabel", label: TEXT.audit.exportColumns.eventLabel },
|
||||
{ key: "targetTypeLabel", label: TEXT.audit.exportColumns.targetTypeLabel },
|
||||
{ key: "targetIdentifier", label: TEXT.audit.exportColumns.targetIdentifier },
|
||||
{ key: "description", label: TEXT.audit.exportColumns.description },
|
||||
{ key: "beforeStatus", label: TEXT.audit.exportColumns.beforeStatus },
|
||||
{ key: "afterStatus", label: TEXT.audit.exportColumns.afterStatus },
|
||||
{ key: "resultLabel", label: TEXT.audit.exportColumns.resultLabel },
|
||||
{ key: "reason", label: TEXT.audit.exportColumns.reason },
|
||||
{ key: "ip", label: TEXT.audit.exportColumns.ip },
|
||||
{ key: "remark", label: TEXT.audit.exportColumns.remark },
|
||||
];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { getDictLabel, statusDict } from "../../dictionaries";
|
||||
import type { AuditEvent } from "..";
|
||||
import { auditExportColumns } from "./auditExportColumns";
|
||||
import { TEXT } from "../../locales";
|
||||
|
||||
export interface AuditExportRow {
|
||||
[key: string]: string;
|
||||
@@ -19,11 +20,12 @@ export const formatAuditRow = (event: AuditEvent): AuditExportRow => {
|
||||
descriptionParts.push(`${event.actorName} ${event.actionText}`);
|
||||
if (event.targetTypeLabel || event.targetName || event.targetId) {
|
||||
descriptionParts.push(
|
||||
`对象:${event.targetTypeLabel || ""}${event.targetName ? `(${event.targetName})` : `(${event.targetId}`})`
|
||||
`${TEXT.audit.objectLabel}${event.targetTypeLabel || ""}${
|
||||
event.targetName ? `(${event.targetName})` : `(${event.targetId}`})`
|
||||
);
|
||||
}
|
||||
if (event.diffText?.length) {
|
||||
descriptionParts.push(`变更:${event.diffText.join(";")}`);
|
||||
descriptionParts.push(`${TEXT.audit.changeLabel}${event.diffText.join(";")}`);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user