feat: 统一管理端多语言、配置与票据/结算页面重构
This commit is contained in:
@@ -66,66 +66,82 @@ export function AuditLogsConsole(): React.ReactElement {
|
||||
const meta = data?.meta;
|
||||
|
||||
return (
|
||||
<Card className="w-full max-w-none">
|
||||
<CardHeader className="flex flex-col gap-4">
|
||||
<div>
|
||||
<CardTitle>{t("title")}</CardTitle>
|
||||
</div>
|
||||
<div className="admin-list-toolbar">
|
||||
<div className="admin-list-field">
|
||||
<Label htmlFor="aud-mod" className="sm:w-20 sm:shrink-0">{t("moduleCode")}</Label>
|
||||
<Card className="admin-list-card w-full max-w-none">
|
||||
<CardHeader className="admin-list-header flex flex-col gap-5">
|
||||
<CardTitle className="admin-list-title">{t("title")}</CardTitle>
|
||||
<div className="grid gap-3 lg:grid-cols-3">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<Label htmlFor="aud-mod" className="shrink-0 whitespace-nowrap">
|
||||
{t("moduleCode")}
|
||||
</Label>
|
||||
<Input
|
||||
id="aud-mod"
|
||||
value={moduleCode}
|
||||
onChange={(e) => setModuleCode(e.target.value)}
|
||||
placeholder={t("exactMatch")}
|
||||
className="w-full sm:w-40"
|
||||
className="w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="admin-list-field">
|
||||
<Label htmlFor="aud-act" className="sm:w-20 sm:shrink-0">{t("actionCode")}</Label>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<Label htmlFor="aud-act" className="shrink-0 whitespace-nowrap">
|
||||
{t("actionCode")}
|
||||
</Label>
|
||||
<Input
|
||||
id="aud-act"
|
||||
value={actionCode}
|
||||
onChange={(e) => setActionCode(e.target.value)}
|
||||
placeholder={t("exactMatch")}
|
||||
className="w-full sm:w-40"
|
||||
className="w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="admin-list-field">
|
||||
<Label htmlFor="aud-op" className="sm:w-20 sm:shrink-0">{t("operatorType")}</Label>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<Label htmlFor="aud-op" className="shrink-0 whitespace-nowrap">
|
||||
{t("operatorType")}
|
||||
</Label>
|
||||
<Input
|
||||
id="aud-op"
|
||||
value={operatorType}
|
||||
onChange={(e) => setOperatorType(e.target.value)}
|
||||
placeholder={t("operatorTypePlaceholder")}
|
||||
className="w-full sm:w-40"
|
||||
className="w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="admin-list-actions">
|
||||
<AdminTableExportButton
|
||||
tableId="audit-logs-table"
|
||||
filename="审计日志"
|
||||
sheetName="审计日志"
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setAppliedModule(moduleCode);
|
||||
setAppliedAction(actionCode);
|
||||
setAppliedOpType(operatorType);
|
||||
setPage(1);
|
||||
}}
|
||||
>
|
||||
{t("actions.search", { ns: "common" })}
|
||||
</Button>
|
||||
<Button type="button" variant="secondary" size="sm" onClick={() => void load()}>
|
||||
{t("actions.refresh", { ns: "common" })}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap justify-end gap-2">
|
||||
<AdminTableExportButton
|
||||
tableId="audit-logs-table"
|
||||
filename="审计日志"
|
||||
sheetName="审计日志"
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setAppliedModule(moduleCode);
|
||||
setAppliedAction(actionCode);
|
||||
setAppliedOpType(operatorType);
|
||||
setPage(1);
|
||||
}}
|
||||
>
|
||||
{t("actions.search", { ns: "common" })}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={() => {
|
||||
setModuleCode("");
|
||||
setActionCode("");
|
||||
setOperatorType("");
|
||||
setAppliedModule("");
|
||||
setAppliedAction("");
|
||||
setAppliedOpType("");
|
||||
setPage(1);
|
||||
}}
|
||||
>
|
||||
{t("actions.reset", { ns: "common", defaultValue: "重置" })}
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<CardContent className="admin-list-content">
|
||||
{err ? <p className="text-sm text-red-600 dark:text-red-400">{err}</p> : null}
|
||||
{loading && !data ? (
|
||||
<p className="text-muted-foreground text-sm">{t("states.loading", { ns: "common" })}</p>
|
||||
@@ -137,7 +153,7 @@ export function AuditLogsConsole(): React.ReactElement {
|
||||
<Table id="audit-logs-table">
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="w-20">ID</TableHead>
|
||||
<TableHead className="w-20">{t("table.id", { ns: "common" })}</TableHead>
|
||||
<TableHead>{t("operator")}</TableHead>
|
||||
<TableHead>{t("module")}</TableHead>
|
||||
<TableHead>{t("action")}</TableHead>
|
||||
|
||||
Reference in New Issue
Block a user