优化: 大文件拆分+代码分割+按需加载+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:
freedakgmail
2026-08-04 07:53:37 +08:00
parent 1da385cd5d
commit 2968484d2d
109 changed files with 8950 additions and 5926 deletions
@@ -0,0 +1,27 @@
-- 验收测试表
CREATE TABLE IF NOT EXISTS "AcceptanceTest" (
"id" TEXT NOT NULL,
"orgId" TEXT NOT NULL,
"verifierName" TEXT NOT NULL,
"results" JSONB NOT NULL,
"remarks" JSONB NOT NULL,
"conclusionName" TEXT,
"conclusionDate" TEXT,
"conclusionResult" TEXT,
"conclusionIssues" TEXT,
"screenshots" JSONB,
"signature1" TEXT,
"signature2" TEXT,
"status" TEXT NOT NULL DEFAULT 'DRAFT',
"submittedAt" TIMESTAMP(3),
"createdBy" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "AcceptanceTest_pkey" PRIMARY KEY ("id")
);
-- 唯一约束:同一组织下验收人姓名唯一
CREATE UNIQUE INDEX IF NOT EXISTS "AcceptanceTest_orgId_verifierName_key" ON "AcceptanceTest"("orgId", "verifierName");
-- 索引
CREATE INDEX IF NOT EXISTS "AcceptanceTest_orgId_status_idx" ON "AcceptanceTest"("orgId", "status");
+53
View File
@@ -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])
}