refactor: 前端应用骨架迁移至 zustand 并统一路由权限壳

This commit is contained in:
2026-08-05 17:10:30 +08:00
parent e21f0de427
commit d53bbd8176
33 changed files with 1055 additions and 687 deletions

View File

@@ -0,0 +1,58 @@
import { z } from 'zod';
export const importSheetMetaSchema = z
.object({
name: z.string(),
headers: z.array(z.string()),
rowCount: z.number(),
suggestedStepKey: z.string().nullable(),
})
.passthrough();
export const importStepSummarySchema = z
.object({
total: z.number(),
valid: z.number(),
error: z.number(),
create: z.number(),
update: z.number(),
skip: z.number(),
})
.passthrough()
.nullable();
export const importStepDetailSchema = z
.object({
id: z.number(),
stepKey: z.string(),
label: z.string(),
sheets: z.array(z.string()),
status: z.string(),
mapping: z.record(z.string(), z.string()),
summary: importStepSummarySchema,
committedAt: z.string().nullable(),
})
.passthrough();
export const importRunDetailSchema = z
.object({
id: z.string(),
fileName: z.string(),
source: z.enum(['ai', 'manual']),
status: z.string(),
currentStepKey: z.string().nullable(),
createdAt: z.string(),
sheets: z.array(importSheetMetaSchema),
steps: z.array(importStepDetailSchema),
})
.passthrough();
export const importRunEnvelopeSchema = z
.object({
success: z.boolean(),
data: importRunDetailSchema,
message: z.string().optional(),
})
.passthrough();
/** 考勤记录 */