feat: localize student records and platform settings
This commit is contained in:
1 parent
d56ec9c1aa
commit
9635c664c4
7 files changed
+235
-239
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
|
||||
@@ -14,14 +15,12 @@ const reviewDialog = ref(false)
|
||||
const selected = ref<any>(null)
|
||||
const createForm = reactive({ gradeRecordId: '', reason: '' })
|
||||
const reviewForm = reactive({ accepted: false, response: '', requestedScore: undefined as number | undefined, requestedResult: '' })
|
||||
const { t } = useI18n()
|
||||
|
||||
const statusLabels: Record<string, string> = {
|
||||
Submitted: '待教师处理', Withdrawn: '已撤回', Rejected: '异议未支持',
|
||||
ModificationPending: '成绩修改审批中', Resolved: '已处理并生效',
|
||||
ModificationRejected: '成绩修改未获批准',
|
||||
}
|
||||
const statusValues = ['Submitted', 'Withdrawn', 'Rejected', 'ModificationPending', 'Resolved', 'ModificationRejected']
|
||||
const statusLabel = (value: string) => t(`gradeAppeal.statuses.${value}`)
|
||||
const resultOptions = computed(() => selected.value?.evaluationMethod === 'PassFail'
|
||||
? [{ value: 'Pass', label: '通过' }, { value: 'Fail', label: '不通过' }]
|
||||
? [{ value: 'Pass', label: t('gradeAppeal.pass') }, { value: 'Fail', label: t('gradeAppeal.fail') }]
|
||||
: ['A', 'B', 'C', 'D', 'E'].map(value => ({ value, label: value })))
|
||||
|
||||
async function load() {
|
||||
@@ -52,20 +51,20 @@ function openForRecord(record: any) {
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
if (createForm.reason.trim().length < 10) return ElMessage.warning('请至少填写 10 个字,说明成绩存在的具体问题')
|
||||
if (createForm.reason.trim().length < 10) return ElMessage.warning(t('gradeAppeal.messages.reasonLength'))
|
||||
try {
|
||||
await http.post('/grade-appeals', createForm)
|
||||
dialog.value = false
|
||||
ElMessage.success('成绩异议已提交,请等待任课教师处理')
|
||||
ElMessage.success(t('gradeAppeal.messages.submitted'))
|
||||
await load()
|
||||
} catch (error) { ElMessage.error(apiErrorMessage(error)) }
|
||||
}
|
||||
|
||||
async function withdraw(row: any) {
|
||||
try {
|
||||
await ElMessageBox.confirm('撤回后如仍在申诉期内可以重新提交,确认撤回?', '撤回成绩异议')
|
||||
await ElMessageBox.confirm(t('gradeAppeal.messages.withdrawConfirm'), t('gradeAppeal.messages.withdrawTitle'))
|
||||
await http.post(`/grade-appeals/${row.id}/withdraw`)
|
||||
ElMessage.success('已撤回')
|
||||
ElMessage.success(t('gradeAppeal.messages.withdrawn'))
|
||||
await load()
|
||||
} catch (error: any) { if (error !== 'cancel' && error !== 'close') ElMessage.error(apiErrorMessage(error)) }
|
||||
}
|
||||
@@ -77,11 +76,11 @@ function openReview(row: any) {
|
||||
}
|
||||
|
||||
async function review() {
|
||||
if (!reviewForm.response.trim()) return ElMessage.warning('请填写教师处理意见')
|
||||
if (!reviewForm.response.trim()) return ElMessage.warning(t('gradeAppeal.messages.responseRequired'))
|
||||
if (reviewForm.accepted && selected.value.evaluationMethod === 'Percentage' && reviewForm.requestedScore == null)
|
||||
return ElMessage.warning('请填写拟调整后的百分制成绩')
|
||||
return ElMessage.warning(t('gradeAppeal.messages.scoreRequired'))
|
||||
if (reviewForm.accepted && selected.value.evaluationMethod !== 'Percentage' && !reviewForm.requestedResult)
|
||||
return ElMessage.warning('请选择拟调整后的最终评价')
|
||||
return ElMessage.warning(t('gradeAppeal.messages.resultRequired'))
|
||||
try {
|
||||
await http.post(`/grade-appeals/${selected.value.id}/review`, {
|
||||
accepted: reviewForm.accepted,
|
||||
@@ -90,7 +89,7 @@ async function review() {
|
||||
requestedResult: reviewForm.accepted ? reviewForm.requestedResult || null : null,
|
||||
})
|
||||
reviewDialog.value = false
|
||||
ElMessage.success(reviewForm.accepted ? '已转入成绩修改审批' : '成绩异议已答复')
|
||||
ElMessage.success(t(reviewForm.accepted ? 'gradeAppeal.messages.modificationPending' : 'gradeAppeal.messages.responded'))
|
||||
await load()
|
||||
} catch (error) { ElMessage.error(apiErrorMessage(error)) }
|
||||
}
|
||||
@@ -102,35 +101,35 @@ onMounted(load)
|
||||
<template>
|
||||
<section class="appeal-panel" v-loading="loading">
|
||||
<header>
|
||||
<div><b>{{ student ? '我的成绩异议' : '成绩异议处理' }}</b><small>{{ student ? '仅可对申诉期内已发布成绩提出异议' : '教师答复后,可将认可的异议转入现有三级成绩修改审批' }}</small></div>
|
||||
<div v-if="!student"><el-select v-model="status" clearable placeholder="全部状态" @change="page=1;load()"><el-option v-for="(label,key) in statusLabels" :key="key" :value="key" :label="label" /></el-select><el-button @click="load">刷新</el-button></div>
|
||||
<div><b>{{ t(student ? 'gradeAppeal.myTitle' : 'gradeAppeal.reviewTitle') }}</b><small>{{ t(student ? 'gradeAppeal.myDescription' : 'gradeAppeal.reviewDescription') }}</small></div>
|
||||
<div v-if="!student"><el-select v-model="status" clearable :placeholder="t('gradeAppeal.allStatuses')" @change="page=1;load()"><el-option v-for="key in statusValues" :key="key" :value="key" :label="statusLabel(key)" /></el-select><el-button @click="load">{{ t('gradeAppeal.refresh') }}</el-button></div>
|
||||
</header>
|
||||
<el-table :data="items" empty-text="暂无成绩异议">
|
||||
<el-table-column v-if="!student" label="学生" width="160"><template #default="{row}"><b>{{row.studentName}}</b><br><small>{{row.studentNumber}}</small></template></el-table-column>
|
||||
<el-table-column label="课程" min-width="180"><template #default="{row}"><b>{{row.courseName}}</b><br><small>{{row.courseCode}}</small></template></el-table-column>
|
||||
<el-table-column prop="reason" label="异议理由" min-width="260" show-overflow-tooltip />
|
||||
<el-table-column label="状态" width="150"><template #default="{row}"><el-tag effect="plain">{{statusLabels[row.status] ?? row.status}}</el-tag></template></el-table-column>
|
||||
<el-table-column prop="teacherResponse" label="处理意见" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120"><template #default="{row}"><el-button v-if="student && row.status==='Submitted'" link type="danger" @click="withdraw(row)">撤回</el-button><el-button v-if="!student && row.status==='Submitted'" link type="primary" @click="openReview(row)">处理</el-button></template></el-table-column>
|
||||
<el-table :data="items" :empty-text="t('gradeAppeal.empty')">
|
||||
<el-table-column v-if="!student" :label="t('gradeAppeal.student')" width="160"><template #default="{row}"><b>{{row.studentName}}</b><br><small>{{row.studentNumber}}</small></template></el-table-column>
|
||||
<el-table-column :label="t('gradeAppeal.course')" min-width="180"><template #default="{row}"><b>{{row.courseName}}</b><br><small>{{row.courseCode}}</small></template></el-table-column>
|
||||
<el-table-column prop="reason" :label="t('gradeAppeal.reason')" min-width="260" show-overflow-tooltip />
|
||||
<el-table-column :label="t('gradeAppeal.status')" width="150"><template #default="{row}"><el-tag effect="plain">{{statusLabel(row.status)}}</el-tag></template></el-table-column>
|
||||
<el-table-column prop="teacherResponse" :label="t('gradeAppeal.response')" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column :label="t('gradeAppeal.actions')" width="120"><template #default="{row}"><el-button v-if="student && row.status==='Submitted'" link type="danger" @click="withdraw(row)">{{ t('gradeAppeal.withdraw') }}</el-button><el-button v-if="!student && row.status==='Submitted'" link type="primary" @click="openReview(row)">{{ t('gradeAppeal.review') }}</el-button></template></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination v-if="!student && total>20" v-model:current-page="page" :page-size="20" :total="total" layout="total, prev, pager, next" @change="load" />
|
||||
</section>
|
||||
|
||||
<el-dialog v-model="dialog" title="提出成绩异议" width="560px">
|
||||
<p v-if="selected"><b>{{selected.courseName}}</b> · 当前成绩 {{selected.totalScore ?? selected.result ?? '—'}}</p>
|
||||
<el-input v-model="createForm.reason" type="textarea" :rows="5" maxlength="1000" show-word-limit placeholder="请具体说明成绩项目、计算或记录中可能存在的问题" />
|
||||
<template #footer><el-button @click="dialog=false">取消</el-button><el-button type="primary" @click="submit">提交异议</el-button></template>
|
||||
<el-dialog v-model="dialog" :title="t('gradeAppeal.createTitle')" width="560px">
|
||||
<p v-if="selected"><b>{{selected.courseName}}</b> · {{ t('gradeAppeal.currentGrade', { grade: selected.totalScore ?? selected.result ?? '—' }) }}</p>
|
||||
<el-input v-model="createForm.reason" type="textarea" :rows="5" maxlength="1000" show-word-limit :placeholder="t('gradeAppeal.reasonPlaceholder')" />
|
||||
<template #footer><el-button @click="dialog=false">{{ t('gradeAppeal.cancel') }}</el-button><el-button type="primary" @click="submit">{{ t('gradeAppeal.submit') }}</el-button></template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="reviewDialog" title="处理成绩异议" width="620px">
|
||||
<el-descriptions v-if="selected" :column="1" border><el-descriptions-item label="学生">{{selected.studentName}}({{selected.studentNumber}})</el-descriptions-item><el-descriptions-item label="课程">{{selected.courseName}}</el-descriptions-item><el-descriptions-item label="异议理由">{{selected.reason}}</el-descriptions-item></el-descriptions>
|
||||
<el-dialog v-model="reviewDialog" :title="t('gradeAppeal.handleTitle')" width="620px">
|
||||
<el-descriptions v-if="selected" :column="1" border><el-descriptions-item :label="t('gradeAppeal.student')">{{selected.studentName}}({{selected.studentNumber}})</el-descriptions-item><el-descriptions-item :label="t('gradeAppeal.course')">{{selected.courseName}}</el-descriptions-item><el-descriptions-item :label="t('gradeAppeal.reason')">{{selected.reason}}</el-descriptions-item></el-descriptions>
|
||||
<el-form label-position="top" class="review-form">
|
||||
<el-form-item label="处理结论"><el-radio-group v-model="reviewForm.accepted"><el-radio-button :value="false">说明后不支持</el-radio-button><el-radio-button :value="true">认可并发起成绩修改</el-radio-button></el-radio-group></el-form-item>
|
||||
<el-form-item v-if="reviewForm.accepted && selected?.evaluationMethod==='Percentage'" label="拟调整后成绩" required><el-input-number v-model="reviewForm.requestedScore" :min="0" :max="100" :precision="1" /></el-form-item>
|
||||
<el-form-item v-if="reviewForm.accepted && selected?.evaluationMethod!=='Percentage'" label="拟调整后评价" required><el-select v-model="reviewForm.requestedResult"><el-option v-for="item in resultOptions" :key="item.value" :value="item.value" :label="item.label" /></el-select></el-form-item>
|
||||
<el-form-item label="教师处理意见" required><el-input v-model="reviewForm.response" type="textarea" :rows="4" maxlength="1000" show-word-limit /></el-form-item>
|
||||
<el-form-item :label="t('gradeAppeal.conclusion')"><el-radio-group v-model="reviewForm.accepted"><el-radio-button :value="false">{{ t('gradeAppeal.reject') }}</el-radio-button><el-radio-button :value="true">{{ t('gradeAppeal.accept') }}</el-radio-button></el-radio-group></el-form-item>
|
||||
<el-form-item v-if="reviewForm.accepted && selected?.evaluationMethod==='Percentage'" :label="t('gradeAppeal.requestedScore')" required><el-input-number v-model="reviewForm.requestedScore" :min="0" :max="100" :precision="1" /></el-form-item>
|
||||
<el-form-item v-if="reviewForm.accepted && selected?.evaluationMethod!=='Percentage'" :label="t('gradeAppeal.requestedResult')" required><el-select v-model="reviewForm.requestedResult"><el-option v-for="item in resultOptions" :key="item.value" :value="item.value" :label="item.label" /></el-select></el-form-item>
|
||||
<el-form-item :label="t('gradeAppeal.teacherResponse')" required><el-input v-model="reviewForm.response" type="textarea" :rows="4" maxlength="1000" show-word-limit /></el-form-item>
|
||||
</el-form>
|
||||
<template #footer><el-button @click="reviewDialog=false">取消</el-button><el-button type="primary" @click="review">确认处理</el-button></template>
|
||||
<template #footer><el-button @click="reviewDialog=false">{{ t('gradeAppeal.cancel') }}</el-button><el-button type="primary" @click="review">{{ t('gradeAppeal.confirm') }}</el-button></template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { Bell, Delete, Message, Refresh } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
|
||||
@@ -17,6 +18,7 @@ const form = reactive({
|
||||
quietEnd: '07:00',
|
||||
timeZoneId: 'Asia/Shanghai',
|
||||
})
|
||||
const { locale, t } = useI18n()
|
||||
|
||||
const canUseBrowserPush = computed(() =>
|
||||
window.isSecureContext &&
|
||||
@@ -24,14 +26,8 @@ const canUseBrowserPush = computed(() =>
|
||||
'serviceWorker' in navigator &&
|
||||
'PushManager' in window)
|
||||
|
||||
const timeZones = [
|
||||
{ value: 'Asia/Shanghai', label: '中国标准时间(上海)' },
|
||||
{ value: 'Asia/Hong_Kong', label: '香港时间' },
|
||||
{ value: 'Asia/Tokyo', label: '日本时间(东京)' },
|
||||
{ value: 'Europe/London', label: '英国时间(伦敦)' },
|
||||
{ value: 'America/New_York', label: '美国东部时间(纽约)' },
|
||||
{ value: 'UTC', label: 'UTC' },
|
||||
]
|
||||
const timeZoneValues = ['Asia/Shanghai', 'Asia/Hong_Kong', 'Asia/Tokyo', 'Europe/London', 'America/New_York', 'UTC']
|
||||
const timeZones = computed(() => timeZoneValues.map((value, index) => ({ value, label: t(`notificationDelivery.timeZones.${index}`) })))
|
||||
|
||||
function minuteToTime(value: number) {
|
||||
return `${String(Math.floor(value / 60)).padStart(2, '0')}:${String(value % 60).padStart(2, '0')}`
|
||||
@@ -49,17 +45,11 @@ function base64UrlToUint8Array(value: string) {
|
||||
}
|
||||
|
||||
function channelLabel(value: string) {
|
||||
return value === 'Email' ? '邮件' : 'Web Push'
|
||||
return t(value === 'Email' ? 'notificationDelivery.email' : 'notificationDelivery.webPush')
|
||||
}
|
||||
|
||||
function stateLabel(value: string) {
|
||||
return ({
|
||||
Pending: '等待投递',
|
||||
Processing: '投递中',
|
||||
Delivered: '已送达',
|
||||
Failed: '失败',
|
||||
Suppressed: '未投递',
|
||||
} as Record<string, string>)[value] ?? value
|
||||
return t(`notificationDelivery.states.${value}`)
|
||||
}
|
||||
|
||||
function stateType(value: string): 'success' | 'info' | 'warning' | 'primary' | 'danger' {
|
||||
@@ -107,7 +97,7 @@ async function save(showMessage = true) {
|
||||
quietEndMinute: timeToMinute(form.quietEnd),
|
||||
timeZoneId: form.timeZoneId,
|
||||
})
|
||||
if (showMessage) ElMessage.success('通知偏好已保存')
|
||||
if (showMessage) ElMessage.success(t('notificationDelivery.messages.saved'))
|
||||
} catch (error) {
|
||||
ElMessage.error(apiErrorMessage(error))
|
||||
throw error
|
||||
@@ -118,17 +108,17 @@ async function save(showMessage = true) {
|
||||
|
||||
async function subscribeBrowser() {
|
||||
if (!canUseBrowserPush.value) {
|
||||
ElMessage.warning('当前浏览器或页面环境不支持 Web Push,请使用 HTTPS 打开 PWA。')
|
||||
ElMessage.warning(t('notificationDelivery.messages.unsupported'))
|
||||
return
|
||||
}
|
||||
if (!preferences.value?.webPushProviderEnabled || !preferences.value?.webPushPublicKey) {
|
||||
ElMessage.warning('服务器尚未配置 Web Push。')
|
||||
ElMessage.warning(t('notificationDelivery.messages.notConfigured'))
|
||||
return
|
||||
}
|
||||
subscribing.value = true
|
||||
try {
|
||||
const permission = await Notification.requestPermission()
|
||||
if (permission !== 'granted') throw new Error('浏览器未授予通知权限。')
|
||||
if (permission !== 'granted') throw new Error(t('notificationDelivery.messages.permissionDenied'))
|
||||
const registration = await navigator.serviceWorker.ready
|
||||
const existing = await registration.pushManager.getSubscription()
|
||||
const subscription = existing ?? await registration.pushManager.subscribe({
|
||||
@@ -147,7 +137,7 @@ async function subscribeBrowser() {
|
||||
form.webPushEnabled = true
|
||||
await save(false)
|
||||
await load()
|
||||
ElMessage.success('当前浏览器已启用推送通知')
|
||||
ElMessage.success(t('notificationDelivery.messages.enabled'))
|
||||
} catch (error) {
|
||||
ElMessage.error(error instanceof Error ? error.message : apiErrorMessage(error))
|
||||
} finally {
|
||||
@@ -159,7 +149,7 @@ async function removeSubscription(id: string) {
|
||||
try {
|
||||
await http.delete(`/notifications/push-subscriptions/${id}`)
|
||||
await load()
|
||||
ElMessage.success('已撤销该浏览器的服务端推送订阅')
|
||||
ElMessage.success(t('notificationDelivery.messages.revoked'))
|
||||
} catch (error) {
|
||||
ElMessage.error(apiErrorMessage(error))
|
||||
}
|
||||
@@ -173,20 +163,20 @@ onMounted(load)
|
||||
<header class="settings-heading">
|
||||
<div>
|
||||
<span>DELIVERY PREFERENCES</span>
|
||||
<h3>外部通知与静默时段</h3>
|
||||
<p>站内消息始终保留;这里仅控制邮件和浏览器推送,不会削弱业务通知留痕。</p>
|
||||
<h3>{{ t('notificationDelivery.title') }}</h3>
|
||||
<p>{{ t('notificationDelivery.description') }}</p>
|
||||
</div>
|
||||
<el-button :icon="Refresh" @click="load">刷新状态</el-button>
|
||||
<el-button :icon="Refresh" @click="load">{{ t('notificationDelivery.refresh') }}</el-button>
|
||||
</header>
|
||||
|
||||
<div class="settings-grid">
|
||||
<article class="channel-card">
|
||||
<div class="channel-icon email"><el-icon><Message /></el-icon></div>
|
||||
<div>
|
||||
<h4>邮件通知</h4>
|
||||
<p v-if="preferences?.emailConfirmed">发送到 {{ preferences.email }}</p>
|
||||
<p v-else>账号尚未配置并验证邮箱。</p>
|
||||
<small v-if="!preferences?.emailProviderEnabled">服务器 SMTP 尚未启用。</small>
|
||||
<h4>{{ t('notificationDelivery.emailNotifications') }}</h4>
|
||||
<p v-if="preferences?.emailConfirmed">{{ t('notificationDelivery.sendTo', { email: preferences.email }) }}</p>
|
||||
<p v-else>{{ t('notificationDelivery.emailMissing') }}</p>
|
||||
<small v-if="!preferences?.emailProviderEnabled">{{ t('notificationDelivery.smtpDisabled') }}</small>
|
||||
</div>
|
||||
<el-switch
|
||||
v-model="form.emailEnabled"
|
||||
@@ -197,10 +187,10 @@ onMounted(load)
|
||||
<article class="channel-card">
|
||||
<div class="channel-icon push"><el-icon><Bell /></el-icon></div>
|
||||
<div>
|
||||
<h4>浏览器 Web Push</h4>
|
||||
<p>已登记 {{ preferences?.subscriptions?.length ?? 0 }} 个浏览器订阅。</p>
|
||||
<small v-if="!preferences?.webPushProviderEnabled">服务器 VAPID 尚未配置。</small>
|
||||
<small v-else-if="!canUseBrowserPush">当前页面不是受支持的 HTTPS/PWA 环境。</small>
|
||||
<h4>{{ t('notificationDelivery.browserPush') }}</h4>
|
||||
<p>{{ t('notificationDelivery.subscriptionCount', { count: preferences?.subscriptions?.length ?? 0 }) }}</p>
|
||||
<small v-if="!preferences?.webPushProviderEnabled">{{ t('notificationDelivery.vapidDisabled') }}</small>
|
||||
<small v-else-if="!canUseBrowserPush">{{ t('notificationDelivery.environmentUnsupported') }}</small>
|
||||
</div>
|
||||
<el-switch
|
||||
v-model="form.webPushEnabled"
|
||||
@@ -213,13 +203,13 @@ onMounted(load)
|
||||
<div class="quiet-copy">
|
||||
<el-switch v-model="form.quietHoursEnabled" />
|
||||
<div>
|
||||
<h4>静默时段</h4>
|
||||
<p>静默期间外部渠道延后投递,站内收件箱仍会立即收到。</p>
|
||||
<h4>{{ t('notificationDelivery.quietHours') }}</h4>
|
||||
<p>{{ t('notificationDelivery.quietDescription') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="quiet-controls">
|
||||
<el-time-select v-model="form.quietStart" start="00:00" step="00:30" end="23:30" :disabled="!form.quietHoursEnabled" />
|
||||
<span>至</span>
|
||||
<span>{{ t('notificationDelivery.to') }}</span>
|
||||
<el-time-select v-model="form.quietEnd" start="00:00" step="00:30" end="23:30" :disabled="!form.quietHoursEnabled" />
|
||||
<el-select v-model="form.timeZoneId" filterable :disabled="!form.quietHoursEnabled">
|
||||
<el-option v-for="item in timeZones" :key="item.value" :value="item.value" :label="item.label" />
|
||||
@@ -234,34 +224,34 @@ onMounted(load)
|
||||
:disabled="!preferences?.webPushProviderEnabled || !canUseBrowserPush"
|
||||
@click="subscribeBrowser"
|
||||
>
|
||||
启用当前浏览器推送
|
||||
{{ t('notificationDelivery.enableBrowser') }}
|
||||
</el-button>
|
||||
<el-button type="success" :loading="saving" @click="save()">保存偏好</el-button>
|
||||
<el-button type="success" :loading="saving" @click="save()">{{ t('notificationDelivery.save') }}</el-button>
|
||||
</div>
|
||||
|
||||
<div v-if="preferences?.subscriptions?.length" class="subscription-list">
|
||||
<h4>已登记浏览器</h4>
|
||||
<h4>{{ t('notificationDelivery.registeredBrowsers') }}</h4>
|
||||
<div v-for="item in preferences.subscriptions" :key="item.id" class="subscription-row">
|
||||
<div>
|
||||
<b>{{ item.userAgent || '未知浏览器' }}</b>
|
||||
<small>最近登记:{{ new Date(item.lastSeenAt).toLocaleString('zh-CN') }}</small>
|
||||
<b>{{ item.userAgent || t('notificationDelivery.unknownBrowser') }}</b>
|
||||
<small>{{ t('notificationDelivery.lastSeen', { date: new Date(item.lastSeenAt).toLocaleString(locale) }) }}</small>
|
||||
</div>
|
||||
<el-button type="danger" plain :icon="Delete" @click="removeSubscription(item.id)">撤销</el-button>
|
||||
<el-button type="danger" plain :icon="Delete" @click="removeSubscription(item.id)">{{ t('notificationDelivery.revoke') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="delivery-log">
|
||||
<header>
|
||||
<div><h4>最近投递记录</h4><p>展示当前账号的邮件和 Web Push 送达、延后与失败状态。</p></div>
|
||||
<span>共 {{ deliveryTotal }} 条</span>
|
||||
<div><h4>{{ t('notificationDelivery.recentDeliveries') }}</h4><p>{{ t('notificationDelivery.deliveryDescription') }}</p></div>
|
||||
<span>{{ t('notificationDelivery.deliveryCount', { count: deliveryTotal }) }}</span>
|
||||
</header>
|
||||
<el-table :data="deliveries" empty-text="启用外部渠道后,新的通知投递记录会显示在这里">
|
||||
<el-table-column prop="title" label="通知" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column label="渠道" width="110"><template #default="{ row }">{{ channelLabel(row.channel) }}</template></el-table-column>
|
||||
<el-table-column label="状态" width="120"><template #default="{ row }"><el-tag :type="stateType(row.state)">{{ stateLabel(row.state) }}</el-tag></template></el-table-column>
|
||||
<el-table-column prop="attemptCount" label="尝试" width="80" />
|
||||
<el-table-column label="时间" width="190"><template #default="{ row }">{{ new Date(row.deliveredAt || row.nextAttemptAt).toLocaleString('zh-CN') }}</template></el-table-column>
|
||||
<el-table-column prop="lastError" label="说明" min-width="220" show-overflow-tooltip />
|
||||
<el-table :data="deliveries" :empty-text="t('notificationDelivery.empty')">
|
||||
<el-table-column prop="title" :label="t('notificationDelivery.notification')" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column :label="t('notificationDelivery.channel')" width="110"><template #default="{ row }">{{ channelLabel(row.channel) }}</template></el-table-column>
|
||||
<el-table-column :label="t('notificationDelivery.status')" width="120"><template #default="{ row }"><el-tag :type="stateType(row.state)">{{ stateLabel(row.state) }}</el-tag></template></el-table-column>
|
||||
<el-table-column prop="attemptCount" :label="t('notificationDelivery.attempts')" width="80" />
|
||||
<el-table-column :label="t('notificationDelivery.time')" width="190"><template #default="{ row }">{{ new Date(row.deliveredAt || row.nextAttemptAt).toLocaleString(locale) }}</template></el-table-column>
|
||||
<el-table-column prop="lastError" :label="t('notificationDelivery.details')" min-width="220" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -159,6 +159,22 @@ export default {
|
||||
freeClassrooms: {
|
||||
spaceSearch: 'Space search', title: 'Find available classrooms', description: 'Use the published timetable to find teaching spaces without classes during a selected week and consecutive periods.', officialOnly: 'Published timetable only', term: 'Term', unpublished: 'Timetable not published', week: 'Week', weekday: 'Day', startPeriod: 'Starting period', periodCount: 'Consecutive periods', campus: 'Campus', allCampuses: 'All campuses', building: 'Building', allBuildings: 'All buildings', minimumCapacity: 'Minimum capacity', unlimited: 'Any', search: 'Find classrooms', criteria: 'Search criteria', roomCount: 'available classrooms', refresh: 'Refresh', rooms: '{count} rooms', capacity: 'Capacity {count}', empty: 'No classrooms are available under these conditions. Try fewer consecutive periods or a wider venue range.', initial: 'Set the criteria to find available classrooms', selectTermMessage: 'Select a term first.', period: 'Period {period}', periodRange: 'Periods {start}–{end}', summary: 'Week {week} · {day} · {periods}', weekdays: { '1': 'Monday', '2': 'Tuesday', '3': 'Wednesday', '4': 'Thursday', '5': 'Friday', '6': 'Saturday', '7': 'Sunday' },
|
||||
},
|
||||
gradeAppeal: {
|
||||
myTitle: 'My grade appeals', reviewTitle: 'Grade appeal review', myDescription: 'Appeals can be submitted only for published grades during the appeal period', reviewDescription: 'Accepted appeals can be sent into the existing three-level grade-change approval workflow', allStatuses: 'All statuses', refresh: 'Refresh', empty: 'No grade appeals', student: 'Student', course: 'Course', reason: 'Appeal reason', status: 'Status', response: 'Response', actions: 'Actions', withdraw: 'Withdraw', review: 'Review', createTitle: 'Submit grade appeal', currentGrade: 'Current grade {grade}', reasonPlaceholder: 'Describe the grade component, calculation, or record that may be incorrect', cancel: 'Cancel', submit: 'Submit appeal', handleTitle: 'Review grade appeal', conclusion: 'Decision', reject: 'Explain and reject', accept: 'Accept and request grade change', requestedScore: 'Proposed score', requestedResult: 'Proposed result', teacherResponse: 'Teacher response', confirm: 'Confirm review', pass: 'Pass', fail: 'Fail',
|
||||
statuses: { Submitted: 'Awaiting teacher review', Withdrawn: 'Withdrawn', Rejected: 'Not upheld', ModificationPending: 'Grade change pending', Resolved: 'Resolved and applied', ModificationRejected: 'Grade change rejected' }, messages: { reasonLength: 'Enter at least 10 characters describing the specific grade issue.', submitted: 'Grade appeal submitted. Wait for the course teacher to review it.', withdrawConfirm: 'You can submit again while the appeal period remains open. Withdraw this appeal?', withdrawTitle: 'Withdraw grade appeal', withdrawn: 'Appeal withdrawn.', responseRequired: 'Enter the teacher response.', scoreRequired: 'Enter the proposed percentage score.', resultRequired: 'Select the proposed final result.', modificationPending: 'Sent for grade-change approval.', responded: 'Grade appeal answered.' },
|
||||
},
|
||||
tuition: {
|
||||
myTitle: 'My tuition bills', managementTitle: 'Tuition management', description: 'Base tuition, credit fees, accommodation, and final adjustments can be settled independently.', selectTerm: 'Select term', creditPrice: 'Price per credit', savePrice: 'Save credit price', downloadTemplate: 'Download bill template', importFees: 'Import base/accommodation fees', lockCredits: 'Lock enrollments and calculate credit fees', openPayment: 'Open student payments', workflow: 'Workflow: upload base tuition and accommodation fees → set the credit price → lock credit fees after enrollment closes → open payments; enter individual final adjustments after reconciliation.', searchPlaceholder: 'Filter by student number or name', search: 'Search', empty: 'No tuition bills in this scope. Import the roster and fees first.', studentNumber: 'Student number', student: 'Student', term: 'Term', baseTuition: 'Base tuition', creditFee: 'Credit fee', accommodationFee: 'Accommodation fee', adjustment: 'Final adjustment', remaining: '{amount} due', balancePayment: 'Pay from balance', payBase: 'Pay base tuition', payCredits: 'Pay credit fee', payAccommodation: 'Pay accommodation', payAdjustment: 'Pay adjustment', reconciliation: 'Final reconciliation', reconcile: 'Adjust balance', reconcilePrompt: 'Positive amounts collect additional payment; negative amounts issue refunds. Enter the difference after reconciling the final amount due for this term.', reconcileTitle: 'Final adjustment', reconcileReason: 'Final reconciliation adjustment', amountError: 'Enter an amount with up to two decimal places', templateFilename: 'tuition-import-template.xlsx', statuses: { Draft: 'Awaiting import', CreditsLocked: 'Credit fees locked', OpenForPayment: 'Payments open', Reconciliation: 'Final reconciliation', Closed: 'Settled' }, messages: { invalidPrice: 'Enter a valid price per credit.', priceSaved: 'Price per credit saved.', imported: 'Imported or updated {count} tuition bills.', creditsLocked: 'Credit fees generated from locked enrollment credits.', paymentOpened: 'Payments opened for this term.', reconciled: 'Reconciliation adjustment saved.', paid: 'Balance payment completed.' },
|
||||
},
|
||||
notificationDelivery: {
|
||||
title: 'External notifications and quiet hours', description: 'In-app messages are always retained. These settings control only email and browser push delivery without weakening the notification audit trail.', refresh: 'Refresh status', email: 'Email', webPush: 'Web Push', emailNotifications: 'Email notifications', sendTo: 'Send to {email}', emailMissing: 'No verified email is configured for this account.', smtpDisabled: 'SMTP is not enabled on the server.', browserPush: 'Browser Web Push', subscriptionCount: '{count} browser subscriptions registered.', vapidDisabled: 'VAPID is not configured on the server.', environmentUnsupported: 'This page is not running in a supported HTTPS/PWA environment.', quietHours: 'Quiet hours', quietDescription: 'External delivery is delayed during quiet hours, while the in-app inbox receives messages immediately.', to: 'to', enableBrowser: 'Enable push in this browser', save: 'Save preferences', registeredBrowsers: 'Registered browsers', unknownBrowser: 'Unknown browser', lastSeen: 'Last registered: {date}', revoke: 'Revoke', recentDeliveries: 'Recent deliveries', deliveryDescription: 'Shows delivered, delayed, and failed email and Web Push attempts for your account.', deliveryCount: '{count} records', empty: 'New delivery records will appear after an external channel is enabled', notification: 'Notification', channel: 'Channel', status: 'Status', attempts: 'Attempts', time: 'Time', details: 'Details', timeZones: { '0': 'China Standard Time (Shanghai)', '1': 'Hong Kong Time', '2': 'Japan Standard Time (Tokyo)', '3': 'United Kingdom Time (London)', '4': 'US Eastern Time (New York)', '5': 'UTC' }, states: { Pending: 'Pending', Processing: 'Delivering', Delivered: 'Delivered', Failed: 'Failed', Suppressed: 'Suppressed' }, messages: { saved: 'Notification preferences saved.', unsupported: 'This browser or page does not support Web Push. Open the PWA over HTTPS.', notConfigured: 'Web Push is not configured on the server.', permissionDenied: 'Browser notification permission was not granted.', enabled: 'Push notifications enabled in this browser.', revoked: 'The server-side push subscription for this browser was revoked.' },
|
||||
},
|
||||
studentCurriculum: {
|
||||
title: 'My curriculum plan', description: 'Review completed, active, retaken, and outstanding courses against your curriculum plan.', planning: 'Academic planning and graduation simulation', refresh: 'Refresh progress', gradeCollege: 'Class of {grade} · {college}', applicablePlan: 'Applicable plan', schoolingYears: '{years}-year program', noPlan: 'No published curriculum plan matches your record', planDescription: 'This page shows only the formally published curriculum plan and your current enrollment progress.', completedCredits: 'Completed credits', creditProgress: 'Curriculum credit completion', completion: '{rate}% complete', progressSummary: 'Course progress summary', planCourses: 'Plan courses', courseUnit: 'courses', completed: 'Completed', inProgress: 'Currently enrolled', failedRecords: 'Failed records', searchPlaceholder: 'Search by course code, name, or category', filterAria: 'Filter by enrollment status', allStatuses: 'All enrollment statuses', inProgressRetake: 'In progress (including retakes)', failedRetake: 'Failed (including retakes)', pending: 'Pending', notStarted: 'Not started', visibleCount: '{count} courses shown', module: 'Curriculum module', requiredCredits: 'Required credits', recommendedTerm: 'Recommended term', course: 'Course', requirement: 'Requirement', creditsHours: 'Credits / hours', myProgress: 'My progress', semester: 'Term {semester}', uncategorized: 'Uncategorized', practice: 'Practical course', planned: 'Planned course', credits: 'credits', hours: '{count} hours', hasFailure: 'Has a failed attempt', empty: 'No courses match the filters', noGrade: 'No grade', exemptResult: '{term} · Exempted', passFailResult: '{term} · {result}', gradedResult: '{term} · {result} · GPA {point}', scoreResult: '{term} · {score} points · GPA {point}', pass: 'Pass', fail: 'Fail', statuses: { Completed: 'Completed', InProgress: 'In progress', Retaking: 'Retaking', Failed: 'Failed', Pending: 'Pending', NotStarted: 'Not started' }, types: { Required: 'Required', Elective: 'Group elective' }, examStatuses: { Normal: 'Normal', Absent: 'Absent', Deferred: 'Deferred', Exempt: 'Exempt' },
|
||||
},
|
||||
plugins: {
|
||||
title: 'Unified plugin platform', description: 'Manage built-in business capabilities, runtime state, and server-side access boundaries in one place.', runningCount: '/ {total} plugins running', safetyTitle: 'Disabling does not delete data', safetyDescription: 'State changes immediately affect menus, routes, and APIs. Existing business endpoints still enforce role permissions and data scope.', signedPackages: 'Signed plugin packages', packageDescription: 'Uploads enter staging only. Validated packages must still be marked for activation and the service restarted.', selectZip: 'Select ZIP package', selectSignature: 'Select signature file', validateStage: 'Validate and stage', noPackages: 'No signed plugin packages uploaded', pluginVersion: 'Plugin / version', publisher: 'Publisher', verification: 'Verification', status: 'Status', actions: 'Actions', rollback: 'Roll back to this version', activate: 'Activate', delete: 'Delete', awaitingRestart: 'Awaiting restart', running: 'Running', disabled: 'Disabled', navigationCount: '{count} page entries', waitRestart: 'Mark and await restart', cancel: 'Cancel', enable: 'enable', disable: 'disable', bundled: 'Installed with the current system version', packageStatuses: { Staged: 'Staged', PendingActivation: 'Activation pending', Active: 'Active version', Superseded: 'Previous version', Failed: 'Load failed' }, messages: { selectFiles: 'Select the plugin ZIP package and its signature file.', staged: 'Signature verified. The plugin package is now staged.', activateConfirm: 'Version {version} will activate after the next service restart. The active version will be retained for rollback.', activateTitle: 'Activate {name}', activationPending: 'Marked for activation. Restart the service using the maintenance procedure.', deleteConfirm: 'Delete the package record for {name} {version}?', deleteTitle: 'Delete plugin package', deleted: 'Plugin package record deleted.', enableConfirm: 'Users with the existing role permissions will see and be able to use “{name}” again.', disableConfirm: 'The menu, pages, and backend APIs for “{name}” will be disabled. Existing data will not be deleted.', stateTitle: '{action} {name}', confirmState: 'Confirm {action}', stateChanged: '{name} has been {action}d.' },
|
||||
},
|
||||
api: {
|
||||
'data.constraint_conflict': 'A data constraint conflict occurred.',
|
||||
'server.unhandled_error': 'The server encountered an error while processing the request.',
|
||||
|
||||
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user