From ec4d581af62b4f1b6b66956ac31984376ea96d2c Mon Sep 17 00:00:00 2001 From: biss Date: Sun, 8 Nov 2026 15:42:36 +0800 Subject: [PATCH] Support approved same-major demotion --- .../Controllers/ApprovalsController.cs | 2 +- .../StudentStatusChangesController.cs | 47 +++++++++++++++---- .../Domain/Academic/StudentStatusChange.cs | 3 +- .../ApprovalsControllerTests.cs | 25 ++++++++++ web/src/i18n/messages/en-US.ts | 4 +- web/src/i18n/messages/zh-CN.ts | 4 +- web/src/views/StudentStatusChangesView.vue | 21 +++++---- 7 files changed, 83 insertions(+), 23 deletions(-) diff --git a/src/Jiaowu.Api/Controllers/ApprovalsController.cs b/src/Jiaowu.Api/Controllers/ApprovalsController.cs index 03eb866..5e424ce 100644 --- a/src/Jiaowu.Api/Controllers/ApprovalsController.cs +++ b/src/Jiaowu.Api/Controllers/ApprovalsController.cs @@ -1363,7 +1363,7 @@ public sealed class ApprovalsController( private async Task NotifyCollege(GradeModification gm, CancellationToken ct) { await NotificationService.SendToRoleAsync(db, SystemRoles.CollegeAdmin, "成绩修改待审核", $"{gm.GradeRecord!.Student!.Name} — 《{gm.GradeRecord.GradeSheet!.TeachingTask!.Course!.Name}》{gm.CurrentScore}→{gm.RequestedScore}", cancellationToken: ct, category: NotificationCategory.Grade); } private async Task NotifyRole(string role, string title, string content, CancellationToken ct) { await NotificationService.SendToRoleAsync(db, role, title, content, cancellationToken: ct, category: NotificationCategory.Approval); } - private static string SSCLabel(StudentStatusChangeType t) => t switch { StudentStatusChangeType.Suspension => "休学", StudentStatusChangeType.Resumption => "复学", StudentStatusChangeType.Withdrawal => "退学", StudentStatusChangeType.Enlistment => "入伍保留学籍", _ => "异动" }; + private static string SSCLabel(StudentStatusChangeType t) => t switch { StudentStatusChangeType.Suspension => "休学", StudentStatusChangeType.Resumption => "复学", StudentStatusChangeType.Withdrawal => "退学", StudentStatusChangeType.Enlistment => "入伍保留学籍", StudentStatusChangeType.Demotion => "降级", _ => "异动" }; private static string CALabel(CourseAdjustmentType t) => t switch { CourseAdjustmentType.Reschedule => "调课", CourseAdjustmentType.Cancel => "停课", CourseAdjustmentType.Makeup => "补课", CourseAdjustmentType.Substitute => "代课", _ => "调停课" }; private ActionResult ConflictProblem(string d) => Conflict(new ProblemDetails { Title = "无法完成", Detail = d, Status = 409 }); } diff --git a/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs b/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs index a7cf928..d254b29 100644 --- a/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs +++ b/src/Jiaowu.Api/Controllers/StudentStatusChangesController.cs @@ -88,6 +88,7 @@ public sealed class StudentStatusChangesController( { StudentStatusChangeType.Suspension, StudentStatusChangeType.Enlistment, + StudentStatusChangeType.Demotion, StudentStatusChangeType.Withdrawal }, StudentStatus.Suspended or StudentStatus.Retained => new[] @@ -105,7 +106,8 @@ public sealed class StudentStatusChangesController( var hasEnlistment = student.Status == StudentStatus.Retained && await db.StudentStatusChanges.AnyAsync(x => x.StudentId == student.Id && x.Type == StudentStatusChangeType.Enlistment && x.State == StudentStatusChangeState.Approved, token); return Ok(new { student.Status, Types = types, HasPending = hasPending, - CurrentClassId = student.AdministrativeClassId, MajorId = student.AdministrativeClass!.MajorId, RequiresDischargeDate = hasEnlistment }); + CurrentClassId = student.AdministrativeClassId, MajorId = student.AdministrativeClass!.MajorId, + CurrentGrade = student.AdministrativeClass.Grade, RequiresDischargeDate = hasEnlistment }); } [HttpGet("{id:guid}/course-impact")] @@ -114,7 +116,7 @@ public sealed class StudentStatusChangesController( var change = await ScopedChanges().Include(x => x.Student) .FirstOrDefaultAsync(x => x.Id == id, token); if (change is null) return NotFound(); - if (change.Type is not (StudentStatusChangeType.Suspension or StudentStatusChangeType.Withdrawal or StudentStatusChangeType.Enlistment)) + if (change.Type is not (StudentStatusChangeType.Suspension or StudentStatusChangeType.Withdrawal or StudentStatusChangeType.Enlistment or StudentStatusChangeType.Demotion)) return Ok(new { Items = Array.Empty() }); if (change.AffectedTermId is null) return ConflictProblem("该申请缺少受影响学期,请重新提交申请。"); @@ -139,6 +141,8 @@ public sealed class StudentStatusChangesController( StudentStatus.Suspended, StudentStatusChangeType.Enlistment when student.Status == StudentStatus.Active => StudentStatus.Retained, + StudentStatusChangeType.Demotion when student.Status == StudentStatus.Active => + StudentStatus.Active, StudentStatusChangeType.Resumption when student.Status is StudentStatus.Suspended or StudentStatus.Retained => StudentStatus.Active, StudentStatusChangeType.Withdrawal when student.Status is StudentStatus.Active or StudentStatus.Suspended or StudentStatus.Retained => @@ -159,7 +163,7 @@ public sealed class StudentStatusChangesController( request.DischargeDate < lastEnlistment.ServiceStartDate)) return ValidationProblem("退役复学须填写不晚于今天且不早于入伍日期的退役日期。"); } - if (request.Type is StudentStatusChangeType.Suspension or StudentStatusChangeType.Withdrawal or StudentStatusChangeType.Enlistment or StudentStatusChangeType.Resumption) + if (request.Type is StudentStatusChangeType.Suspension or StudentStatusChangeType.Withdrawal or StudentStatusChangeType.Enlistment or StudentStatusChangeType.Resumption or StudentStatusChangeType.Demotion) { var term = await db.AcademicTerms.AsNoTracking().FirstOrDefaultAsync( x => x.Id == request.AffectedTermId, token); @@ -168,14 +172,16 @@ public sealed class StudentStatusChangesController( if (term.StartDate > DateOnly.FromDateTime(DateTime.UtcNow)) return ValidationProblem("异动当前在批准后立即生效,不能选择尚未开始的学期。"); } - if (request.Type == StudentStatusChangeType.Resumption) + if (request.Type is StudentStatusChangeType.Resumption or StudentStatusChangeType.Demotion) { var originalClass = await db.AdministrativeClasses.AsNoTracking() .SingleAsync(x => x.Id == student.AdministrativeClassId, token); var targetClass = await db.AdministrativeClasses.AsNoTracking() .FirstOrDefaultAsync(x => x.Id == request.TargetClassId && x.IsEnabled, token); if (targetClass is null || targetClass.MajorId != originalClass.MajorId) - return ValidationProblem("复学须选择本专业的有效目标班级;跨专业调整需另行审批。"); + return ValidationProblem("须选择本专业的有效目标班级;跨专业调整需另行审批。"); + if (request.Type == StudentStatusChangeType.Demotion && targetClass.Grade <= originalClass.Grade) + return ValidationProblem("降级目标班级须属于本专业的较低年级。"); } if (await db.StudentStatusChanges.AnyAsync(x => x.StudentId == student.Id && x.State != StudentStatusChangeState.Approved && @@ -188,7 +194,7 @@ public sealed class StudentStatusChangesController( OriginalStatus = student.Status, TargetStatus = target.Value, Reason = request.Reason.Trim(), AffectedTermId = request.AffectedTermId, OriginalClassId = student.AdministrativeClassId, - TargetClassId = request.Type == StudentStatusChangeType.Resumption ? request.TargetClassId : null, + TargetClassId = request.Type is StudentStatusChangeType.Resumption or StudentStatusChangeType.Demotion ? request.TargetClassId : null, ServiceStartDate = request.Type == StudentStatusChangeType.Enlistment ? request.ServiceStartDate : null, DischargeDate = request.Type == StudentStatusChangeType.Resumption ? request.DischargeDate : null }; @@ -288,7 +294,14 @@ public sealed class StudentStatusChangesController( } change.Student.AdministrativeClassId = targetClass.Id; } - if (change.Type is StudentStatusChangeType.Suspension or StudentStatusChangeType.Withdrawal or StudentStatusChangeType.Enlistment) + if (change.Type == StudentStatusChangeType.Demotion) + { + var originalClass = await db.AdministrativeClasses.AsNoTracking().SingleAsync(x => x.Id == change.Student.AdministrativeClassId, token); + var targetClass = await db.AdministrativeClasses.AsNoTracking().FirstOrDefaultAsync(x => x.Id == change.TargetClassId && + x.IsEnabled && x.MajorId == originalClass.MajorId && x.Grade > originalClass.Grade, token); + if (targetClass is null) return ConflictProblem("降级目标班级已不可用或不符合年级要求。"); + } + if (change.Type is StudentStatusChangeType.Suspension or StudentStatusChangeType.Withdrawal or StudentStatusChangeType.Enlistment or StudentStatusChangeType.Demotion) { if (change.AffectedTermId is null) return ConflictProblem("该申请缺少受影响学期,请驳回后重新提交。"); @@ -332,6 +345,19 @@ public sealed class StudentStatusChangesController( enrollment.WithdrawnAt = reviewedAt; } } + if (change.Type == StudentStatusChangeType.Demotion) + { + var start = (await db.AcademicTerms.AsNoTracking().SingleAsync(x => x.Id == change.AffectedTermId, token)).StartDate; + var oldTargetTasks = await db.TeachingTasks.AsNoTracking().Where(x => x.AcademicTerm!.StartDate < start && + x.Classes.Any(c => c.AdministrativeClassId == change.TargetClassId) && + !db.GradeRecords.Any(g => g.StudentId == change.StudentId && g.GradeSheet!.TeachingTaskId == x.Id) && + !db.StudentStatusChangeCourseEffects.Any(e => e.StudentId == change.StudentId && e.TeachingTaskId == x.Id)) + .Select(x => x.Id).ToListAsync(token); + foreach (var taskId in oldTargetTasks) + db.StudentStatusChangeCourseEffects.Add(new StudentStatusChangeCourseEffect + { StudentStatusChangeId = change.Id, StudentId = change.StudentId, TeachingTaskId = taskId }); + change.Student.AdministrativeClassId = change.TargetClassId!.Value; + } } change.State = StudentStatusChangeState.Approved; change.Student!.Status = change.TargetStatus; @@ -367,9 +393,14 @@ public sealed class StudentStatusChangesController( var term = await db.AcademicTerms.AsNoTracking().SingleAsync(x => x.Id == change.AffectedTermId, token); var studentId = change.StudentId; var classId = change.Student!.AdministrativeClassId; + var isDemotion = change.Type == StudentStatusChangeType.Demotion; + var targetClassId = change.TargetClassId; var tasks = await db.TeachingTasks.AsNoTracking() .Where(x => x.AcademicTerm!.StartDate >= term.StartDate && - (x.Classes.Any(c => c.AdministrativeClassId == classId) || + (isDemotion + ? x.Classes.Any(c => c.AdministrativeClassId == classId) && + !x.Classes.Any(c => c.AdministrativeClassId == targetClassId) + : x.Classes.Any(c => c.AdministrativeClassId == classId) || db.CourseEnrollments.Any(e => e.StudentId == studentId && e.CourseSelectionOffering!.TeachingTaskId == x.Id && (e.Status == CourseEnrollmentStatus.Enrolled || e.Status == CourseEnrollmentStatus.Waitlisted)))) diff --git a/src/Jiaowu.Api/Domain/Academic/StudentStatusChange.cs b/src/Jiaowu.Api/Domain/Academic/StudentStatusChange.cs index b30c0b3..4d8d971 100644 --- a/src/Jiaowu.Api/Domain/Academic/StudentStatusChange.cs +++ b/src/Jiaowu.Api/Domain/Academic/StudentStatusChange.cs @@ -52,7 +52,8 @@ public enum StudentStatusChangeType Suspension = 1, Resumption = 2, Withdrawal = 3, - Enlistment = 4 + Enlistment = 4, + Demotion = 5 } public enum StudentStatusChangeState diff --git a/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs b/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs index 9a1033e..f7915ba 100644 --- a/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs +++ b/tests/Jiaowu.Api.Tests/ApprovalsControllerTests.cs @@ -518,6 +518,31 @@ public sealed class ApprovalsControllerTests Assert.Empty(await Jiaowu.Api.Infrastructure.Teaching.TeachingTaskRosterQuery.ForTask(fixture.Db, missedTask.Id).ToListAsync()); } + [Fact] + public async Task Demotion_removes_original_class_tasks_but_keeps_shared_tasks_and_enrollment_year() + { + await using var fixture = await ApprovalFixture.CreateAsync(); + var originalClass = await fixture.Db.AdministrativeClasses.FindAsync(fixture.Student.AdministrativeClassId); + var targetClass = new AdministrativeClass { Code = "CS2027-D", Name = "降级班", Grade = 2027, MajorId = originalClass!.MajorId }; + var sharedTask = new TeachingTask { TaskNumber = "SHARED", Name = "共用教学班", CourseId = fixture.SubstituteCourse.Id, + AcademicTermId = fixture.CurrentTerm.Id, Capacity = 30, Classes = [ + new TeachingTaskClass { AdministrativeClassId = originalClass.Id }, + new TeachingTaskClass { AdministrativeClassId = targetClass.Id }] }; + var change = new StudentStatusChange { StudentId = fixture.Student.Id, Type = StudentStatusChangeType.Demotion, + OriginalStatus = StudentStatus.Active, TargetStatus = StudentStatus.Active, Reason = "降级申请", State = StudentStatusChangeState.CollegeApproved, + AffectedTermId = fixture.CurrentTerm.Id, OriginalClassId = originalClass.Id, TargetClassId = targetClass.Id }; + fixture.Db.AddRange(targetClass, sharedTask, change); + await fixture.Db.SaveChangesAsync(); + var controller = new StudentStatusChangesController(fixture.Db, new ManagerDataScope()); + Assert.IsType(await controller.Review(change.Id, new StudentStatusReviewRequest(true, null), CancellationToken.None)); + var student = await fixture.Db.Students.FindAsync(fixture.Student.Id); + Assert.Equal(targetClass.Id, student!.AdministrativeClassId); + Assert.Equal(2026, student.EnrollmentYear); + var effects = await fixture.Db.StudentStatusChangeCourseEffects.ToListAsync(); + Assert.Contains(effects, x => x.TeachingTaskId == fixture.CurrentTask.Id); + Assert.DoesNotContain(effects, x => x.TeachingTaskId == sharedTask.Id); + } + [Fact] public async Task Legacy_student_status_progress_discloses_missing_history() { diff --git a/web/src/i18n/messages/en-US.ts b/web/src/i18n/messages/en-US.ts index 507e9a1..3b25dfc 100644 --- a/web/src/i18n/messages/en-US.ts +++ b/web/src/i18n/messages/en-US.ts @@ -246,12 +246,12 @@ export default { teachingPreferences: { teacherTitle: 'Teaching course applications', reviewerTitle: 'Teaching eligibility review', teacherDescription: 'Apply for courses you are willing to teach before scheduling. College approval is required before public-course teaching tasks can be assigned.', reviewerDescription: 'Review teacher applications or assign teachers directly. Approved teachers enter the eligible pool for the selected term and course.', apply: 'Apply for course', assign: 'Assign teacher directly', teacher: 'Teacher', selectTermSubject: 'Select term and course', college: 'College', reviewAssign: 'Review or assign directly', academicOffice: 'Academic affairs', mergeAssign: 'Merge classes and assign teacher', scheduling: 'Scheduling', generateTimetable: 'Generate timetable', allTerms: 'All terms', allStatuses: 'All statuses', refresh: 'Refresh', total: '{count} records', applicant: 'Applicant', course: 'Applied course', term: 'Term', statement: 'Application statement', status: 'Status', reviewComment: 'Review comment', actions: 'Actions', withdraw: 'Withdraw', review: 'Review', processed: 'Processed', emptyTeacher: 'No teaching course applications', emptyReviewer: 'No applications awaiting review', submitTitle: 'Apply for a teaching course', proposedCourse: 'Proposed course', statementPlaceholder: 'Describe relevant teaching experience, research interests, or other context', cancel: 'Cancel', submitReview: 'Submit for college review', reviewTitle: 'Review teaching eligibility', teacherStatement: 'Teacher statement', notProvided: 'Not provided', conclusion: 'Decision', approve: 'Approve', reject: 'Reject', confirmReview: 'Confirm review', assignmentTitle: 'Assign teaching eligibility directly', assignmentHint: 'No teacher application is required. Saving immediately grants eligibility for the selected term and course.', teacherPlaceholder: 'Select by employee number or name', courseLabel: 'Course', coursePlaceholder: 'Select by code or name', credits: '{count} credits', assignmentComment: 'Assignment note', assignmentPlaceholder: 'Enter department arrangements, specialization, or other basis', confirmAssign: 'Confirm assignment', statuses: { Pending: 'Pending review', Approved: 'Approved', Rejected: 'Rejected', Withdrawn: 'Withdrawn' }, messages: { selectTermCourse: 'Select a term and course.', submitted: 'Course application submitted for college review.', withdrawConfirm: 'Withdraw the teaching application for “{course}”?', withdrawTitle: 'Withdraw application', approved: 'Application approved.', rejected: 'Application rejected.', selectAll: 'Select a term, teacher, and course.', assigned: 'Teaching eligibility assigned directly.' }, }, - statusChangeImpact: { resumptionTerm: 'Resumption term', resumptionTermHint: 'Takes effect upon approval; classes missed during leave are not automatically added.', serviceDate: 'Enlistment date', serviceDateRequired: 'Select the enlistment date', dischargeDate: 'Discharge date', dischargeDateRequired: 'Select the discharge date', retained: 'Status retained', targetClass: 'Class after resumption', targetClassRequired: 'Select the class after resumption', targetClassHint: 'Select an active class in the original major; a change of major requires separate approval.', affectedTerm: 'First affected term', affectedTermRequired: 'Select the first affected term', affectedTermHint: 'Incomplete courses from this term onward will be removed; valid results will be retained.', courseImpact: 'Course impact preview', courseImpactHint: 'The final review recalculates this list. Unpublished or exceptional results require prior review.', course: 'Teaching class', disposition: 'Disposition', impact: { Remove: 'Remove course', RemoveEmptyGrade: 'Remove course and empty grade row', KeepGrade: 'Keep valid result', ReviewRequired: 'Review grade first' } }, + statusChangeImpact: { classTransition: 'Class change', demotionTermHint: 'Incomplete classes exclusive to the original class are removed; shared classes and independent electives are kept.', resumptionTerm: 'Resumption term', resumptionTermHint: 'Takes effect upon approval; classes missed during leave are not automatically added.', serviceDate: 'Enlistment date', serviceDateRequired: 'Select the enlistment date', dischargeDate: 'Discharge date', dischargeDateRequired: 'Select the discharge date', retained: 'Status retained', targetClass: 'Target class', targetClassRequired: 'Select the target class', targetClassHint: 'Select an active class in the original major; a change of major requires separate approval.', affectedTerm: 'First affected term', affectedTermRequired: 'Select the first affected term', affectedTermHint: 'Incomplete courses from this term onward will be removed; valid results will be retained.', courseImpact: 'Course impact preview', courseImpactHint: 'The final review recalculates this list. Unpublished or exceptional results require prior review.', course: 'Teaching class', disposition: 'Disposition', impact: { Remove: 'Remove course', RemoveEmptyGrade: 'Remove course and empty grade row', KeepGrade: 'Keep valid result', ReviewRequired: 'Review grade first' } }, performance: { title: 'System performance', description: 'Trace response-time costs from API endpoints into the database.', rangeAria: 'Performance report time range', refreshAria: 'Refresh performance report', notConfigured: 'Waiting for a performance data source', unavailable: 'Performance data is unavailable', fallbackNote: 'Business APIs continue operating normally. The report will not fall back to reading the academic business database.', openDashboard: 'Open monitoring platform', sampleConclusion: 'Sample conclusion', requestCount: 'Total requests', endpointP95: 'Endpoint P95', errorRate: '5xx rate', databaseP95: 'Database P95', slowQueries: 'Slow queries', queryFailures: 'Query failures', chartAria: 'Request rate and endpoint P95 trend', noSamples: 'The data source is connected, but no request metrics were received in this time range.', endpointRanking: 'Endpoint latency ranking', endpointMetrics: 'P95 / requests / 5xx', endpointCounts: '{count} requests · {errors} errors', noEndpoints: 'No endpoint metrics in this range.', databaseRanking: 'Database query ranking', databaseMetrics: 'P95 / calls / slow queries', databaseCounts: '{count} calls · {slow} slow', noDatabase: 'No database metrics in this range.', generatedAt: 'Generated {date} · Page data uses a short cache', viewTraces: 'View raw traces', requestsPerSecond: 'Requests / second', requestRate: 'Request rate', ranges: { '15m': '15 minutes', '1h': '1 hour', '24h': '24 hours', '7d': '7 days' }, notes: { waiting: 'Waiting for metric samples', failedDatabase: 'Database command failures detected', serverErrors: 'Server error rate needs attention', slowQueries: 'Queries exceeded the slow-query threshold', healthy: 'No significant anomalies in the current sample window' }, }, appUpdates: { title: 'App web hot updates', description: 'Upload a built ZIP and publish by native version and channel, retaining previous packages for fast rollback.', refresh: 'Refresh', upload: 'Upload update', boundary: 'Release boundary', webOnly: 'HTML, JavaScript, CSS, and static assets only', nativeBoundary: 'New native plugins, permissions, or Android/iOS code require a new native release', autoRollback: 'The app automatically returns to the last usable version if an update fails', allPlatforms: 'All platforms', allChannels: 'All channels', production: 'Production channel', staging: 'Staging channel', search: 'Search', version: 'Version', nativeVersionValue: 'Native {version}', target: 'Target', status: 'Status', releaseNotes: 'Release notes', bundle: 'Update bundle', time: 'Time', actions: 'Actions', rollback: 'Roll back to this version', publish: 'Publish', delete: 'Delete', active: 'Currently active', empty: 'No App hot-update packages uploaded.', previous: 'Previous batch', page: 'Batch {page}', next: 'Next batch', uploadTitle: 'Upload App hot update', platform: 'Platform', channel: 'Channel', hotVersion: 'Hot-update version', versionPlaceholder: 'For example 1.0.1', compatibleNative: 'Compatible native version', nativePlaceholder: 'Current Android version: 1.0', notesPlaceholder: 'Describe the fixes without including sensitive information.', updateZip: 'Update ZIP', selectZip: 'Select ZIP', zipHint: 'Maximum 30 MB. index.html must be directly in the ZIP root.', cancel: 'Cancel', uploadDraft: 'Upload as draft', confirmRollback: 'Confirm rollback', channels: { Production: 'Production', Staging: 'Staging' }, statuses: { Published: 'Published', Archived: 'Archived', Draft: 'Draft' }, messages: { selectZip: 'Select an update ZIP.', versionRequired: 'Enter the hot-update version and compatible native version.', uploaded: 'Update uploaded as a draft. Review it before publishing.', rollbackConfirm: 'Roll back the {platform} {native} production channel to {version}. Newly started apps will download this version.', publishConfirm: 'Publish {version}? The currently active update for the same platform, channel, and native version will be archived.', rollbackTitle: 'Confirm version rollback', publishTitle: 'Confirm update publication', rolledBack: 'Rolled back to the selected version.', published: 'Update published.', deleteConfirm: 'Permanently delete the {version} release history and ZIP package ({file})? Installed versions are unaffected, and this cannot be recovered.', deleteTitle: 'Delete update package', deleted: 'Release history and update package deleted.' } }, - statusChanges: { studentTitle: 'Student status change application', reviewTitle: 'Student status change review', studentDescription: 'Apply online for suspension, resumption, or withdrawal and track every review stage.', reviewDescription: 'Review applications through counselor, college, and university levels. The final result updates the student record.', apply: 'Start application', refresh: 'Refresh queue', pendingHint: 'An application is currently in progress. Wait for it to be processed.', availableHint: 'You can submit a new student status change application.', availableTypes: 'Available applications', noAvailableTypes: 'No applications are available for the current status', actionable: 'Awaiting my review', total: 'Applications in scope', finished: 'Finished', itemUnit: 'items', securityNote: 'Only actions for the current review level are available. The server rejects every attempt to bypass levels.', applicationTitle: '{name} · {type} application', transition: '{from} → {to} · Submitted {date}', reason: 'Application statement', stepPassed: 'Passed', stepActive: 'In progress', stepWaiting: 'Waiting', latestComment: 'Latest review comment', processId: 'Process ID', cancelApplication: 'Withdraw application', reject: 'Reject', approve: 'Approve', emptyStudent: 'No student status change applications submitted', emptyReviewer: 'No student status change applications in this scope', applyTitle: 'Start student status change application', type: 'Application type', reasonPlaceholder: 'Describe the reason, expected timing, and anything the university should know (at least 10 characters)', cancel: 'Cancel', submit: 'Submit application', approveTitle: 'Approve application', rejectTitle: 'Reject application', optionalComment: 'Review comment (optional)', requiredReason: 'Rejection reason (required)', confirmApprove: 'Confirm approval', confirmReject: 'Confirm rejection', confirmCancel: 'Confirm withdrawal', types: { Suspension: 'Suspension', Resumption: 'Resumption', Withdrawal: 'Withdrawal', Enlistment: 'Enlistment and retained status' }, statuses: { Active: 'Active', Suspended: 'Suspended', Retained: 'Status retained', Withdrawn: 'Withdrawn', Graduated: 'Graduated' }, states: { Submitted: 'Awaiting counselor review', CounselorApproved: 'Awaiting college review', CollegeApproved: 'Awaiting university review', Approved: 'Approved', Rejected: 'Rejected', Cancelled: 'Withdrawn' }, steps: { Submitted: 'Counselor review', CounselorApproved: 'College review', CollegeApproved: 'University approval' }, messages: { invalidApplication: 'Select a change type and enter an application statement of at least 10 characters.', submitted: 'Application submitted for counselor review.', cancelConfirm: 'Withdrawing ends this application. You can submit another one later if needed.', cancelTitle: 'Withdraw application', cancelled: 'Application withdrawn.', commentRequired: 'A review comment is required when rejecting an application.', approved: 'Review approved. The application has moved to the next stage.', rejected: 'Application rejected.' } }, + statusChanges: { studentTitle: 'Student status change application', reviewTitle: 'Student status change review', studentDescription: 'Apply online for suspension, resumption, or withdrawal and track every review stage.', reviewDescription: 'Review applications through counselor, college, and university levels. The final result updates the student record.', apply: 'Start application', refresh: 'Refresh queue', pendingHint: 'An application is currently in progress. Wait for it to be processed.', availableHint: 'You can submit a new student status change application.', availableTypes: 'Available applications', noAvailableTypes: 'No applications are available for the current status', actionable: 'Awaiting my review', total: 'Applications in scope', finished: 'Finished', itemUnit: 'items', securityNote: 'Only actions for the current review level are available. The server rejects every attempt to bypass levels.', applicationTitle: '{name} · {type} application', transition: '{from} → {to} · Submitted {date}', reason: 'Application statement', stepPassed: 'Passed', stepActive: 'In progress', stepWaiting: 'Waiting', latestComment: 'Latest review comment', processId: 'Process ID', cancelApplication: 'Withdraw application', reject: 'Reject', approve: 'Approve', emptyStudent: 'No student status change applications submitted', emptyReviewer: 'No student status change applications in this scope', applyTitle: 'Start student status change application', type: 'Application type', reasonPlaceholder: 'Describe the reason, expected timing, and anything the university should know (at least 10 characters)', cancel: 'Cancel', submit: 'Submit application', approveTitle: 'Approve application', rejectTitle: 'Reject application', optionalComment: 'Review comment (optional)', requiredReason: 'Rejection reason (required)', confirmApprove: 'Confirm approval', confirmReject: 'Confirm rejection', confirmCancel: 'Confirm withdrawal', types: { Suspension: 'Suspension', Resumption: 'Resumption', Withdrawal: 'Withdrawal', Enlistment: 'Enlistment and retained status', Demotion: 'Move to a lower year' }, statuses: { Active: 'Active', Suspended: 'Suspended', Retained: 'Status retained', Withdrawn: 'Withdrawn', Graduated: 'Graduated' }, states: { Submitted: 'Awaiting counselor review', CounselorApproved: 'Awaiting college review', CollegeApproved: 'Awaiting university review', Approved: 'Approved', Rejected: 'Rejected', Cancelled: 'Withdrawn' }, steps: { Submitted: 'Counselor review', CounselorApproved: 'College review', CollegeApproved: 'University approval' }, messages: { invalidApplication: 'Select a change type and enter an application statement of at least 10 characters.', submitted: 'Application submitted for counselor review.', cancelConfirm: 'Withdrawing ends this application. You can submit another one later if needed.', cancelTitle: 'Withdraw application', cancelled: 'Application withdrawn.', commentRequired: 'A review comment is required when rejecting an application.', approved: 'Review approved. The application has moved to the next stage.', rejected: 'Application rejected.' } }, api: { 'data.constraint_conflict': 'A data constraint conflict occurred.', 'server.unhandled_error': 'The server encountered an error while processing the request.', diff --git a/web/src/i18n/messages/zh-CN.ts b/web/src/i18n/messages/zh-CN.ts index f28b9ce..32e63fe 100644 --- a/web/src/i18n/messages/zh-CN.ts +++ b/web/src/i18n/messages/zh-CN.ts @@ -246,12 +246,12 @@ export default { teachingPreferences: { teacherTitle: '授课科目申报', reviewerTitle: '授课资格审核', teacherDescription: '在排课前申报本学期愿意承担的课程,学院审核通过后才能分配公共课教学任务。', reviewerDescription: '审核教师申报,或由学院直接指定教师;通过后进入相应学期和课程的可分配教师池。', apply: '申报课程', assign: '直接分配教师', teacher: '教师', selectTermSubject: '选择学期与科目', college: '学院', reviewAssign: '审核或直接分配', academicOffice: '教务', mergeAssign: '合班并分配教师', scheduling: '排课', generateTimetable: '生成课表', allTerms: '全部学期', allStatuses: '全部状态', refresh: '刷新', total: '共 {count} 条', applicant: '申报教师', course: '申报课程', term: '学期', statement: '申报说明', status: '状态', reviewComment: '审核意见', actions: '操作', withdraw: '撤回', review: '审核', processed: '已处理', emptyTeacher: '尚未申报授课科目', emptyReviewer: '没有待处理的授课申报', submitTitle: '申报授课科目', proposedCourse: '拟授课程', statementPlaceholder: '可填写相关教学经历、研究方向或其他说明', cancel: '取消', submitReview: '提交学院审核', reviewTitle: '审核授课资格', teacherStatement: '教师说明', notProvided: '未填写', conclusion: '审核结论', approve: '通过', reject: '驳回', confirmReview: '确认审核', assignmentTitle: '直接分配授课教师', assignmentHint: '无需教师先申报,保存后立即取得所选学期与课程的授课资格。', teacherPlaceholder: '按工号或姓名选择', courseLabel: '课程', coursePlaceholder: '按编码或名称选择', credits: '{count} 学分', assignmentComment: '分配说明', assignmentPlaceholder: '可填写教研室安排、专业方向等依据', confirmAssign: '确认分配', statuses: { Pending: '待审核', Approved: '已通过', Rejected: '已驳回', Withdrawn: '已撤回' }, messages: { selectTermCourse: '请选择学期和课程。', submitted: '课程申报已提交,等待学院审核。', withdrawConfirm: '撤回“{course}”的授课申报?', withdrawTitle: '撤回申报', approved: '已审核通过。', rejected: '已驳回申报。', selectAll: '请选择学期、教师和课程。', assigned: '授课资格已直接分配。' }, }, - statusChangeImpact: { resumptionTerm: '复学生效学期', resumptionTermHint: '批准后立即生效;休学期间落下的教学班不会自动加入名单。', serviceDate: '入伍日期', serviceDateRequired: '请选择入伍日期', dischargeDate: '退役日期', dischargeDateRequired: '请选择退役日期', retained: '保留学籍', targetClass: '复学目标班级', targetClassRequired: '请选择复学目标班级', targetClassHint: '请选择原专业的有效班级,跨专业调整需另行审批。', affectedTerm: '受影响起始学期', affectedTermRequired: '请选择受影响起始学期', affectedTermHint: '该学期及之后未完成的课程将退出;已形成有效成绩的课程保留。', courseImpact: '课程影响预览', courseImpactHint: '终审时会重新计算。未发布或异常成绩需先由教务处理。', course: '教学班', disposition: '处理方式', impact: { Remove: '退出课程', RemoveEmptyGrade: '退出课程并移除空白成绩行', KeepGrade: '保留有效成绩', ReviewRequired: '成绩需先处理' } }, + statusChangeImpact: { classTransition: '班级变化', demotionTermHint: '退出原班级独有的未完成教学班;两班共用的教学班和独立选修课保留。', resumptionTerm: '复学生效学期', resumptionTermHint: '批准后立即生效;休学期间落下的教学班不会自动加入名单。', serviceDate: '入伍日期', serviceDateRequired: '请选择入伍日期', dischargeDate: '退役日期', dischargeDateRequired: '请选择退役日期', retained: '保留学籍', targetClass: '目标班级', targetClassRequired: '请选择目标班级', targetClassHint: '请选择原专业的有效班级,跨专业调整需另行审批。', affectedTerm: '受影响起始学期', affectedTermRequired: '请选择受影响起始学期', affectedTermHint: '该学期及之后未完成的课程将退出;已形成有效成绩的课程保留。', courseImpact: '课程影响预览', courseImpactHint: '终审时会重新计算。未发布或异常成绩需先由教务处理。', course: '教学班', disposition: '处理方式', impact: { Remove: '退出课程', RemoveEmptyGrade: '退出课程并移除空白成绩行', KeepGrade: '保留有效成绩', ReviewRequired: '成绩需先处理' } }, performance: { title: '系统性能', description: '从接口进入数据库,定位响应时间消耗在哪里。', rangeAria: '性能报表时间范围', refreshAria: '刷新性能报表', notConfigured: '等待连接性能数据源', unavailable: '性能数据暂不可用', fallbackNote: '业务接口继续正常运行;报表不会回退读取教务业务数据库。', openDashboard: '打开监控平台', sampleConclusion: '采样结论', requestCount: '请求总量', endpointP95: '接口 P95', errorRate: '5xx 比例', databaseP95: '数据库 P95', slowQueries: '慢查询', queryFailures: '查询失败', chartAria: '请求速率与接口 P95 趋势图', noSamples: '数据源已连接,但该时间范围内尚未收到请求指标。', endpointRanking: '接口耗时排行', endpointMetrics: 'P95 / 请求量 / 5xx', endpointCounts: '{count} 次 · {errors} 错误', noEndpoints: '该范围内没有接口指标。', databaseRanking: '数据库查询排行', databaseMetrics: 'P95 / 调用量 / 慢查询', databaseCounts: '{count} 次 · {slow} 慢', noDatabase: '该范围内没有数据库指标。', generatedAt: '生成于 {date} · 页面数据采用短时缓存', viewTraces: '查看原始调用链', requestsPerSecond: '请求 / 秒', requestRate: '请求速率', ranges: { '15m': '15 分钟', '1h': '1 小时', '24h': '24 小时', '7d': '7 天' }, notes: { waiting: '等待指标样本', failedDatabase: '存在失败的数据库命令', serverErrors: '服务端错误率需要关注', slowQueries: '存在超过阈值的慢查询', healthy: '当前采样窗口内未见明显异常' }, }, appUpdates: { title: 'App 前端热更新', description: '上传构建后的 ZIP,按原生版本和通道发布;保留历史包用于快速回滚。', refresh: '刷新', upload: '上传更新包', boundary: '发布边界', webOnly: '仅限 HTML、JavaScript、CSS 和静态资源', nativeBoundary: '新增原生插件、权限或 Android/iOS 代码必须重新发版', autoRollback: '更新失败时 App 自动回退到上一个可用版本', allPlatforms: '全部平台', allChannels: '全部通道', production: '正式通道', staging: '测试通道', search: '查询', version: '版本', nativeVersionValue: '原生 {version}', target: '目标', status: '状态', releaseNotes: '更新说明', bundle: '更新包', time: '时间', actions: '操作', rollback: '回滚至此版本', publish: '发布', delete: '删除', active: '当前生效', empty: '尚未上传 App 热更新包。', previous: '上一批', page: '第 {page} 批', next: '下一批', uploadTitle: '上传 App 热更新包', platform: '平台', channel: '通道', hotVersion: '热更新版本', versionPlaceholder: '例如 1.0.1', compatibleNative: '兼容的原生版本', nativePlaceholder: '当前 Android 为 1.0', notesPlaceholder: '说明本次修复内容,不要包含敏感信息。', updateZip: '更新 ZIP', selectZip: '选择 ZIP', zipHint: '最大 30 MB,ZIP 根目录必须直接包含 index.html。', cancel: '取消', uploadDraft: '上传为草稿', confirmRollback: '确认回滚', channels: { Production: '正式', Staging: '测试' }, statuses: { Published: '已发布', Archived: '已归档', Draft: '草稿' }, messages: { selectZip: '请选择更新 ZIP。', versionRequired: '请填写热更新版本和兼容的原生版本。', uploaded: '更新包已上传为草稿,确认无误后再发布。', rollbackConfirm: '将把 {platform} {native} 的正式通道回滚到 {version}。新启动的 App 将下载此版本。', publishConfirm: '确认发布 {version}?同平台、通道和原生版本下当前生效的更新将自动归档。', rollbackTitle: '确认版本回滚', publishTitle: '确认发布更新', rolledBack: '已回滚到指定版本。', published: '更新已发布。', deleteConfirm: '将永久删除 {version} 的发布历史和 ZIP 更新包({file})。此操作不会影响已安装到设备的版本,且不可恢复。', deleteTitle: '删除更新包', deleted: '发布历史和更新包已删除。' } }, - statusChanges: { studentTitle: '学籍异动申请', reviewTitle: '学籍异动审核', studentDescription: '在线办理休学、复学或退学申请,清晰跟踪每一级审核进度。', reviewDescription: '按辅导员、学院、学校三级权限逐级审核,最终结果同步学生学籍。', apply: '发起申请', refresh: '刷新队列', pendingHint: '当前有申请正在流转,请等待处理。', availableHint: '当前可以提交新的学籍异动申请。', availableTypes: '可申请业务', noAvailableTypes: '当前状态无可申请业务', actionable: '当前待我审核', total: '辖区申请总数', finished: '已结束', itemUnit: '件', securityNote: '系统仅开放当前审核层级的操作,所有越级请求都会由服务端拒绝。', applicationTitle: '{name} · {type}申请', transition: '{from} → {to} · 提交于 {date}', reason: '申请说明', stepPassed: '已通过', stepActive: '处理中', stepWaiting: '待流转', latestComment: '最近审核意见', processId: '流程编号', cancelApplication: '撤回申请', reject: '驳回', approve: '审核通过', emptyStudent: '尚未提交学籍异动申请', emptyReviewer: '当前辖区暂无学籍异动申请', applyTitle: '发起学籍异动申请', type: '申请类型', reasonPlaceholder: '请说明申请原因、预计时间以及需要学校了解的情况(至少 10 个字)', cancel: '取消', submit: '提交申请', approveTitle: '审核通过', rejectTitle: '驳回申请', optionalComment: '审核意见(选填)', requiredReason: '驳回原因(必填)', confirmApprove: '确认通过', confirmReject: '确认驳回', confirmCancel: '确认撤回', types: { Suspension: '休学', Resumption: '复学', Withdrawal: '退学', Enlistment: '入伍保留学籍' }, statuses: { Active: '在籍', Suspended: '休学', Retained: '保留学籍', Withdrawn: '退学', Graduated: '毕业' }, states: { Submitted: '待辅导员审核', CounselorApproved: '待学院审核', CollegeApproved: '待校级审核', Approved: '已批准', Rejected: '已驳回', Cancelled: '已撤回' }, steps: { Submitted: '辅导员审核', CounselorApproved: '学院审核', CollegeApproved: '校级审批' }, messages: { invalidApplication: '请选择异动类型,并填写至少 10 个字的申请说明。', submitted: '申请已提交,等待辅导员审核。', cancelConfirm: '撤回后本次申请将结束,需要时可重新提交。', cancelTitle: '撤回申请', cancelled: '申请已撤回。', commentRequired: '驳回申请时必须填写审核意见。', approved: '审核已通过,申请进入下一环节。', rejected: '申请已驳回。' } }, + statusChanges: { studentTitle: '学籍异动申请', reviewTitle: '学籍异动审核', studentDescription: '在线办理休学、复学或退学申请,清晰跟踪每一级审核进度。', reviewDescription: '按辅导员、学院、学校三级权限逐级审核,最终结果同步学生学籍。', apply: '发起申请', refresh: '刷新队列', pendingHint: '当前有申请正在流转,请等待处理。', availableHint: '当前可以提交新的学籍异动申请。', availableTypes: '可申请业务', noAvailableTypes: '当前状态无可申请业务', actionable: '当前待我审核', total: '辖区申请总数', finished: '已结束', itemUnit: '件', securityNote: '系统仅开放当前审核层级的操作,所有越级请求都会由服务端拒绝。', applicationTitle: '{name} · {type}申请', transition: '{from} → {to} · 提交于 {date}', reason: '申请说明', stepPassed: '已通过', stepActive: '处理中', stepWaiting: '待流转', latestComment: '最近审核意见', processId: '流程编号', cancelApplication: '撤回申请', reject: '驳回', approve: '审核通过', emptyStudent: '尚未提交学籍异动申请', emptyReviewer: '当前辖区暂无学籍异动申请', applyTitle: '发起学籍异动申请', type: '申请类型', reasonPlaceholder: '请说明申请原因、预计时间以及需要学校了解的情况(至少 10 个字)', cancel: '取消', submit: '提交申请', approveTitle: '审核通过', rejectTitle: '驳回申请', optionalComment: '审核意见(选填)', requiredReason: '驳回原因(必填)', confirmApprove: '确认通过', confirmReject: '确认驳回', confirmCancel: '确认撤回', types: { Suspension: '休学', Resumption: '复学', Withdrawal: '退学', Enlistment: '入伍保留学籍', Demotion: '降级' }, statuses: { Active: '在籍', Suspended: '休学', Retained: '保留学籍', Withdrawn: '退学', Graduated: '毕业' }, states: { Submitted: '待辅导员审核', CounselorApproved: '待学院审核', CollegeApproved: '待校级审核', Approved: '已批准', Rejected: '已驳回', Cancelled: '已撤回' }, steps: { Submitted: '辅导员审核', CounselorApproved: '学院审核', CollegeApproved: '校级审批' }, messages: { invalidApplication: '请选择异动类型,并填写至少 10 个字的申请说明。', submitted: '申请已提交,等待辅导员审核。', cancelConfirm: '撤回后本次申请将结束,需要时可重新提交。', cancelTitle: '撤回申请', cancelled: '申请已撤回。', commentRequired: '驳回申请时必须填写审核意见。', approved: '审核已通过,申请进入下一环节。', rejected: '申请已驳回。' } }, api: { 'data.constraint_conflict': '数据约束冲突。', 'server.unhandled_error': '服务器处理请求时发生错误。', diff --git a/web/src/views/StudentStatusChangesView.vue b/web/src/views/StudentStatusChangesView.vue index be41bab..6d7977d 100644 --- a/web/src/views/StudentStatusChangesView.vue +++ b/web/src/views/StudentStatusChangesView.vue @@ -1,5 +1,5 @@