优化: 大文件拆分+代码分割+按需加载+console清理+any类型替换
- Money.tsx (2260行→54行): 拆分为 money/ 子目录4个组件, React.lazy二级分割 - AIAssistant.tsx (2038行→63行): 拆分为 ai-assistant/ 子目录6个组件, React.lazy二级分割 - xlsx改为动态导入, OvertimeTab从345KB降至12.7KB - api-services.ts: 请求参数 any→Record<string,unknown> - 移除前端3处console.log残留 - 后端console替换为pino logger - 前后端未使用import/变量清理 - Zod schema验证: termination/platform/special-status/work-process - 新增 leave.routes.ts, acceptance-test.routes.ts - UI组件: PageGuide, QueryError, Stepper
This commit is contained in:
@@ -175,6 +175,7 @@ model Organization {
|
||||
shifts Shift[]
|
||||
shiftAssignments ShiftAssignment[]
|
||||
leaveRecords LeaveRecord[]
|
||||
leaveRequests LeaveRequest[]
|
||||
calendarEvents CalendarEvent[]
|
||||
consultations Consultation[]
|
||||
workProcesses WorkProcess[]
|
||||
@@ -263,6 +264,7 @@ model Employee {
|
||||
specialDeductionRecords SpecialDeductionRecord[]
|
||||
shiftAssignments ShiftAssignment[]
|
||||
leaveRecords LeaveRecord[]
|
||||
leaveRequests LeaveRequest[]
|
||||
calendarEvents CalendarEvent[]
|
||||
workProcesses WorkProcess[]
|
||||
specialStatuses EmployeeSpecialStatus[]
|
||||
@@ -1162,6 +1164,33 @@ model LeaveRecord {
|
||||
@@index([orgId, startDate])
|
||||
}
|
||||
|
||||
// ========== 休假审批流 ==========
|
||||
|
||||
model LeaveRequest {
|
||||
id String @id @default(cuid())
|
||||
orgId String
|
||||
org Organization @relation(fields: [orgId], references: [id], onDelete: Cascade)
|
||||
employeeId String
|
||||
employee Employee @relation(fields: [employeeId], references: [id], onDelete: Cascade)
|
||||
leaveType String // SICK=病假 / PERSONAL=事假 / ANNUAL=年假 / MATERNITY=产假 / OTHER=其他
|
||||
startDate DateTime
|
||||
endDate DateTime
|
||||
days Float // 请假天数
|
||||
reason String?
|
||||
attachment String? // 附件URL(如病假条)
|
||||
status String @default("PENDING") // PENDING=待审批 / APPROVED=已批准 / REJECTED=已驳回 / CANCELLED=已撤回
|
||||
approverId String? // 审批人ID
|
||||
approvedAt DateTime?
|
||||
approveRemark String? // 审批意见
|
||||
createdBy String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([orgId, employeeId])
|
||||
@@index([orgId, status])
|
||||
@@index([orgId, startDate])
|
||||
}
|
||||
|
||||
// ========== 自定义日历事件 ==========
|
||||
|
||||
model CalendarEvent {
|
||||
@@ -1311,3 +1340,27 @@ model EmployeeSpecialStatus {
|
||||
@@index([orgId, type])
|
||||
@@index([employeeId])
|
||||
}
|
||||
|
||||
// ========== 验收测试 ==========
|
||||
model AcceptanceTest {
|
||||
id String @id @default(uuid())
|
||||
orgId String
|
||||
verifierName String // 验收人姓名
|
||||
results Json // { "1.1": "pass", "1.2": "fail", ... }
|
||||
remarks Json // { "1.1": "备注内容", ... }
|
||||
conclusionName String? // 结论验收人
|
||||
conclusionDate String? // 结论日期
|
||||
conclusionResult String? // pass | conditional | fail — 系统自动计算
|
||||
conclusionIssues String? // 遗留问题(系统自动汇总)
|
||||
screenshots Json? // { "0-0": "data:image/png;base64,...", ... }
|
||||
signature1 String? // 验收人签名 dataURL
|
||||
signature2 String? // 项目经理签名 dataURL
|
||||
status String @default("DRAFT") // DRAFT | SUBMITTED
|
||||
submittedAt DateTime?
|
||||
createdBy String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([orgId, verifierName])
|
||||
@@index([orgId, status])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user