1038 lines
49 KiB
Vue
1038 lines
49 KiB
Vue
<script setup lang="ts">
|
|
import { getDisplayLocale } from '../i18n'
|
|
import { useI18n } from 'vue-i18n'
|
|
const { t } = useI18n()
|
|
import { computed, onMounted, reactive, ref } from 'vue'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import {
|
|
Check,
|
|
Clock,
|
|
Close,
|
|
DocumentChecked,
|
|
Plus,
|
|
Refresh,
|
|
Search,
|
|
Switch,
|
|
} from '@element-plus/icons-vue'
|
|
import http, { apiErrorMessage } from '../api/http'
|
|
import { useAuthStore } from '../stores/auth'
|
|
|
|
interface CourseOption {
|
|
teachingTaskId: string
|
|
courseId: string
|
|
taskNumber: string
|
|
courseCode: string
|
|
courseName: string
|
|
credits: number
|
|
academicTermName: string
|
|
teacherNames: string[]
|
|
hasPublishedSchedule: boolean
|
|
schedulingMode: 'Standard' | 'Flexible'
|
|
}
|
|
|
|
interface GradeOption {
|
|
courseId: string
|
|
courseCode: string
|
|
courseName: string
|
|
credits: number
|
|
totalScore: number | null
|
|
gradePoint: number | null
|
|
examStatus: string
|
|
academicTermName: string
|
|
taskNumber: string
|
|
publishedAt: string | null
|
|
}
|
|
|
|
interface SubstitutionTarget {
|
|
courseId: string
|
|
courseCode: string
|
|
courseName: string
|
|
credits: number
|
|
source: 'assigned' | 'failed'
|
|
detail: string
|
|
}
|
|
|
|
const auth = useAuthStore()
|
|
const route = useRoute()
|
|
const router = useRouter()
|
|
const isManager = computed(() => auth.user?.roles.some(r => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin'].includes(r)) ?? false)
|
|
const isSuperAdmin = computed(() => auth.user?.roles.includes('SuperAdmin') ?? false)
|
|
const isApprover = computed(() => auth.user?.roles.some(r => ['SuperAdmin', 'AcademicAdmin', 'CollegeAdmin', 'Counselor', 'Teacher', 'DormitoryAdmin', 'StudentAffairsAdmin', 'Leader'].includes(r)) ?? false)
|
|
const isTeacher = computed(() => auth.user?.roles.includes('Teacher') && !isManager.value)
|
|
const isStudent = computed(() => auth.user?.roles.includes('Student') && !isManager.value)
|
|
|
|
const pending = ref<any[]>([])
|
|
const pendingPage = ref(1)
|
|
const pendingTotal = ref(0)
|
|
const pendingPageSize = 20
|
|
const oldestPending = ref<any | null>(null)
|
|
const oldestFirst = ref(false)
|
|
const selectedPendingType = ref('')
|
|
const pendingCounts = ref<Record<string, number>>({})
|
|
const storedOverdueHours = Number(localStorage.getItem('jiaowu_approval_overdue_hours'))
|
|
const overdueHours = ref(Number.isInteger(storedOverdueHours) && storedOverdueHours >= 1 && storedOverdueHours <= 8760 ? storedOverdueHours : 72)
|
|
const overdueOnly = ref(false)
|
|
const targetApprovalType = computed(() => {
|
|
const value = route.query.type
|
|
return typeof value === 'string' ? value : undefined
|
|
})
|
|
const targetApprovalId = computed(() => {
|
|
const value = route.query.id
|
|
return typeof value === 'string' ? value : undefined
|
|
})
|
|
const loading = ref(false)
|
|
const submitting = ref(false)
|
|
const tab = ref(isApprover.value ? 'pending' : 'mine')
|
|
const dialog = ref(false)
|
|
const dialogType = ref('')
|
|
const courseKeyword = ref('')
|
|
const originalKeyword = ref('')
|
|
const substituteKeyword = ref('')
|
|
const rejectDialog = ref(false)
|
|
const rejectItem = ref<any>(null)
|
|
const rejectComment = ref('')
|
|
const reviewInProgress = ref(false)
|
|
const workflowDialog = ref(false)
|
|
const workflowSettings = ref<{ type: string; reviewerRole: string }[]>([])
|
|
const workflowSaving = ref('')
|
|
const progressDialog = ref(false)
|
|
const progressSteps = ref<{ kind: string; time: string; comment?: string | null }[]>([])
|
|
const progressType = ref('')
|
|
const progressIncomplete = ref(false)
|
|
const progressTypes = new Set(['CourseExemption', 'DeferredExam', 'CourseSubstitution', 'GradeModification', 'StudentStatusChange', 'TeacherCourseApplication', 'ClassroomReservation', 'CourseAdjustment', 'DormitoryApplication', 'GradeSheet', 'GradeSubmissionBatch', 'ExperimentGradeSheet', 'AssessmentDeclaration', 'AssessmentAppeal'])
|
|
|
|
const enrolledCourses = ref<CourseOption[]>([])
|
|
const gradeRecords = ref<any[]>([])
|
|
const myGrades = ref<GradeOption[]>([])
|
|
const myExemptions = ref<any[]>([])
|
|
const myDeferred = ref<any[]>([])
|
|
const mySubstitutions = ref<any[]>([])
|
|
|
|
const form = reactive({
|
|
teachingTaskId: '',
|
|
reason: '',
|
|
originalCourseId: '',
|
|
substituteCourseId: '',
|
|
gradeRecordId: '',
|
|
requestedScore: 0,
|
|
})
|
|
|
|
const dialogTitle = computed(() => ({
|
|
exemption: t('approvalBatch.k0'),
|
|
deferred: t('approvalBatch.k1'),
|
|
gradeMod: t('approvalBatch.k2'),
|
|
substitution: t('approvalBatch.k3'),
|
|
}[dialogType.value] ?? t('approvalBatch.k4')))
|
|
|
|
const actionableApprovalTypes = ['CourseExemption', 'DeferredExam', 'CourseSubstitution', 'CourseAdjustment', 'GradeModification', 'StudentStatusChange', 'TeacherCourseApplication', 'ClassroomReservation', 'CampusRegistration', 'AttendanceAppeal']
|
|
const isActionable = (item: any) => actionableApprovalTypes.includes(item.type) || (item.type === 'DormitoryApplication' && item.stage === 'counselor')
|
|
|
|
const selectedCourse = computed(() =>
|
|
enrolledCourses.value.find(course => course.teachingTaskId === form.teachingTaskId))
|
|
|
|
const filteredCourses = computed(() => {
|
|
const keyword = courseKeyword.value.trim().toLocaleLowerCase()
|
|
if (!keyword) return enrolledCourses.value
|
|
return enrolledCourses.value.filter(course =>
|
|
[course.courseCode, course.courseName, course.taskNumber, ...course.teacherNames]
|
|
.some(value => value?.toLocaleLowerCase().includes(keyword)))
|
|
})
|
|
|
|
function uniqueGrades(predicate: (grade: GradeOption) => boolean) {
|
|
const result = new Map<string, GradeOption>()
|
|
for (const grade of myGrades.value) {
|
|
if (predicate(grade) && !result.has(grade.courseId)) result.set(grade.courseId, grade)
|
|
}
|
|
return [...result.values()]
|
|
}
|
|
|
|
const failedGrades = computed(() =>
|
|
uniqueGrades(grade => grade.totalScore != null && Number(grade.totalScore) < 60))
|
|
const passedGrades = computed(() =>
|
|
uniqueGrades(grade => grade.totalScore != null && Number(grade.totalScore) >= 60))
|
|
|
|
const substitutionTargets = computed<SubstitutionTarget[]>(() => {
|
|
const result = new Map<string, SubstitutionTarget>()
|
|
for (const course of enrolledCourses.value) {
|
|
result.set(course.courseId, {
|
|
courseId: course.courseId,
|
|
courseCode: course.courseCode,
|
|
courseName: course.courseName,
|
|
credits: course.credits,
|
|
source: 'assigned',
|
|
detail: `${course.academicTermName} · ${course.taskNumber}`,
|
|
})
|
|
}
|
|
for (const grade of failedGrades.value) {
|
|
if (!result.has(grade.courseId)) {
|
|
result.set(grade.courseId, {
|
|
courseId: grade.courseId,
|
|
courseCode: grade.courseCode,
|
|
courseName: grade.courseName,
|
|
credits: grade.credits,
|
|
source: 'failed',
|
|
detail: `${grade.academicTermName} · ${t('approvalBatch.k84', { score: grade.totalScore })}`,
|
|
})
|
|
}
|
|
}
|
|
return [...result.values()]
|
|
})
|
|
|
|
function matchesCourse(item: { courseCode: string; courseName: string }, keyword: string) {
|
|
const normalized = keyword.trim().toLocaleLowerCase()
|
|
return !normalized ||
|
|
item.courseCode.toLocaleLowerCase().includes(normalized) ||
|
|
item.courseName.toLocaleLowerCase().includes(normalized)
|
|
}
|
|
|
|
function selectOriginal(courseId: string) {
|
|
form.originalCourseId = courseId
|
|
if (form.substituteCourseId === courseId) form.substituteCourseId = ''
|
|
}
|
|
|
|
const filteredOriginalCourses = computed(() =>
|
|
substitutionTargets.value.filter(item => matchesCourse(item, originalKeyword.value)))
|
|
const filteredSubstituteCourses = computed(() =>
|
|
passedGrades.value.filter(item => matchesCourse(item, substituteKeyword.value)))
|
|
|
|
const selectedOriginal = computed(() =>
|
|
substitutionTargets.value.find(item => item.courseId === form.originalCourseId))
|
|
const selectedSubstitute = computed(() =>
|
|
passedGrades.value.find(item => item.courseId === form.substituteCourseId))
|
|
|
|
const recordCount = computed(() =>
|
|
myExemptions.value.length + myDeferred.value.length + mySubstitutions.value.length)
|
|
|
|
let loadSequence = 0
|
|
async function load() {
|
|
const sequence = ++loadSequence
|
|
loading.value = true
|
|
try {
|
|
if (isApprover.value) {
|
|
if (isManager.value && targetApprovalType.value && targetApprovalId.value) {
|
|
const { data } = await http.get(
|
|
`/approvals/pending/${targetApprovalType.value}/${targetApprovalId.value}`,
|
|
)
|
|
if (sequence !== loadSequence) return
|
|
pending.value = [data]
|
|
pendingTotal.value = 1
|
|
pendingCounts.value = {}
|
|
} else {
|
|
const { data } = await http.get('/approvals/pending', {
|
|
params: { page: pendingPage.value, pageSize: pendingPageSize, oldestFirst: oldestFirst.value, type: selectedPendingType.value || undefined, overdueHours: overdueOnly.value ? overdueHours.value : undefined },
|
|
})
|
|
if (sequence !== loadSequence) return
|
|
pending.value = data.items
|
|
pendingTotal.value = data.total
|
|
pendingCounts.value = data.counts ?? {}
|
|
}
|
|
oldestPending.value = oldestFirst.value && pendingPage.value === 1 && !targetApprovalId.value ? pending.value[0] ?? null : null
|
|
if (!pending.value.length && pendingPage.value > 1) {
|
|
pendingPage.value--
|
|
return await load()
|
|
}
|
|
}
|
|
if (isStudent.value) {
|
|
const [courses, grades, ex, df, substitutions] = await Promise.all([
|
|
http.get('/approvals/my-courses'),
|
|
http.get('/approvals/my-grades'),
|
|
http.get('/approvals/exemptions/mine'),
|
|
http.get('/approvals/deferred/mine'),
|
|
http.get('/approvals/substitutions/mine'),
|
|
])
|
|
if (sequence !== loadSequence) return
|
|
enrolledCourses.value = courses.data
|
|
myGrades.value = grades.data
|
|
myExemptions.value = ex.data
|
|
myDeferred.value = df.data
|
|
mySubstitutions.value = substitutions.data
|
|
}
|
|
if (isTeacher.value) {
|
|
const { data } = await http.get('/approvals/grade-records')
|
|
if (sequence !== loadSequence) return
|
|
gradeRecords.value = data
|
|
}
|
|
} catch (e) {
|
|
if (sequence === loadSequence) ElMessage.error(apiErrorMessage(e))
|
|
} finally {
|
|
if (sequence === loadSequence) loading.value = false
|
|
}
|
|
}
|
|
|
|
function openDialog(type: string) {
|
|
dialogType.value = type
|
|
courseKeyword.value = ''
|
|
originalKeyword.value = ''
|
|
substituteKeyword.value = ''
|
|
Object.assign(form, {
|
|
teachingTaskId: '',
|
|
reason: '',
|
|
originalCourseId: '',
|
|
substituteCourseId: '',
|
|
gradeRecordId: '',
|
|
requestedScore: 0,
|
|
})
|
|
dialog.value = true
|
|
}
|
|
|
|
async function submitForm() {
|
|
if (!form.reason.trim()) {
|
|
ElMessage.warning(t('approvalBatch.k5'))
|
|
return
|
|
}
|
|
submitting.value = true
|
|
try {
|
|
if (dialogType.value === 'exemption') {
|
|
if (!form.teachingTaskId) {
|
|
ElMessage.warning(t('approvalBatch.k6'))
|
|
return
|
|
}
|
|
await http.post('/approvals/exemptions', {
|
|
teachingTaskId: form.teachingTaskId,
|
|
reason: form.reason,
|
|
})
|
|
} else if (dialogType.value === 'deferred') {
|
|
if (!form.teachingTaskId) {
|
|
ElMessage.warning(t('approvalBatch.k7'))
|
|
return
|
|
}
|
|
await http.post('/approvals/deferred', {
|
|
teachingTaskId: form.teachingTaskId,
|
|
reason: form.reason,
|
|
})
|
|
} else if (dialogType.value === 'gradeMod') {
|
|
if (!form.gradeRecordId) {
|
|
ElMessage.warning(t('approvalBatch.k8'))
|
|
return
|
|
}
|
|
await http.post('/approvals/grade-modifications', {
|
|
gradeRecordId: form.gradeRecordId,
|
|
requestedScore: form.requestedScore,
|
|
reason: form.reason,
|
|
})
|
|
} else if (dialogType.value === 'substitution') {
|
|
if (!form.originalCourseId || !form.substituteCourseId) {
|
|
ElMessage.warning(t('approvalBatch.k9'))
|
|
return
|
|
}
|
|
await http.post('/approvals/substitutions', {
|
|
originalCourseId: form.originalCourseId,
|
|
substituteCourseId: form.substituteCourseId,
|
|
reason: form.reason,
|
|
})
|
|
}
|
|
dialog.value = false
|
|
ElMessage.success(t('approvalBatch.k10'))
|
|
await load()
|
|
} catch (e) {
|
|
ElMessage.error(apiErrorMessage(e))
|
|
} finally {
|
|
submitting.value = false
|
|
}
|
|
}
|
|
|
|
async function approveItem(item: any) {
|
|
if (reviewInProgress.value) return
|
|
reviewInProgress.value = true
|
|
try {
|
|
if (await submitReview(item, true, '')) {
|
|
ElMessage.success(t('approvalBatch.k11'))
|
|
if (targetApprovalId.value) await router.replace({ path: '/approvals', query: { tab: 'pending' } })
|
|
await load()
|
|
}
|
|
} catch (e) {
|
|
ElMessage.error(apiErrorMessage(e))
|
|
} finally {
|
|
reviewInProgress.value = false
|
|
}
|
|
}
|
|
|
|
async function openWorkflowSettings() {
|
|
try {
|
|
workflowSettings.value = (await http.get('/approvals/workflow-settings')).data
|
|
workflowDialog.value = true
|
|
} catch (e) { ElMessage.error(apiErrorMessage(e)) }
|
|
}
|
|
|
|
async function openProgress(type: string, id: string) {
|
|
try {
|
|
const { data } = await http.get(`/approvals/progress/${type}/${id}`)
|
|
progressType.value = type
|
|
progressSteps.value = data.steps
|
|
progressIncomplete.value = data.historyIncomplete ?? false
|
|
progressDialog.value = true
|
|
} catch (e) { ElMessage.error(apiErrorMessage(e)) }
|
|
}
|
|
|
|
function progressLabel(kind: string) {
|
|
const labels: Record<string, string> = {
|
|
submitted: 'submitted', started: 'started', created: 'created', approved: 'approved', rejected: 'rejected', returned: 'returned', published: 'published', cancelled: 'cancelled',
|
|
counselorApproved: 'counselorApproved', counselorRejected: 'counselorRejected', legacyReviewed: 'legacyReviewed',
|
|
collegeApproved: 'collegeApproved', collegeRejected: 'collegeRejected', receivingCollegeApproved: 'receivingCollegeApproved', receivingCollegeRejected: 'receivingCollegeRejected',
|
|
finalApproved: 'finalApproved', finalRejected: 'finalRejected', dormitoryApproved: 'dormitoryApproved', dormitoryRejected: 'dormitoryRejected',
|
|
}
|
|
return t(`approvalProgress.${labels[kind] ?? 'submitted'}`)
|
|
}
|
|
|
|
async function saveWorkflowSetting(setting: { type: string; reviewerRole: string }) {
|
|
workflowSaving.value = setting.type
|
|
try {
|
|
await http.put(`/approvals/workflow-settings/${setting.type}`, { reviewerRole: setting.reviewerRole })
|
|
ElMessage.success(t('approvalCenterExtra.settingsSaved'))
|
|
} catch (e) { ElMessage.error(apiErrorMessage(e)) }
|
|
finally { workflowSaving.value = '' }
|
|
}
|
|
|
|
function openReject(item: any) {
|
|
rejectItem.value = item
|
|
rejectComment.value = ''
|
|
rejectDialog.value = true
|
|
}
|
|
|
|
async function rejectSubmit() {
|
|
if (!rejectItem.value || reviewInProgress.value) return
|
|
if (!rejectComment.value.trim()) {
|
|
ElMessage.warning(t('approvalBatch.k68'))
|
|
return
|
|
}
|
|
reviewInProgress.value = true
|
|
try {
|
|
if (await submitReview(rejectItem.value, false, rejectComment.value.trim())) {
|
|
rejectDialog.value = false
|
|
ElMessage.success(t('statusChanges.states.Rejected'))
|
|
if (targetApprovalId.value) await router.replace({ path: '/approvals', query: { tab: 'pending' } })
|
|
await load()
|
|
}
|
|
} catch (e) {
|
|
ElMessage.error(apiErrorMessage(e))
|
|
} finally {
|
|
reviewInProgress.value = false
|
|
}
|
|
}
|
|
|
|
async function submitReview(item: any, approved: boolean, comment: string) {
|
|
if (item.type === 'StudentStatusChange')
|
|
await http.post(`/student-status-changes/${item.id}/review`, { approved, comment: comment || null })
|
|
else if (item.type === 'TeacherCourseApplication')
|
|
await http.post(`/teacher-course-applications/${item.id}/review`, { status: approved ? 'Approved' : 'Rejected', reviewComment: comment || null })
|
|
else if (item.type === 'ClassroomReservation')
|
|
await http.post(`/classroom-reservations/${item.id}/${approved ? 'approve' : 'reject'}`, { comment: comment || null })
|
|
else if (item.type === 'CampusRegistration')
|
|
await http.post(`/campus-registrations/applications/${item.id}/review`, { approved, comment: comment || null })
|
|
else if (item.type === 'AttendanceAppeal' && item.secondaryId)
|
|
await http.post(`/attendance/appeals/${item.secondaryId}/${item.id}/review`, { approve: approved, comment: comment || null })
|
|
else if (item.type === 'DormitoryApplication' && item.stage === 'counselor')
|
|
await http.post(`/dormitory-services/applications/${item.id}/counselor-review`, { approved, comment: comment || null })
|
|
else {
|
|
const ep = approvalEndpoint(item.type)
|
|
if (!ep) return false
|
|
const action = approved ? (item.type === 'GradeModification' && item.stage === 'college' ? 'college-approve' : 'approve') : 'reject'
|
|
await http.post(`${ep}/${item.id}/${action}`, approved ? undefined : { comment })
|
|
}
|
|
return true
|
|
}
|
|
|
|
function approvalEndpoint(type: string) {
|
|
if (type === 'CourseAdjustment') return '/course-adjustments'
|
|
if (type === 'GradeModification') return '/approvals/grade-modifications'
|
|
const segment = type === 'CourseExemption' ? 'exemptions'
|
|
: type === 'DeferredExam' ? 'deferred'
|
|
: type === 'CourseSubstitution' ? 'substitutions' : ''
|
|
return segment ? `/approvals/${segment}` : ''
|
|
}
|
|
|
|
function approvalLabel(item: any) {
|
|
const types: Record<string, string> = {
|
|
CourseExemption: 'k69', DeferredExam: 'k70', GradeModification: 'k71',
|
|
CourseSubstitution: 'k72', StudentStatusChange: 'k73', GradeSheet: 'k74', AttendanceAppeal: 'k75',
|
|
}
|
|
if (item.type === 'TeacherCourseApplication') return t('approvalCenterExtra.teacherCourse')
|
|
if (item.type === 'ClassroomReservation') return t('approvalCenterExtra.classroom')
|
|
if (item.type === 'GradeAppeal') return t('approvalCenterExtra.gradeAppeal')
|
|
if (item.type === 'TeachingImprovement') return t('approvalCenterExtra.teachingImprovement')
|
|
if (item.type === 'GraduationClearance') return t('approvalCenterClearance')
|
|
const extra: Record<string, string> = { GradeSubmissionBatch: 'gradeBatch', ExperimentGradeSheet: 'experimentGrade', CampusRegistration: 'campusRegistration', DormitoryApplication: 'dormitory', AssessmentDeclaration: 'assessmentDeclaration', AssessmentAppeal: 'assessmentAppeal' }
|
|
if (extra[item.type]) return t(`approvalCenterExtra.${extra[item.type]}`)
|
|
if (item.type === 'CourseAdjustment') {
|
|
const adjustments: Record<string, string> = { '调课': 'k0', '停课': 'k1', '补课': 'k2', '代课': 'k3' }
|
|
return adjustments[item.label] ? t(`adjustmentBatch.${adjustments[item.label]}`) : item.label || t('approvalCenterAdjustment')
|
|
}
|
|
return types[item.type] ? t(`approvalBatch.${types[item.type]}`) : item.label
|
|
}
|
|
|
|
function approvalCountLabel(type: string) {
|
|
if (type === 'CourseAdjustment') return t('approvalCenterAdjustment')
|
|
return approvalLabel({ type, label: type })
|
|
}
|
|
|
|
function selectPendingType(type: string) {
|
|
selectedPendingType.value = type
|
|
pendingPage.value = 1
|
|
void load()
|
|
}
|
|
|
|
function updateOverdueHours(value: number | undefined) {
|
|
if (!value || !Number.isInteger(value) || value < 1 || value > 8760) return
|
|
overdueHours.value = value
|
|
localStorage.setItem('jiaowu_approval_overdue_hours', String(value))
|
|
if (overdueOnly.value) { pendingPage.value = 1; void load() }
|
|
}
|
|
|
|
function approvalStageLabel(stage: string) {
|
|
if (stage === 'counselor') return t('approvalCenterCounselorStage')
|
|
if (stage === 'dormitory') return t('approvalCenterDormitoryStage')
|
|
return stage === 'college' ? t('approvalCenterExtra.collegeStage') : t('approvalCenterExtra.finalStage')
|
|
}
|
|
|
|
function approvalRoute(type: string) {
|
|
const routes: Record<string, string> = {
|
|
StudentStatusChange: '/student-status-changes',
|
|
GradeSheet: '/grades',
|
|
AttendanceAppeal: '/teacher-attendance',
|
|
TeacherCourseApplication: '/teaching-preferences',
|
|
ClassroomReservation: '/classroom-reservations',
|
|
GradeSubmissionBatch: '/grades',
|
|
ExperimentGradeSheet: '/experiment-grades',
|
|
CampusRegistration: '/campus-registrations',
|
|
DormitoryApplication: '/dormitory-applications',
|
|
AssessmentDeclaration: '/comprehensive-assessments',
|
|
AssessmentAppeal: '/comprehensive-assessments',
|
|
GradeAppeal: '/grades',
|
|
TeachingImprovement: '/evaluations',
|
|
GraduationClearance: '/graduation-clearance',
|
|
}
|
|
return routes[type]
|
|
}
|
|
|
|
function statusText(status: string) {
|
|
return status === 'Submitted' ? t('approvalBatch.k12') : status === 'Approved' ? t('approvalBatch.k11') : t('approvalBatch.k13')
|
|
}
|
|
|
|
function statusType(status: string) {
|
|
return status === 'Approved' ? 'success' : status === 'Rejected' ? 'danger' : 'warning'
|
|
}
|
|
|
|
function courseScheduleText(course: CourseOption) {
|
|
if (course.schedulingMode === 'Flexible') return t('approvalBatch.k14')
|
|
return course.hasPublishedSchedule ? t('approvalBatch.k15') : t('approvalBatch.k16')
|
|
}
|
|
|
|
onMounted(async () => {
|
|
if (isManager.value && (route.query.tab === 'pending' || targetApprovalId.value)) tab.value = 'pending'
|
|
await load()
|
|
if (typeof route.query.progressType === 'string' && progressTypes.has(route.query.progressType) && typeof route.query.progressId === 'string')
|
|
await openProgress(route.query.progressType, route.query.progressId)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div class="page-stack appr-page">
|
|
<section class="page-intro">
|
|
<div>
|
|
<span class="section-kicker">APPROVAL CENTER</span>
|
|
<h2>{{ t('dashboard.admin.actions.approvals.label') }}</h2>
|
|
<p>{{ isStudent ? t('approvalBatch.k17') : isTeacher ? t('approvalBatch.k18') : t('approvalBatch.k19') }}</p>
|
|
</div>
|
|
<div>
|
|
<el-button v-if="isSuperAdmin" @click="openWorkflowSettings">{{ t('approvalCenterExtra.settings') }}</el-button>
|
|
<el-button :icon="Refresh" @click="load">{{ t('businessLabels.refresh') }}</el-button>
|
|
</div>
|
|
</section>
|
|
|
|
<el-dialog v-model="workflowDialog" :title="t('approvalCenterExtra.settings')" width="min(620px, 95vw)">
|
|
<p>{{ t('approvalCenterExtra.settingsHint') }}</p>
|
|
<div v-for="setting in workflowSettings" :key="setting.type" class="workflow-setting-row">
|
|
<strong>{{ approvalLabel({ type: setting.type }) }}</strong>
|
|
<el-select v-model="setting.reviewerRole">
|
|
<el-option value="AnyManager" :label="t('approvalCenterExtra.anyManager')" />
|
|
<el-option value="CollegeAdmin" :label="t('approvalCenterExtra.collegeReviewer')" />
|
|
<el-option value="AcademicAdmin" :label="t('approvalCenterExtra.academicReviewer')" />
|
|
</el-select>
|
|
<el-button type="primary" :disabled="!!workflowSaving" :loading="workflowSaving === setting.type" @click="saveWorkflowSetting(setting)">{{ t('businessLabels.save') }}</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<el-dialog v-model="progressDialog" :title="`${approvalLabel({ type: progressType })} · ${t('approvalProgress.title')}`" width="min(520px, 95vw)">
|
|
<el-alert v-if="progressIncomplete" :title="t('approvalProgress.incomplete')" type="info" :closable="false" show-icon />
|
|
<el-alert v-if="progressType === 'TeacherCourseApplication'" :title="t('approvalTeacherCurrentCycle')" type="info" :closable="false" show-icon />
|
|
<el-alert v-if="['GradeSheet', 'GradeSubmissionBatch', 'ExperimentGradeSheet', 'AssessmentDeclaration'].includes(progressType)" :title="t('approvalCurrentCycleOnly')" type="info" :closable="false" show-icon />
|
|
<ol class="approval-progress">
|
|
<li v-for="(step, index) in progressSteps" :key="index">
|
|
<strong>{{ progressLabel(step.kind) }}</strong>
|
|
<time>{{ new Date(step.time).toLocaleString(getDisplayLocale()) }}</time>
|
|
<p v-if="step.comment">{{ step.comment }}</p>
|
|
</li>
|
|
</ol>
|
|
</el-dialog>
|
|
|
|
<section v-if="isStudent" v-loading="loading" class="application-launcher">
|
|
<button class="launch-card exemption" type="button" @click="openDialog('exemption')">
|
|
<span class="launch-icon"><DocumentChecked /></span>
|
|
<span class="launch-copy">
|
|
<small>COURSE EXEMPTION</small>
|
|
<b>{{ t('approvalBatch.k20') }}</b>
|
|
<em>{{ t('approvalBatch.k21') }}</em>
|
|
</span>
|
|
<span class="launch-meta">{{ t('approvalBatch.k78', { count: enrolledCourses.length }) }} <Plus /></span>
|
|
</button>
|
|
<button class="launch-card deferred" type="button" @click="openDialog('deferred')">
|
|
<span class="launch-icon"><Clock /></span>
|
|
<span class="launch-copy">
|
|
<small>DEFERRED EXAM</small>
|
|
<b>{{ t('approvalBatch.k22') }}</b>
|
|
<em>{{ t('approvalBatch.k23') }}</em>
|
|
</span>
|
|
<span class="launch-meta">{{ t('approvalBatch.k78', { count: enrolledCourses.length }) }} <Plus /></span>
|
|
</button>
|
|
<button class="launch-card substitution" type="button" @click="openDialog('substitution')">
|
|
<span class="launch-icon"><Switch /></span>
|
|
<span class="launch-copy">
|
|
<small>COURSE SUBSTITUTION</small>
|
|
<b>{{ t('approvalBatch.k24') }}</b>
|
|
<em>{{ t('approvalBatch.k25') }}</em>
|
|
</span>
|
|
<span class="launch-meta">{{ t('approvalBatch.k79', { count: passedGrades.length }) }} <Plus /></span>
|
|
</button>
|
|
</section>
|
|
|
|
<section v-if="isTeacher" class="application-launcher teacher-launcher">
|
|
<button class="launch-card adjustment" type="button" @click="$router.push({ path: '/course-adjustments', query: { create: '1', from: 'approvals' } })">
|
|
<span class="launch-icon"><Switch /></span>
|
|
<span class="launch-copy">
|
|
<small>COURSE ADJUSTMENT</small>
|
|
<b>{{ t('approvalBatch.k26') }}</b>
|
|
<em>{{ t('approvalBatch.k27') }}</em>
|
|
</span>
|
|
<span class="launch-meta">{{ t('approvalBatch.k28') }} <Plus /></span>
|
|
</button>
|
|
<button class="launch-card grade-modification" type="button" @click="openDialog('gradeMod')">
|
|
<span class="launch-icon"><DocumentChecked /></span>
|
|
<span class="launch-copy">
|
|
<small>GRADE MODIFICATION</small>
|
|
<b>{{ t('approvalBatch.k29') }}</b>
|
|
<em>{{ t('approvalBatch.k30') }}</em>
|
|
</span>
|
|
<span class="launch-meta">{{ t('approvalBatch.k28') }} <Plus /></span>
|
|
</button>
|
|
</section>
|
|
|
|
<div class="approval-tabs">
|
|
<el-segmented
|
|
v-model="tab"
|
|
:options="[
|
|
...(isApprover ? [{ label: t('approvalBatch.k80', { count: pendingTotal }), value: 'pending' }] : []),
|
|
{ label: isStudent ? t('approvalBatch.k82', { count: recordCount }) : t('approvalBatch.k81'), value: 'mine' },
|
|
]"
|
|
/>
|
|
</div>
|
|
|
|
<section v-if="tab === 'pending'" v-loading="loading" class="appr-list">
|
|
<div class="approval-monitor">
|
|
<span>{{ t('approvalCenterExtra.pendingTotal', { count: pendingTotal }) }}</span>
|
|
<span v-if="oldestPending">{{ t('approvalCenterExtra.oldest', { title: oldestPending.title, time: new Date(oldestPending.time).toLocaleString(getDisplayLocale()) }) }}</span>
|
|
<el-switch v-model="oldestFirst" :disabled="!!targetApprovalId" :active-text="t('approvalCenterExtra.oldestFirst')" @change="pendingPage = 1; load()" />
|
|
<div class="approval-overdue-filter">
|
|
<el-switch v-model="overdueOnly" :disabled="!!targetApprovalId" :active-text="t('approvalOverdue.only')" @change="pendingPage = 1; load()" />
|
|
<el-input-number :model-value="overdueHours" :disabled="!!targetApprovalId" :min="1" :max="8760" :step="1" :precision="0" size="small" @change="updateOverdueHours" />
|
|
<span>{{ t('approvalOverdue.hours') }}</span>
|
|
</div>
|
|
<small v-if="overdueOnly">{{ t('approvalOverdue.hint') }}</small>
|
|
<div v-if="Object.keys(pendingCounts).length" class="approval-monitor-counts">
|
|
<el-button size="small" :type="selectedPendingType ? 'default' : 'primary'" @click="selectPendingType('')">{{ t('approvalCenterAllTypes') }}</el-button>
|
|
<el-button v-for="(count, type) in pendingCounts" :key="type" size="small" :type="selectedPendingType === type ? 'primary' : 'default'" @click="selectPendingType(String(type))">{{ approvalCountLabel(String(type)) }} · {{ count }}</el-button>
|
|
</div>
|
|
</div>
|
|
<article v-for="item in pending" :key="`${item.type}-${item.id}-${item.secondaryId ?? ''}`" class="appr-card">
|
|
<el-tag size="small" :type="item.type === 'AttendanceAppeal' ? 'warning' : 'primary'">{{ approvalLabel(item) }}</el-tag>
|
|
<div class="appr-body">
|
|
<b>{{ item.title }}</b>
|
|
<p>{{ item.desc }}</p>
|
|
<small>{{ item.college }} · {{ new Date(item.time).toLocaleString(getDisplayLocale()) }}<template v-if="item.stage"> · {{ approvalStageLabel(item.stage) }}</template></small>
|
|
</div>
|
|
<div v-if="isActionable(item)" class="appr-actions">
|
|
<el-button v-if="progressTypes.has(item.type)" size="small" text type="primary" @click="openProgress(item.type, item.id)">{{ t('approvalProgress.title') }}</el-button>
|
|
<el-button v-if="approvalRoute(item.type)" size="small" text type="primary" @click="$router.push({ path: approvalRoute(item.type), query: item.type === 'ClassroomReservation' ? { tab: 'review' } : {} })">{{ t('approvalBatch.k76') }}</el-button>
|
|
<el-button size="small" type="danger" plain :disabled="reviewInProgress" :icon="Close" @click="openReject(item)">{{ t('businessLabels.reject') }}</el-button>
|
|
<el-button size="small" type="success" :disabled="reviewInProgress" :icon="Check" @click="approveItem(item)">{{ t('businessLabels.approve') }}</el-button>
|
|
</div>
|
|
<div v-else-if="approvalRoute(item.type)" class="appr-actions">
|
|
<el-button v-if="progressTypes.has(item.type)" size="small" text type="primary" @click="openProgress(item.type, item.id)">{{ t('approvalProgress.title') }}</el-button>
|
|
<el-button
|
|
size="small"
|
|
text
|
|
type="primary"
|
|
@click="$router.push({ path: approvalRoute(item.type), query: item.type === 'ClassroomReservation' ? { tab: 'review' } : {} })"
|
|
>
|
|
{{ t('approvalBatch.k76') }}
|
|
</el-button>
|
|
</div>
|
|
</article>
|
|
<el-empty v-if="!pending.length" :description="t('approvalBatch.k31')" />
|
|
<el-pagination
|
|
v-if="pendingTotal > pendingPageSize"
|
|
v-model:current-page="pendingPage"
|
|
class="approval-pagination"
|
|
layout="prev, pager, next"
|
|
:page-size="pendingPageSize"
|
|
:total="pendingTotal"
|
|
@current-change="() => load()"
|
|
/>
|
|
</section>
|
|
|
|
<section v-if="tab === 'mine'" v-loading="loading">
|
|
<template v-if="isStudent">
|
|
<div v-if="recordCount" class="record-columns">
|
|
<section class="record-group">
|
|
<header><span class="record-mark exemption"></span><b>{{ t('approvalBatch.k32') }}</b><em>{{ myExemptions.length }}</em></header>
|
|
<div class="appr-list">
|
|
<article v-for="item in myExemptions" :key="item.id" class="appr-card compact">
|
|
<el-tag size="small" :type="statusType(item.status)">{{ statusText(item.status) }}</el-tag>
|
|
<div class="appr-body">
|
|
<b>{{ item.courseName }}</b>
|
|
<p>{{ item.reason }}</p>
|
|
<small v-if="item.reviewComment">{{ t('approvalBatch.k77', { comment: item.reviewComment }) }}</small>
|
|
</div>
|
|
<el-button size="small" text type="primary" @click="openProgress('CourseExemption', item.id)">{{ t('approvalProgress.title') }}</el-button>
|
|
</article>
|
|
<p v-if="!myExemptions.length" class="record-empty">{{ t('approvalBatch.k33') }}</p>
|
|
</div>
|
|
</section>
|
|
<section class="record-group">
|
|
<header><span class="record-mark deferred"></span><b>{{ t('approvalBatch.k34') }}</b><em>{{ myDeferred.length }}</em></header>
|
|
<div class="appr-list">
|
|
<article v-for="item in myDeferred" :key="item.id" class="appr-card compact">
|
|
<el-tag size="small" :type="statusType(item.status)">{{ statusText(item.status) }}</el-tag>
|
|
<div class="appr-body">
|
|
<b>{{ item.courseName }}</b>
|
|
<p>{{ item.reason }}</p>
|
|
<small v-if="item.reviewComment">{{ t('approvalBatch.k77', { comment: item.reviewComment }) }}</small>
|
|
</div>
|
|
<el-button size="small" text type="primary" @click="openProgress('DeferredExam', item.id)">{{ t('approvalProgress.title') }}</el-button>
|
|
</article>
|
|
<p v-if="!myDeferred.length" class="record-empty">{{ t('approvalBatch.k35') }}</p>
|
|
</div>
|
|
</section>
|
|
<section class="record-group substitution-records">
|
|
<header><span class="record-mark substitution"></span><b>{{ t('approvalBatch.k36') }}</b><em>{{ mySubstitutions.length }}</em></header>
|
|
<div class="appr-list">
|
|
<article v-for="item in mySubstitutions" :key="item.id" class="appr-card compact">
|
|
<el-tag size="small" :type="statusType(item.status)">{{ statusText(item.status) }}</el-tag>
|
|
<div class="appr-body">
|
|
<b>{{ item.substituteCourseCode }} {{ item.substituteCourseName }} → {{ item.originalCourseCode }} {{ item.originalCourseName }}</b>
|
|
<p>{{ item.reason }}</p>
|
|
<small v-if="item.reviewComment">{{ t('approvalBatch.k77', { comment: item.reviewComment }) }}</small>
|
|
</div>
|
|
<el-button size="small" text type="primary" @click="openProgress('CourseSubstitution', item.id)">{{ t('approvalProgress.title') }}</el-button>
|
|
</article>
|
|
<p v-if="!mySubstitutions.length" class="record-empty">{{ t('approvalBatch.k37') }}</p>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<el-empty v-else :description="t('approvalBatch.k38')">
|
|
<el-button type="primary" @click="openDialog('exemption')">{{ t('approvalBatch.k39') }}</el-button>
|
|
</el-empty>
|
|
</template>
|
|
</section>
|
|
|
|
<el-dialog v-model="dialog" :title="dialogTitle" width="min(780px, calc(100vw - 24px))" class="application-dialog" destroy-on-close>
|
|
<el-form label-position="top">
|
|
<template v-if="dialogType === 'exemption' || dialogType === 'deferred'">
|
|
<div class="dialog-lead">
|
|
<span :class="['dialog-lead-icon', dialogType]">
|
|
<DocumentChecked v-if="dialogType === 'exemption'" />
|
|
<Clock v-else />
|
|
</span>
|
|
<div>
|
|
<b>{{ dialogType === 'exemption' ? t('approvalBatch.k40') : t('approvalBatch.k41') }}</b>
|
|
<p>{{ t('approvalBatch.k42') }}</p>
|
|
</div>
|
|
</div>
|
|
<el-form-item :label="t('businessLabels.course')" required>
|
|
<el-input v-model="courseKeyword" :prefix-icon="Search" clearable :placeholder="t('approvalBatch.k43')" />
|
|
<div v-if="filteredCourses.length" class="course-picker">
|
|
<button
|
|
v-for="course in filteredCourses"
|
|
:key="course.teachingTaskId"
|
|
type="button"
|
|
:class="['course-choice', { selected: form.teachingTaskId === course.teachingTaskId }]"
|
|
@click="form.teachingTaskId = course.teachingTaskId"
|
|
>
|
|
<span class="course-code">{{ course.courseCode }}</span>
|
|
<span class="course-main">
|
|
<b>{{ course.courseName }}</b>
|
|
<small>{{ course.taskNumber }} · {{ course.academicTermName }}</small>
|
|
<em>{{ t('approvalBatch.k85', { teacher: course.teacherNames.length ? course.teacherNames.join(t('academicPlanning.separator')) : t('approvalBatch.k44'), credits: course.credits }) }}</em>
|
|
</span>
|
|
<span :class="['schedule-state', { ready: course.hasPublishedSchedule || course.schedulingMode === 'Flexible' }]">
|
|
{{ courseScheduleText(course) }}
|
|
</span>
|
|
<span class="choice-check"><Check /></span>
|
|
</button>
|
|
</div>
|
|
<el-empty
|
|
v-else
|
|
:description="enrolledCourses.length ? t('approvalBatch.k45') : t('approvalBatch.k46')"
|
|
:image-size="76"
|
|
>
|
|
<p v-if="!enrolledCourses.length" class="empty-explanation">
|
|
{{ t('approvalBatch.k47') }}
|
|
</p>
|
|
</el-empty>
|
|
</el-form-item>
|
|
</template>
|
|
|
|
<template v-if="dialogType === 'substitution'">
|
|
<el-alert
|
|
:title="t('approvalBatch.k48')"
|
|
:description="t('approvalBatch.k49')"
|
|
type="info"
|
|
:closable="false"
|
|
show-icon
|
|
/>
|
|
<div class="substitution-flow">
|
|
<section class="substitution-column">
|
|
<header><span>1</span><div><b>{{ t('approvalBatch.k50') }}</b><small>{{ t('approvalBatch.k51') }}</small></div></header>
|
|
<el-input v-model="originalKeyword" :prefix-icon="Search" clearable :placeholder="t('approvalBatch.k52')" />
|
|
<div v-if="filteredOriginalCourses.length" class="mini-course-list">
|
|
<button
|
|
v-for="course in filteredOriginalCourses"
|
|
:key="course.courseId"
|
|
type="button"
|
|
:class="{ selected: form.originalCourseId === course.courseId }"
|
|
@click="selectOriginal(course.courseId)"
|
|
>
|
|
<span><b>{{ course.courseCode }} · {{ course.courseName }}</b><small>{{ course.detail }} · {{ t('approvalBatch.k83', { count: course.credits }) }}</small></span>
|
|
<el-tag size="small" :type="course.source === 'assigned' ? 'primary' : 'danger'">
|
|
{{ course.source === 'assigned' ? t('approvalBatch.k53') : t('approvalBatch.k54') }}
|
|
</el-tag>
|
|
</button>
|
|
</div>
|
|
<el-empty v-else :image-size="62" :description="t('approvalBatch.k55')" />
|
|
</section>
|
|
<div class="flow-arrow">→</div>
|
|
<section class="substitution-column">
|
|
<header><span>2</span><div><b>{{ t('equivalency.substitute') }}</b><small>{{ t('approvalBatch.k56') }}</small></div></header>
|
|
<el-input v-model="substituteKeyword" :prefix-icon="Search" clearable :placeholder="t('approvalBatch.k52')" />
|
|
<div v-if="filteredSubstituteCourses.length" class="mini-course-list">
|
|
<button
|
|
v-for="course in filteredSubstituteCourses"
|
|
:key="course.courseId"
|
|
type="button"
|
|
:disabled="course.courseId === form.originalCourseId"
|
|
:class="{ selected: form.substituteCourseId === course.courseId }"
|
|
@click="form.substituteCourseId = course.courseId"
|
|
>
|
|
<span><b>{{ course.courseCode }} · {{ course.courseName }}</b><small>{{ course.academicTermName }} · {{ t('approvalBatch.k83', { count: course.credits }) }}</small></span>
|
|
<strong>{{ course.totalScore }}<small>{{ t('approvalBatch.k86') }}</small></strong>
|
|
</button>
|
|
</div>
|
|
<el-empty v-else :image-size="62" :description="t('approvalBatch.k57')">
|
|
<p class="empty-explanation">{{ t('approvalBatch.k58') }}</p>
|
|
</el-empty>
|
|
</section>
|
|
</div>
|
|
</template>
|
|
|
|
<template v-if="dialogType === 'gradeMod'">
|
|
<el-form-item :label="t('approvalBatch.k59')" required>
|
|
<el-select v-model="form.gradeRecordId" filterable :placeholder="t('approvalBatch.k60')">
|
|
<el-option
|
|
v-for="record in gradeRecords"
|
|
:key="record.id"
|
|
:label="`${record.studentName}(${record.studentNumber}) — ${record.courseName} — ${t('approvalBatch.k84', { score: record.totalScore })}`"
|
|
:value="record.id"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item :label="t('approvalBatch.k61')" required>
|
|
<el-input-number v-model="form.requestedScore" :min="0" :max="100" />
|
|
</el-form-item>
|
|
</template>
|
|
|
|
<el-form-item class="reason-field" :label="t('approvalBatch.k62')" required>
|
|
<el-input
|
|
v-model="form.reason"
|
|
type="textarea"
|
|
:rows="4"
|
|
maxlength="500"
|
|
show-word-limit
|
|
:placeholder="dialogType === 'deferred' ? t('approvalBatch.k63') : dialogType === 'substitution' ? t('approvalBatch.k64') : t('approvalBatch.k65')"
|
|
/>
|
|
</el-form-item>
|
|
</el-form>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<span v-if="selectedCourse">{{ selectedCourse.courseCode }} · {{ selectedCourse.courseName }}</span>
|
|
<span v-else-if="selectedOriginal || selectedSubstitute">
|
|
{{ selectedSubstitute?.courseName ?? t('approvalBatch.k66') }} → {{ selectedOriginal?.courseName ?? t('approvalBatch.k67') }}
|
|
</span>
|
|
<el-button @click="dialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
|
<el-button type="primary" :loading="submitting" @click="submitForm">{{ t('statusChanges.submit') }}</el-button>
|
|
</div>
|
|
</template>
|
|
</el-dialog>
|
|
|
|
<el-dialog v-model="rejectDialog" :title="t('statusChanges.rejectTitle')" width="min(460px, calc(100vw - 24px))">
|
|
<el-input v-model="rejectComment" type="textarea" :rows="3" :maxlength="rejectItem?.type === 'AttendanceAppeal' ? 300 : 500" show-word-limit :placeholder="t('approvalBatch.k68')" />
|
|
<template #footer>
|
|
<el-button @click="rejectDialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
|
<el-button type="danger" :loading="reviewInProgress" @click="rejectSubmit">{{ t('statusChanges.confirmReject') }}</el-button>
|
|
</template>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.application-launcher {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
gap: 12px;
|
|
}
|
|
|
|
.launch-card {
|
|
position: relative;
|
|
min-height: 132px;
|
|
padding: 20px;
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 14px;
|
|
overflow: hidden;
|
|
text-align: left;
|
|
color: #1e293b;
|
|
background: linear-gradient(145deg, #fff 48%, #f6f8fb);
|
|
border: 1px solid #dfe4eb;
|
|
border-radius: 14px;
|
|
cursor: pointer;
|
|
transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
|
|
}
|
|
|
|
.launch-card::after {
|
|
content: "";
|
|
position: absolute;
|
|
right: -26px;
|
|
bottom: -50px;
|
|
width: 120px;
|
|
height: 120px;
|
|
border: 18px solid rgba(67, 97, 238, .05);
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.launch-card:hover {
|
|
transform: translateY(-2px);
|
|
border-color: #aebbd0;
|
|
box-shadow: 0 12px 28px rgba(30, 41, 59, .08);
|
|
}
|
|
|
|
.launch-icon, .dialog-lead-icon {
|
|
width: 42px;
|
|
height: 42px;
|
|
flex: 0 0 auto;
|
|
display: grid;
|
|
place-items: center;
|
|
color: #3556b5;
|
|
background: #edf2ff;
|
|
border-radius: 12px;
|
|
}
|
|
|
|
.launch-icon svg, .dialog-lead-icon svg { width: 21px; }
|
|
.deferred .launch-icon, .dialog-lead-icon.deferred { color: #a85d00; background: #fff3dc; }
|
|
.substitution .launch-icon { color: #087f5b; background: #e8f8f1; }
|
|
.adjustment .launch-icon { color: #7c3aed; background: #f1eafe; }
|
|
.grade-modification .launch-icon { color: #0d7490; background: #e1f5f8; }
|
|
.teacher-launcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.launch-copy { display: grid; gap: 3px; min-width: 0; }
|
|
.launch-copy small { color: #8791a3; font: 600 9px/1.2 ui-monospace, monospace; letter-spacing: .1em; }
|
|
.launch-copy b { margin-top: 3px; font-size: 17px; }
|
|
.launch-copy em { color: #667085; font-size: 11px; font-style: normal; line-height: 1.5; }
|
|
.launch-meta { position: absolute; left: 76px; bottom: 17px; display: flex; align-items: center; gap: 5px; color: #506079; font-size: 10px; }
|
|
.launch-meta svg { width: 12px; }
|
|
|
|
.approval-tabs { display: flex; justify-content: space-between; gap: 12px; }
|
|
.appr-list { display: grid; gap: 8px; }
|
|
.approval-monitor { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px; color: #475467; background: #f3f6fb; border-radius: 10px; font-size: 13px; }
|
|
.approval-monitor .el-switch { margin-left: auto; }
|
|
.approval-monitor-counts { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: 6px; }
|
|
.approval-overdue-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
|
|
.approval-progress { display: grid; gap: 18px; padding-left: 24px; }
|
|
.approval-progress li { padding-left: 4px; }
|
|
.approval-progress time { display: block; margin-top: 4px; color: #667085; font-size: 12px; }
|
|
.approval-progress p { margin: 6px 0 0; white-space: pre-wrap; }
|
|
.workflow-setting-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 12px; align-items: center; margin: 12px 0; }
|
|
.appr-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #fff; border: 1px solid #e4e7ed; border-radius: 10px; }
|
|
.appr-card.compact { align-items: flex-start; padding: 13px; }
|
|
.appr-body { flex: 1; min-width: 0; }
|
|
.appr-body b { display: block; margin-bottom: 4px; font-size: 13px; }
|
|
.appr-body p { margin: 0 0 4px; color: #606266; font-size: 12px; line-height: 1.55; }
|
|
.appr-body small { color: var(--muted); font-size: 10px; }
|
|
.appr-actions { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 6px; }
|
|
|
|
.record-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
|
|
.record-group { padding: 16px; background: #f8fafc; border: 1px solid #e5e9f0; border-radius: 12px; }
|
|
.record-group.substitution-records { grid-column: 1 / -1; }
|
|
.record-group > header { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
|
|
.record-group > header b { font-size: 13px; }
|
|
.record-group > header em { margin-left: auto; min-width: 22px; padding: 3px 7px; color: #667085; background: #fff; border-radius: 10px; font-size: 10px; font-style: normal; text-align: center; }
|
|
.record-mark { width: 8px; height: 8px; background: #4b6fd8; border-radius: 50%; box-shadow: 0 0 0 4px #e8edfb; }
|
|
.record-mark.deferred { background: #d5841c; box-shadow: 0 0 0 4px #fff0d8; }
|
|
.record-mark.substitution { background: #13916a; box-shadow: 0 0 0 4px #dff5ed; }
|
|
.record-empty { margin: 20px 0; color: #98a2b3; font-size: 11px; text-align: center; }
|
|
|
|
.dialog-lead { margin-bottom: 18px; padding: 14px; display: flex; align-items: center; gap: 12px; background: #f7f9fc; border: 1px solid #e6eaf1; border-radius: 10px; }
|
|
.dialog-lead b { display: block; margin-bottom: 3px; font-size: 13px; }
|
|
.dialog-lead p { margin: 0; color: #667085; font-size: 11px; }
|
|
.course-picker { width: 100%; max-height: 330px; margin-top: 10px; display: grid; gap: 8px; overflow: auto; }
|
|
.course-choice { width: 100%; padding: 13px; display: grid; grid-template-columns: 68px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; text-align: left; background: #fff; border: 1px solid #e1e6ee; border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
|
|
.course-choice:hover { border-color: #9aabd4; }
|
|
.course-choice.selected { background: #f4f7ff; border-color: #4b6fd8; box-shadow: inset 3px 0 #4b6fd8; }
|
|
.course-code { color: #3651a3; font: 700 11px/1.3 ui-monospace, monospace; }
|
|
.course-main { display: grid; min-width: 0; gap: 3px; }
|
|
.course-main b { color: #1e293b; font-size: 13px; }
|
|
.course-main small, .course-main em { overflow: hidden; color: #7b8495; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
|
|
.schedule-state { padding: 4px 7px; color: #8a6116; background: #fff4d9; border-radius: 6px; font-size: 9px; }
|
|
.schedule-state.ready { color: #087f5b; background: #e5f7ef; }
|
|
.choice-check { display: grid; place-items: center; width: 18px; height: 18px; color: transparent; border: 1px solid #cfd5df; border-radius: 50%; }
|
|
.choice-check svg { width: 11px; }
|
|
.course-choice.selected .choice-check { color: #fff; background: #4b6fd8; border-color: #4b6fd8; }
|
|
.empty-explanation { max-width: 450px; margin: -10px auto 0; color: #8992a3; font-size: 10px; line-height: 1.6; }
|
|
|
|
.substitution-flow { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: stretch; gap: 10px; }
|
|
.substitution-column { min-width: 0; padding: 14px; background: #f8fafc; border: 1px solid #e5e9f0; border-radius: 12px; }
|
|
.substitution-column > header { margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
|
|
.substitution-column > header > span { width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: #405fb7; border-radius: 8px; font: 700 11px/1 ui-monospace, monospace; }
|
|
.substitution-column > header div { display: grid; gap: 2px; }
|
|
.substitution-column > header b { font-size: 12px; }
|
|
.substitution-column > header small { color: #8a94a5; font-size: 9px; }
|
|
.flow-arrow { display: grid; place-items: center; color: #7d8fbf; font-size: 18px; }
|
|
.mini-course-list { max-height: 255px; margin-top: 9px; display: grid; align-content: start; gap: 6px; overflow: auto; }
|
|
.mini-course-list button { padding: 10px; display: flex; align-items: center; gap: 8px; text-align: left; background: #fff; border: 1px solid #e2e7ee; border-radius: 8px; cursor: pointer; }
|
|
.mini-course-list button:hover { border-color: #a9b5d3; }
|
|
.mini-course-list button.selected { background: #f0f4ff; border-color: #4b6fd8; box-shadow: inset 3px 0 #4b6fd8; }
|
|
.mini-course-list button:disabled { opacity: .45; cursor: not-allowed; }
|
|
.mini-course-list button > span { min-width: 0; display: grid; flex: 1; gap: 3px; }
|
|
.mini-course-list button b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
.mini-course-list button span small { color: #8a94a5; font-size: 9px; }
|
|
.mini-course-list button > strong { color: #087f5b; font-size: 16px; }
|
|
.mini-course-list button > strong small { margin-left: 1px; font-size: 8px; font-weight: 500; }
|
|
.reason-field { margin-top: 18px; }
|
|
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
|
|
.dialog-footer > span { margin-right: auto; overflow: hidden; color: #667085; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
@media (max-width: 860px) {
|
|
.application-launcher { grid-template-columns: 1fr; }
|
|
.launch-card { min-height: 112px; }
|
|
.record-columns { grid-template-columns: 1fr; }
|
|
.record-group.substitution-records { grid-column: auto; }
|
|
.substitution-flow { grid-template-columns: 1fr; }
|
|
.flow-arrow { transform: rotate(90deg); }
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
.page-intro { align-items: flex-start; }
|
|
.approval-tabs { align-items: flex-start; }
|
|
.course-choice { grid-template-columns: 58px minmax(0, 1fr) 18px; }
|
|
.schedule-state { grid-column: 2; justify-self: start; }
|
|
.appr-card { align-items: flex-start; flex-wrap: wrap; }
|
|
.appr-actions { width: 100%; justify-content: flex-end; }
|
|
}
|
|
</style>
|