diff --git a/web/scripts/check-i18n.mjs b/web/scripts/check-i18n.mjs index 27d68e3..b34a9d3 100644 --- a/web/scripts/check-i18n.mjs +++ b/web/scripts/check-i18n.mjs @@ -16,7 +16,7 @@ const missing = [...reference].filter((key) => !candidate.has(key)) const extra = [...candidate].filter((key) => !reference.has(key)) // Fully migrated pages must not silently reintroduce hardcoded Chinese UI copy. -const completedViews = ['CoursesView.vue', 'OtherExamsView.vue', 'BaseDataView.vue', 'OfficialDocumentsView.vue'] +const completedViews = ['CoursesView.vue', 'OtherExamsView.vue', 'BaseDataView.vue', 'OfficialDocumentsView.vue', 'CampusRegistrationsView.vue'] const hardcoded = completedViews.filter((name) => { const file = fileURLToPath(new URL(`../src/views/${name}`, import.meta.url)) let source = readFileSync(file, 'utf8') diff --git a/web/src/i18n/messages/en-US.ts b/web/src/i18n/messages/en-US.ts index 7a03ef2..acd281a 100644 --- a/web/src/i18n/messages/en-US.ts +++ b/web/src/i18n/messages/en-US.ts @@ -1,4 +1,5 @@ export default { + campusRegistration: {"pendingReview":"Pending review","pendingPayment":"Awaiting payment","confirmed":"Confirmed","waitlisted":"Waitlisted","rejected":"Rejected","cancelled":"Cancelled","draft":"Draft","published":"Published","closed":"Closed","free":"Free","unknown":"Unknown status","projectSaved":"Project saved","noteOptional":"Optional: enter an application note","note":"Application note","applicationSubmitted":"Application submitted","approvePrompt":"Approval creates a payment order or confirms a free registration.","rejectPrompt":"Enter the rejection reason","approveTitle":"Approve registration","rejectTitle":"Reject registration","optionalComment":"Optional review comment","rejectReason":"Rejection reason","processed":"Processing complete","offlinePrompt":"Enter the offline payment reference (optional)","offlineTitle":"Confirm offline payment","paymentConfirmed":"Payment and registration confirmed","cancelPrompt":"This cannot be undone. Continue?","cancelTitle":"Cancel registration","applicationCancelled":"Registration cancelled","balanceTitle":"Pay with balance","balancePaid":"Balance payment succeeded and registration was confirmed","exportFile":"Campus registrations and payments.xlsx","title":"Campus payments and registrations","description":"Manage registration, review, offline payment confirmation, and roster export in one workflow.","newProject":"New registration project","projects":"Registration projects","noDescription":"No project description.","registrationPeriod":"Registration period","capacityConfirmed":"Capacity / Confirmed","fee":"Fee","requiresReview":"· Requires review","automatic":"· Automatic acceptance","applyNow":"Register now","unavailable":"Registration unavailable","editProject":"Edit project","noProjects":"No visible registration projects","myOrders":"My registrations and orders","balance":"Campus balance","balanceHint":"Administrators manage the balance, which can be used to pay pending registration fees.","project":"Project","order":"Order","offline":"Offline payment","awaitingConfirmation":"Awaiting confirmation","noApplications":"No registrations submitted","reviewPayments":"Review and payments","scopeNote":"All actions are limited to the data scope of the project’s college.","allProjects":"All projects","projectStudent":"Project and student","registrationStatus":"Registration status","submittedAt":"Submitted at","confirmPayment":"Confirm payment","noHistory":"No pending or historical registrations","editProjectTitle":"Edit registration project","projectCode":"Project code","codePlaceholder":"For example CAMPUS-2026-001","projectName":"Project name","registrationStarts":"Registration starts","registrationEnds":"Registration ends","capacity":"Capacity","feeAmount":"Fee (CNY)","projectDescription":"Project description","acceptance":"Acceptance method","manualReview":"Accept after manual review","directAcceptance":"Accept directly","publishStatus":"Publication status","contact":"Contact","adminNotes":"Administrative notes","applyTitle":"Register: {name}","balanceConfirm":"Deduct {amount} from your campus balance?","dateRange":"{start} to {end}","capacityCount":"{capacity} / {confirmed} people"}, warningsPage: {"failed":"Failed-course credits","lowGpa":"Low GPA","absence":"Absence","delay":"Delayed graduation risk","active":"Active","acknowledged":"Acknowledged","processed":"Processed","ignored":"Ignored","failedUnit":" failed courses","gpaThreshold":"Minimum GPA","absenceUnit":" absences / late arrivals","cumulativeUnit":" cumulative failed courses","daily":"Every day","monday":"Monday","tuesday":"Tuesday","wednesday":"Wednesday","thursday":"Thursday","friday":"Friday","saturday":"Saturday","sunday":"Sunday","exportFile":"Academic warnings.xlsx","rulesSaved":"Warning rules saved","detectConfirm":"The system will scan all currently enrolled students in the current term and notify students and counselors of generated warnings.","detectTitle":"Run academic warning detection","detectStart":"Start detection","acknowledgePrompt":"Acknowledge this warning? You can optionally add a comment.","acknowledgeTitle":"Acknowledge warning","confirm":"Confirm","confirmed":"Acknowledged","taskUpdated":"Follow-up task updated","contentRequired":"Enter the record content","entrySaved":"Intervention record saved","studentTitle":"My warnings","managerTitle":"Academic warnings","managerDescription":"Configure warning rules, run detection, and review warnings.","counselorDescription":"View academic warnings for assigned students.","studentDescription":"View and acknowledge your academic warning notifications.","rulesTitle":"Warning rules","saveRules":"Save rules","runDetection":"Run detection","threshold":"Threshold","toggle":"Enabled","student":"Student","autoDetection":"Automatic detection","every":"Every","hour":"hour","minute":"minute","recordsTitle":"Warning records","studentSearch":"Name / Student number","organization":"Organization","details":"Threshold / Details","emptyRecords":"No warning records. Run detection first.","riskTitle":"Risk intervention follow-up","privacyHint":"Interview and support records are sensitive and visible only to assigned counselors and academic administrators.","warningType":"Warning type","followUpDue":"Follow-up deadline","reviewDate":"Review date","unset":"Not set","pendingFollowUp":"Pending follow-up","inProgress":"In progress","pendingReview":"Pending review","closed":"Closed","intervene":"Manage","emptyTasks":"No risk tasks require follow-up","emptyWarnings":"No academic warnings","mySupport":"My support and review progress","mySupportHint":"View your counselor’s interview, support, and review records.","unscheduled":"Not scheduled","interview":"Interview","support":"Support measure","reviewEntry":"Review","emptyEntries":"Your counselor has not entered intervention records","riskDialog":"Academic risk intervention (sensitive)","followUpStatus":"Follow-up status","saveTask":"Save task","addEntry":"Add intervention record","entryType":"Record type","occurredAt":"Date and time","content":"Content","entryPlaceholder":"Record interview points, support measures, or review conclusions","history":"Intervention history","detected":"Detection complete: {count} warnings generated","grade":"Enrolled {year}","page":"Batch {page}","pendingCount":"Pending {count}","lastRun":"Last run: {date}","followUpValue":"Follow-up deadline: {date}","reviewValue":"Review date: {date}","recordedBy":"Recorded by: {name}"}, officialDocuments: {"transcript":"Official electronic transcript","certificate":"Student status certificate","valid":"Valid","invalidated":"Invalidated","superseded":"Reissued","selectStudent":"Select a student.","reused":"Your recently requested valid document has been retained.","issued":"Official document issued.","generated":"The electronic document is ready to download from the list.","invalidatePrompt":"After invalidation, students cannot download the document; verification of downloaded copies will show it as invalid. Enter a reason.","confirmInvalidate":"Confirm invalidation","reasonLength":"The reason must contain 2–500 characters","invalidateSuccess":"Document invalidated.","reissuePrompt":"The original will be frozen and a new number and QR code generated using current official data. Enter the reason for reissue.","reissueTitle":"Reissue document","confirmReissue":"Confirm reissue","reissueSuccess":"A new document was issued and the original marked as superseded.","managerTitle":"Official document issuance","studentTitle":"Electronic transcripts and certificates","managerDescription":"The server preserves an issuance snapshot and PDF. Each document has a unique number and a publicly verifiable QR code.","studentDescription":"Request a PDF online and use its QR code for public verification.","issueNew":"Issue new document","request":"Request electronic document","uniqueNumber":"Unique number","uniqueHint":"Each issuance has a unique number","qr":"QR verification","qrHint":"Shows current validity","downloadTracking":"Download audit","downloadHint":"Time, account and source are recorded","lifecycle":"Invalidation and reissue","lifecycleHint":"The original document history is retained","allTypes":"All document types","missingReason":"No reason provided","downloadPdf":"Download PDF","invalidate":"Invalidate","reissue":"Reissue","emptyManager":"No official documents match the filters","emptyStudent":"No electronic documents yet. Use the button above to request one.","issueTitle":"Issue official document","managerNotice":"Issuance preserves the current official data. Subsequent changes do not alter issued documents.","studentNotice":"The document is generated from your student record. Transcripts include only officially published grades. Identical requests within five minutes reuse the existing file.","student":"Student","searchStudent":"Search by name or student number","documentType":"Document type","purpose":"Purpose (optional)","purposeHint":"For example, further study or internship applications","confirmIssue":"Confirm issuance","submitRequest":"Submit request","history":"Document download history","downloadedBy":"Downloaded by","downloadTime":"Download time","sourceIp":"Source IP","emptyHistory":"No download history","total":"{count} documents","issuedBy":"Issued {date} · {name}","purposeValue":"Purpose: {purpose}","downloadCount":"Download history ({count})","statusReason":"{status}: {reason}"}, baseData: {"campus":"Campus","campusHint":"Physical university campuses","college":"College","collegeHint":"Teaching organizations","major":"Major","majorHint":"Majors and awarded degrees","class":"Administrative class","classHint":"Classes organized by enrollment year","term":"Term","termHint":"Teaching timeline","building":"Teaching building","buildingHint":"Teaching buildings on campus","classroom":"Classroom","classroomHint":"Teaching spaces available for scheduling","category":"Course category","categoryHint":"Teaching field of a course","organization":"Organizations","organizationDescription":"Maintain the hierarchy of campuses, colleges, majors, and administrative classes.","academicTerms":"Academic years and terms","termDescription":"Maintain academic years, term boundaries, and the current working term.","facilities":"Teaching facilities","facilitiesDescription":"Maintain classrooms available for scheduling by campus and building.","categoryDescription":"Maintain teaching fields including foundational studies, arts, ethics, innovation, and entrepreneurship. Course nature and category are independent.","generalRoom":"General classroom","laboratory":"Laboratory","training":"Training room","computerLab":"Computer lab","languageLab":"Language lab","sports":"Sports venue","arts":"Arts venue","unset":"Not set","bachelor":"Bachelor","confirmImport":"Confirm import","import":"Import","cancel":"Cancel","requiredFields":"Enter the code and name.","saved":"Changes saved","deleteTitle":"Confirm deletion","delete":"Delete","deleted":"Deleted","switchTerm":"Switch current term","switchCurrent":"Set as current","tabsAria":"Base data categories","allArchive":"All archive statuses","unarchived":"Not archived","archived":"Archived","search":"Search code, name, or parent organization","enrollmentYear":"Enrollment year","allCampuses":"All campuses","allBuildings":"All teaching buildings","venueNature":"Venue nature","minimumCapacity":"Minimum capacity","disabled":"Disabled","excelImport":"Import Excel","export":"Export results","switchHint":"Switching the current term changes only the default working term. Archive manually; makeup exams and grade corrections remain available after archiving.","selectTerms":"Select terms","archiveMany":"Archive selected","restoreMany":"Restore selected","current":"Current","historical":"Historical term","setCurrent":"Set as current","unarchive":"Unarchive","archive":"Archive","archiveHistory":"Archive history","viewHistory":"View history","code":"Code","name":"Name","parentCampus":"Campus","parentCollege":"College","degreeType":"Degree type","parentMajor":"Major","counselor":"Counselor","unassigned":"Unassigned","academicYear":"Academic year","operationalStatus":"Operational status","floor":"Floor","enabled":"Enabled","empty":"No data yet. Use the button at the top right to add an item.","edit":"Edit","add":"Add","unique":"Unique identifier","address":"Address","shortName":"College short name","schoolingYears":"Program duration in years","counselorAccount":"Counselor account","season":"Term season","autumn":"Autumn term","spring":"Spring term","summer":"Summer term","setCurrentTerm":"Set as current term","unarchiveFirst":"Unarchive the term first.","parentBuilding":"Teaching building","locatedFloor":"Floor","roomType":"Classroom type","teachingVenueNature":"Teaching venue nature","equipment":"Equipment","sort":"Sort order","templateFile":"{title}-import template.xlsx","exported":"{title} exported","importConfirm":"Preview passed: {created} new records, {updated} updates, {total} records in total. Import now?","imported":"Import complete: {created} added, {updated} updated","created":"{title} added","deleteConfirm":"Delete “{name}”? Data referenced by business records cannot be deleted.","switchConfirm":"Set “{name}” as the current term? Other terms will display as historical but will not be archived, and grades and makeup exams will remain editable.","switched":"Current term switched to “{name}”","addTitle":"Add {title}","editTitle":"Edit {title}","total":"{count} records","floorNumber":"Floor {floor}","listSeparator":", "}, diff --git a/web/src/i18n/messages/zh-CN.ts b/web/src/i18n/messages/zh-CN.ts index af86562..09ded60 100644 --- a/web/src/i18n/messages/zh-CN.ts +++ b/web/src/i18n/messages/zh-CN.ts @@ -1,4 +1,5 @@ export default { + campusRegistration: {"pendingReview":"待审核","pendingPayment":"待缴费","confirmed":"已确认","waitlisted":"候补中","rejected":"已驳回","cancelled":"已取消","draft":"草稿","published":"已发布","closed":"已关闭","free":"免费","unknown":"未知状态","projectSaved":"项目已保存","noteOptional":"可选:填写报名说明","note":"报名说明","applicationSubmitted":"报名已提交","approvePrompt":"审核通过后将生成缴费订单或直接确认免费报名。","rejectPrompt":"请填写驳回原因","approveTitle":"通过报名","rejectTitle":"驳回报名","optionalComment":"可选审核意见","rejectReason":"驳回原因","processed":"处理完成","offlinePrompt":"填写线下收款凭据编号(可选)","offlineTitle":"确认线下缴费","paymentConfirmed":"已确认收款和报名","cancelPrompt":"撤销后不可恢复,确定继续吗?","cancelTitle":"撤销报名","applicationCancelled":"报名已撤销","balanceTitle":"余额支付","balancePaid":"余额支付成功,报名已确认","exportFile":"校园报名与缴费.xlsx","title":"校园支付与报名","description":"报名、审核、线下缴费确认和名单导出在同一闭环内完成。","newProject":"新建报名项目","projects":"报名项目","noDescription":"暂无项目说明。","registrationPeriod":"报名时间","capacityConfirmed":"名额 / 已确认","fee":"费用","requiresReview":"· 需审核","automatic":"· 自动受理","applyNow":"立即报名","unavailable":"当前不可报名","editProject":"编辑项目","noProjects":"暂无可见报名项目","myOrders":"我的报名与订单","balance":"校园余额","balanceHint":"余额由管理员调整,可用于支付待缴费报名。","project":"项目","order":"订单","offline":"线下缴费","awaitingConfirmation":"待确认","noApplications":"尚未提交报名","reviewPayments":"审核与收款","scopeNote":"所有操作均按项目所属学院的数据范围限制。","allProjects":"全部项目","projectStudent":"项目与学生","registrationStatus":"报名状态","submittedAt":"提交时间","confirmPayment":"确认收款","noHistory":"暂无待处理或历史报名","editProjectTitle":"编辑报名项目","projectCode":"项目编码","codePlaceholder":"如 CAMPUS-2026-001","projectName":"项目名称","registrationStarts":"报名开始","registrationEnds":"报名结束","capacity":"名额","feeAmount":"收费金额(元)","projectDescription":"项目说明","acceptance":"受理方式","manualReview":"人工审核后受理","directAcceptance":"直接受理","publishStatus":"发布状态","contact":"联系人","adminNotes":"管理备注","applyTitle":"报名:{name}","balanceConfirm":"将从校园余额扣除 {amount},确定支付吗?","dateRange":"{start} 至 {end}","capacityCount":"{capacity} / {confirmed} 人"}, warningsPage: {"failed":"不及格学分","lowGpa":"低绩点","absence":"缺勤","delay":"延毕风险","active":"生效中","acknowledged":"已确认","processed":"已处理","ignored":"已忽略","failedUnit":"门 不及格","gpaThreshold":"GPA 下限","absenceUnit":"次 缺勤/迟到","cumulativeUnit":"门 累计不及格","daily":"每天","monday":"周一","tuesday":"周二","wednesday":"周三","thursday":"周四","friday":"周五","saturday":"周六","sunday":"周日","exportFile":"学业预警记录.xlsx","rulesSaved":"预警规则已保存","detectConfirm":"系统将扫描当前学期全部在籍学生,产生的预警将自动通知学生及辅导员。","detectTitle":"执行学业预警检测","detectStart":"开始检测","acknowledgePrompt":"确认已知晓此预警?(可选填备注)","acknowledgeTitle":"确认预警","confirm":"确认","confirmed":"已确认","taskUpdated":"跟进任务已更新","contentRequired":"请填写记录内容","entrySaved":"处置记录已保存","studentTitle":"我的预警","managerTitle":"学业预警","managerDescription":"配置预警规则,执行检测,查看预警记录。","counselorDescription":"查看所管学生的学业预警情况。","studentDescription":"查看并确认您的学业预警通知。","rulesTitle":"预警规则配置","saveRules":"保存规则","runDetection":"执行检测","threshold":"阈值","toggle":"开关","student":"学生","autoDetection":"自动检测","every":"每","hour":"时","minute":"分","recordsTitle":"预警记录","studentSearch":"姓名 / 学号","organization":"组织信息","details":"阈值/详情","emptyRecords":"暂无预警记录,请先执行检测。","riskTitle":"风险处置跟进","privacyHint":"谈话和帮扶记录为敏感信息,仅被指派辅导员和学业管理人员可见。","warningType":"预警类型","followUpDue":"跟进截止","reviewDate":"复核日期","unset":"待设置","pendingFollowUp":"待跟进","inProgress":"跟进中","pendingReview":"待复核","closed":"已结案","intervene":"处置","emptyTasks":"暂无需要跟进的风险任务","emptyWarnings":"暂无学业预警","mySupport":"我的帮扶与复核进度","mySupportHint":"这里展示辅导员针对本人的谈话、帮扶和复核记录。","unscheduled":"待安排","interview":"谈话记录","support":"帮扶措施","reviewEntry":"复核记录","emptyEntries":"辅导员暂未填写处置记录","riskDialog":"学业风险处置(敏感)","followUpStatus":"跟进状态","saveTask":"保存任务","addEntry":"新增处置记录","entryType":"记录类别","occurredAt":"发生时间","content":"内容","entryPlaceholder":"记录谈话要点、帮扶措施或复核结论","history":"处置历史","detected":"检测完成,生成 {count} 条预警","grade":"{year}级","page":"第 {page} 批","pendingCount":"待办 {count}","lastRun":"上次: {date}","followUpValue":"跟进截止:{date}","reviewValue":"复核日期:{date}","recordedBy":"记录人:{name}"}, officialDocuments: {"transcript":"官方电子成绩单","certificate":"学籍状态证明","valid":"有效","invalidated":"已失效","superseded":"已重签","selectStudent":"请选择学生。","reused":"已为你保留刚申请的同类有效凭证。","issued":"官方凭证已签发。","generated":"电子凭证已生成,可在列表中下载。","invalidatePrompt":"失效后学生不能再下载,但已下载文件仍可扫码看到“已失效”。请输入原因。","confirmInvalidate":"确认失效","reasonLength":"原因需为 2-500 个字符","invalidateSuccess":"凭证已失效。","reissuePrompt":"系统会冻结原凭证并按当前正式数据生成新编号和新二维码。请输入重签原因。","reissueTitle":"重签凭证","confirmReissue":"确认重签","reissueSuccess":"新凭证已签发,原凭证已标记为被替代。","managerTitle":"官方凭证签发中心","studentTitle":"电子成绩单与证明","managerDescription":"服务端固化签发快照和 PDF,凭证编号唯一,二维码可公开验真。","studentDescription":"在线申请后即时生成,可下载 PDF,并通过二维码公开验真。","issueNew":"签发新凭证","request":"申请电子凭证","uniqueNumber":"唯一编号","uniqueHint":"每次签发独立编号","qr":"二维码验真","qrHint":"实时显示有效状态","downloadTracking":"下载留痕","downloadHint":"时间、账号与来源可追溯","lifecycle":"失效与重签","lifecycleHint":"旧凭证保留完整链路","allTypes":"全部凭证类型","missingReason":"未填写原因","downloadPdf":"下载 PDF","invalidate":"设为失效","reissue":"重签","emptyManager":"暂无符合条件的官方凭证","emptyStudent":"暂无电子凭证,可点击上方按钮在线申请","issueTitle":"签发官方凭证","managerNotice":"签发后将固化当前正式数据;后续数据修改不会悄悄改变已签发文件。","studentNotice":"系统将按你的学籍档案即时生成;成绩单仅包含已正式发布的成绩,5 分钟内重复申请同类型、同用途凭证将复用已有文件。","student":"学生","searchStudent":"按姓名或学号搜索","documentType":"凭证类型","purpose":"用途(可选)","purposeHint":"例如:升学申请、实习材料","confirmIssue":"确认签发","submitRequest":"提交申请","history":"凭证下载记录","downloadedBy":"下载人","downloadTime":"下载时间","sourceIp":"来源 IP","emptyHistory":"尚无下载记录","total":"共 {count} 份凭证","issuedBy":"签发于 {date} · {name}","purposeValue":"用途:{purpose}","downloadCount":"下载记录({count})","statusReason":"{status}:{reason}"}, baseData: {"campus":"校区","campusHint":"学校的物理校区","college":"学院","collegeHint":"教学组织单位","major":"专业","majorHint":"专业与授予学位","class":"行政班","classHint":"按年级组织的班级","term":"学期","termHint":"教学运行时间轴","building":"教学楼","buildingHint":"校区内教学建筑","classroom":"教室","classroomHint":"可排课教学空间","category":"课程分类","categoryHint":"课程所属教学领域","organization":"组织机构","organizationDescription":"维护校区、学院、专业与行政班的稳定组织层级。","academicTerms":"学年学期","termDescription":"集中维护教学年度、学期边界与当前运行学期。","facilities":"教学场所","facilitiesDescription":"按校区和教学楼维护可用于排课的教室资源。","categoryDescription":"统一维护基础课、美育、德育、创新创业等课程教学领域。课程性质与课程分类相互独立。","generalRoom":"普通教室","laboratory":"实验室","training":"实训室","computerLab":"计算机机房","languageLab":"语音室","sports":"体育场地","arts":"艺术场地","unset":"未设置","bachelor":"学士","confirmImport":"确认导入","import":"正式导入","cancel":"取消","requiredFields":"请填写编码和名称。","saved":"已保存修改","deleteTitle":"删除确认","delete":"删除","deleted":"已删除","switchTerm":"切换当前学期","switchCurrent":"切换为当前","tabsAria":"基础数据分类","allArchive":"全部归档状态","unarchived":"未归档","archived":"已归档","search":"搜索编码、名称或所属单位","enrollmentYear":"入学年级","allCampuses":"全部校区","allBuildings":"全部教学楼","venueNature":"场地性质","minimumCapacity":"最小容量","disabled":"停用","excelImport":"Excel 导入","export":"导出结果","switchHint":"切换当前学期只改变默认工作学期;归档需手动执行,归档后仍可处理补考与成绩更正。","selectTerms":"选择学期","archiveMany":"批量归档","restoreMany":"批量恢复","current":"当前","historical":"历史学期","setCurrent":"设为当前","unarchive":"撤销归档","archive":"归档","archiveHistory":"归档历史","viewHistory":"查看历史","code":"编码","name":"名称","parentCampus":"所属校区","parentCollege":"所属学院","degreeType":"学位类型","parentMajor":"所属专业","counselor":"辅导员","unassigned":"未分配","academicYear":"学年","operationalStatus":"运行状态","floor":"楼层","enabled":"启用","empty":"暂无数据,点击右上角开始新增","edit":"编辑","add":"新增","unique":"用于唯一识别","address":"地址","shortName":"学院简称","schoolingYears":"学制","counselorAccount":"辅导员账号","season":"学期季","autumn":"秋季学期","spring":"春季学期","summer":"夏季学期","setCurrentTerm":"设为当前学期","unarchiveFirst":"已归档学期需先撤销归档。","parentBuilding":"所属教学楼","locatedFloor":"所在楼层","roomType":"教室类型","teachingVenueNature":"教学场地性质","equipment":"设备","sort":"排序","templateFile":"{title}导入模板.xlsx","exported":"{title}已导出","importConfirm":"预检通过:将新增 {created} 条、更新 {updated} 条,共处理 {total} 条。确认正式导入?","imported":"导入完成:新增 {created} 条,更新 {updated} 条","created":"已新增{title}","deleteConfirm":"确定删除“{name}”吗?已被业务引用的数据将无法删除。","switchConfirm":"将“{name}”切换为当前学期?其他学期会自动转为历史显示,但不会自动归档,也不会冻结成绩和补考。","switched":"当前学期已切换为“{name}”","addTitle":"新增{title}","editTitle":"编辑{title}","total":"共 {count} 条","floorNumber":"{floor} 层","listSeparator":"、"}, diff --git a/web/src/views/CampusRegistrationsView.vue b/web/src/views/CampusRegistrationsView.vue index b08e1b7..fed95da 100644 --- a/web/src/views/CampusRegistrationsView.vue +++ b/web/src/views/CampusRegistrationsView.vue @@ -23,13 +23,14 @@ const applicationProjectId = ref('') const applicationStatusFilter = ref('') const balance = ref(0) const form = reactive({ code: '', name: '', description: '', registrationStartsAt: '', registrationEndsAt: '', capacity: 50, feeAmount: 0, requiresReview: true, status: 'Draft' as ProjectStatus, contactName: '', contactPhone: '', notes: '' }) -const statusLabel: Record = { PendingReview: '待审核', PendingPayment: '待缴费', Confirmed: '已确认', Waitlisted: '候补中', Rejected: '已驳回', Cancelled: '已取消' } +const statusLabel = computed>(() => ({ PendingReview: t('campusRegistration.pendingReview'), PendingPayment: t('campusRegistration.pendingPayment'), Confirmed: t('campusRegistration.confirmed'), Waitlisted: t('campusRegistration.waitlisted'), Rejected: t('campusRegistration.rejected'), Cancelled: t('campusRegistration.cancelled') })) const statusType: Record = { PendingReview: 'warning', PendingPayment: 'warning', Confirmed: 'success', Waitlisted: 'info', Rejected: 'danger', Cancelled: 'info' } -const projectStatusLabel: Record = { Draft: '草稿', Published: '已发布', Closed: '已关闭' } +const projectStatusLabel = computed>(() => ({ Draft: t('campusRegistration.draft'), Published: t('campusRegistration.published'), Closed: t('campusRegistration.closed') })) const localDateTime = (value?: string) => value ? new Date(value).toLocaleString(getDisplayLocale(), { hour12: false }) : '—' -const amount = (value: number) => value === 0 ? '免费' : `¥${value.toFixed(2)}` +const amount = (value: number) => value === 0 ? t('campusRegistration.free') : `¥${value.toFixed(2)}` const application = (value: unknown) => value as Application -function applicationStatus(value: unknown) { const status = value as ApplicationStatus; return { label: statusLabel[status] ?? '未知状态', type: statusType[status] ?? 'info' as const } } +function applicationStatus(value: unknown) { const status = value as ApplicationStatus; return { label: statusLabel.value[status] ?? t('campusRegistration.unknown'), type: statusType[status] ?? 'info' as const } } +function orderStatus(value: string) { return value === 'Pending' ? t('campusRegistration.awaitingConfirmation') : value === 'Paid' ? t('campusRegistration.confirmed') : value === 'Cancelled' ? t('campusRegistration.cancelled') : value } function resetForm(project?: Project) { editingId.value = project?.id ?? null; Object.assign(form, project ? { code: project.code, name: project.name, description: project.description ?? '', registrationStartsAt: project.registrationStartsAt.slice(0, 16), registrationEndsAt: project.registrationEndsAt.slice(0, 16), capacity: project.capacity, feeAmount: project.feeAmount, requiresReview: project.requiresReview, status: project.status, contactName: project.contactName ?? '', contactPhone: project.contactPhone ?? '', notes: project.notes ?? '' } : { code: '', name: '', description: '', registrationStartsAt: '', registrationEndsAt: '', capacity: 50, feeAmount: 0, requiresReview: true, status: 'Draft', contactName: '', contactPhone: '', notes: '' }); dialog.value = true } async function loadProjects() { const { data } = await http.get('/campus-registrations/projects'); projects.value = data } @@ -38,23 +39,23 @@ async function loadWallet() { if (isStudent.value) { const { data } = await http async function loadApplications(resetPage = false) { if (canManage.value) { if (resetPage) applicationsPage.value = 1; const { data } = await http.get>('/campus-registrations/applications', { params: { projectId: applicationProjectId.value || undefined, status: applicationStatusFilter.value || undefined, page: applicationsPage.value, pageSize: applicationsPageSize.value } }); applications.value = data.items; applicationsTotal.value = data.total; if (applications.value.length === 0 && applicationsTotal.value > 0 && applicationsPage.value > 1) { applicationsPage.value--; await loadApplications() } } } async function changeApplicationsPage(page: number) { applicationsPage.value = page; await loadApplications() } async function changeApplicationsPageSize(pageSize: number) { applicationsPageSize.value = pageSize; applicationsPage.value = 1; await loadApplications() } -async function saveProject() { try { const payload = { ...form, registrationStartsAt: new Date(form.registrationStartsAt).toISOString(), registrationEndsAt: new Date(form.registrationEndsAt).toISOString(), collegeId: null }; if (editingId.value) await http.put(`/campus-registrations/projects/${editingId.value}`, payload); else await http.post('/campus-registrations/projects', payload); ElMessage.success('项目已保存'); dialog.value = false; await loadProjects() } catch (e) { ElMessage.error(apiErrorMessage(e)) } } -async function apply(project: Project) { try { const { value } = await ElMessageBox.prompt('可选:填写报名说明', `报名:${project.name}`, { inputPlaceholder: '报名说明' }); await http.post(`/campus-registrations/projects/${project.id}/apply`, { note: value || null }); ElMessage.success('报名已提交'); await Promise.all([loadProjects(), loadMine()]) } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } -async function review(item: Application, approved: boolean) { try { const { value } = await ElMessageBox.prompt(approved ? '审核通过后将生成缴费订单或直接确认免费报名。' : '请填写驳回原因', approved ? '通过报名' : '驳回报名', { inputPlaceholder: approved ? '可选审核意见' : '驳回原因' }); await http.post(`/campus-registrations/applications/${item.id}/review`, { approved, comment: value || null }); ElMessage.success('处理完成'); await loadApplications() } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } -async function confirmOffline(item: Application) { try { const { value } = await ElMessageBox.prompt('填写线下收款凭据编号(可选)', '确认线下缴费'); await http.post(`/campus-registrations/orders/${item.order!.id}/confirm-offline`, { referenceNumber: value || null, note: null }); ElMessage.success('已确认收款和报名'); await loadApplications() } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } -async function cancel(item: Application) { try { await ElMessageBox.confirm('撤销后不可恢复,确定继续吗?', '撤销报名', { type: 'warning' }); await http.post(`/campus-registrations/applications/${item.id}/cancel`); ElMessage.success('报名已撤销'); await loadMine() } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } -async function payBalance(item: Application) { try { await ElMessageBox.confirm(`将从校园余额扣除 ${amount(item.order!.amount)},确定支付吗?`, '余额支付', { type: 'warning' }); await http.post(`/campus-registrations/orders/${item.order!.id}/pay-balance`); ElMessage.success('余额支付成功,报名已确认'); await Promise.all([loadMine(), loadWallet(), loadProjects()]) } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } -async function exportApplications() { loading.value = true; try { await downloadApiFile('/campus-registrations/applications/export.xlsx', '校园报名与缴费.xlsx', { params: { projectId: applicationProjectId.value || undefined, status: applicationStatusFilter.value || undefined } }) } finally { loading.value = false } } +async function saveProject() { try { const payload = { ...form, registrationStartsAt: new Date(form.registrationStartsAt).toISOString(), registrationEndsAt: new Date(form.registrationEndsAt).toISOString(), collegeId: null }; if (editingId.value) await http.put(`/campus-registrations/projects/${editingId.value}`, payload); else await http.post('/campus-registrations/projects', payload); ElMessage.success(t('campusRegistration.projectSaved')); dialog.value = false; await loadProjects() } catch (e) { ElMessage.error(apiErrorMessage(e)) } } +async function apply(project: Project) { try { const { value } = await ElMessageBox.prompt(t('campusRegistration.noteOptional'), t('campusRegistration.applyTitle', { name: project.name }), { inputPlaceholder: t('campusRegistration.note') }); await http.post(`/campus-registrations/projects/${project.id}/apply`, { note: value || null }); ElMessage.success(t('campusRegistration.applicationSubmitted')); await Promise.all([loadProjects(), loadMine()]) } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } +async function review(item: Application, approved: boolean) { try { const { value } = await ElMessageBox.prompt(approved ? t('campusRegistration.approvePrompt') : t('campusRegistration.rejectPrompt'), approved ? t('campusRegistration.approveTitle') : t('campusRegistration.rejectTitle'), { inputPlaceholder: approved ? t('campusRegistration.optionalComment') : t('campusRegistration.rejectReason') }); await http.post(`/campus-registrations/applications/${item.id}/review`, { approved, comment: value || null }); ElMessage.success(t('campusRegistration.processed')); await loadApplications() } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } +async function confirmOffline(item: Application) { try { const { value } = await ElMessageBox.prompt(t('campusRegistration.offlinePrompt'), t('campusRegistration.offlineTitle')); await http.post(`/campus-registrations/orders/${item.order!.id}/confirm-offline`, { referenceNumber: value || null, note: null }); ElMessage.success(t('campusRegistration.paymentConfirmed')); await loadApplications() } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } +async function cancel(item: Application) { try { await ElMessageBox.confirm(t('campusRegistration.cancelPrompt'), t('campusRegistration.cancelTitle'), { type: 'warning' }); await http.post(`/campus-registrations/applications/${item.id}/cancel`); ElMessage.success(t('campusRegistration.applicationCancelled')); await loadMine() } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } +async function payBalance(item: Application) { try { await ElMessageBox.confirm(t('campusRegistration.balanceConfirm', { amount: amount(item.order!.amount) }), t('campusRegistration.balanceTitle'), { type: 'warning' }); await http.post(`/campus-registrations/orders/${item.order!.id}/pay-balance`); ElMessage.success(t('campusRegistration.balancePaid')); await Promise.all([loadMine(), loadWallet(), loadProjects()]) } catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) } } +async function exportApplications() { loading.value = true; try { await downloadApiFile('/campus-registrations/applications/export.xlsx', t('campusRegistration.exportFile'), { params: { projectId: applicationProjectId.value || undefined, status: applicationStatusFilter.value || undefined } }) } finally { loading.value = false } } onMounted(async () => { loading.value = true; try { await Promise.all([loadProjects(), loadMine(), loadWallet(), loadApplications()]) } finally { loading.value = false } })