From e14939edb94f80481a2202d8edf8cbaf365f8ee8 Mon Sep 17 00:00:00 2001 From: biss Date: Mon, 30 Nov 2026 17:02:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=AF=B9=E6=AF=94=E5=BA=A6=E4=B8=8E=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E5=BC=8F=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/e2e/approval-center.spec.ts | 9 +- web/e2e/button-contrast.spec.ts | 77 +++++++++++ web/e2e/role-layout.spec.ts | 46 +++++++ web/e2e/tuition-responsive.spec.ts | 4 + web/src/App.vue | 7 + web/src/components/CustomExportDialog.vue | 2 +- web/src/components/GradeAppealPanel.vue | 7 +- .../NotificationDeliverySettings.vue | 4 + web/src/i18n/messages/en-US/attendance.ts | 2 + web/src/i18n/messages/zh-CN/attendance.ts | 2 + web/src/style.css | 126 ++++++++++++++---- web/src/views/AcademicCalendarView.vue | 4 +- web/src/views/ApprovalCenterView.vue | 4 +- web/src/views/CampusRegistrationsView.vue | 2 + web/src/views/DashboardView.vue | 6 +- web/src/views/OfficialDocumentsView.vue | 4 +- web/src/views/PluginsView.vue | 4 +- web/src/views/StudentDashboardView.vue | 6 +- web/src/views/TeacherAttendanceView.vue | 4 +- web/src/views/TeacherRosterView.vue | 2 +- web/src/views/TeachingMonitoringView.vue | 6 +- 21 files changed, 278 insertions(+), 50 deletions(-) create mode 100644 web/e2e/button-contrast.spec.ts create mode 100644 web/e2e/role-layout.spec.ts diff --git a/web/e2e/approval-center.spec.ts b/web/e2e/approval-center.spec.ts index 2289646..57f31ab 100644 --- a/web/e2e/approval-center.spec.ts +++ b/web/e2e/approval-center.spec.ts @@ -9,7 +9,7 @@ const cases: { type: string; stage: string | null; secondaryId?: string; endpoin { type: 'DormitoryApplication', stage: 'counselor', endpoint: '/api/dormitory-services/applications/item-1/counselor-review', body: { approved: true, comment: null }, progress: true }, { type: 'AttendanceAppeal', stage: null, secondaryId: 'sheet-1', endpoint: '/api/attendance/appeals/sheet-1/item-1/review', body: { approve: false, comment: '理由不充分' }, reject: true }, { type: 'TeacherCourseApplication', stage: null, endpoint: '/api/teacher-course-applications/item-1/review', body: { status: 'Rejected', reviewComment: '理由不充分' }, reject: true }, - { type: 'CourseExemption', stage: null, endpoint: '/api/approvals/exemptions/item-1/approve', body: null, progress: true }, + { type: 'CourseExemption', stage: null, endpoint: '/api/approvals/exemptions/item-1/approve', body: { comment: '' }, progress: true }, { type: 'CourseAdjustment', stage: null, endpoint: '/api/course-adjustments/item-1/approve', body: null, progress: true }, ] @@ -28,6 +28,8 @@ for (const scenario of cases) test(`${scenario.type} can be ${scenario.reject ? let overdueRequested = false await page.route(url => url.pathname.startsWith('/api/'), async route => { const url = new URL(route.request().url()) + if (url.pathname === '/api/approvals/reviewed') return route.fulfill({ json: { items: [], total: 0 } }) + if (url.pathname === '/api/student-leaves/pending') return route.fulfill({ json: [] }) if (url.pathname === '/api/approvals/pending') { if (url.searchParams.has('overdueHours')) { expect(url.searchParams.get('overdueHours')).toBe('72') @@ -77,7 +79,10 @@ for (const scenario of cases) test(`${scenario.type} can be ${scenario.reject ? const dialog = page.getByRole('dialog') await dialog.locator('textarea').fill('理由不充分') await dialog.getByRole('button', { name: '确认驳回' }).click() - } else await card.getByRole('button', { name: '通过' }).click() + } else { + await card.getByRole('button', { name: '通过' }).click() + if (scenario.type === 'CourseExemption') await page.getByRole('dialog').getByRole('button', { name: '通过', exact: true }).click() + } await expect(card).toHaveCount(0) expect(reviewed).toBe(true) expect(pageErrors).toEqual([]) diff --git a/web/e2e/button-contrast.spec.ts b/web/e2e/button-contrast.spec.ts new file mode 100644 index 0000000..56bb162 --- /dev/null +++ b/web/e2e/button-contrast.spec.ts @@ -0,0 +1,77 @@ +import { test, expect } from '@playwright/test' +import { readFileSync } from 'node:fs' +import { resolve } from 'node:path' + +// Exercise the real Element Plus selectors in either stylesheet order: Vite may +// load a component's on-demand CSS after the application's global stylesheet. +for (const componentCssLast of [false, true]) { + test(`button variants stay legible (component CSS ${componentCssLast ? 'last' : 'first'})`, async ({ page }) => { + const elementCss = readFileSync(resolve('node_modules/element-plus/theme-chalk/el-button.css'), 'utf8') + const appCss = readFileSync(resolve('src/style.css'), 'utf8') + await page.setContent('
') + for (const content of componentCssLast ? [appCss, elementCss] : [elementCss, appCss]) { + await page.addStyleTag({ content }) + } + const results = await page.evaluate(() => { + const main = document.querySelector('main')! + const luminance = (color: string) => { + const channels = color.match(/[\d.]+/g)!.slice(0, 3).map(Number).map(value => { + const channel = value / 255 + return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4 + }) + return 0.2126 * channels[0]! + 0.7152 * channels[1]! + 0.0722 * channels[2]! + } + const failures: string[] = [] + for (const type of ['', 'primary', 'success', 'info', 'warning', 'danger']) { + for (const variant of ['', 'is-plain', 'is-text', 'is-link', 'is-dashed']) { + for (const disabled of [false, true]) { + const button = document.createElement('button') + button.className = ['el-button', type && `el-button--${type}`, variant, disabled && 'is-disabled'].filter(Boolean).join(' ') + button.textContent = '操作 Action' + main.appendChild(button) + const style = getComputedStyle(button) + const background = style.backgroundColor === 'rgba(0, 0, 0, 0)' ? 'rgb(255, 255, 255)' : style.backgroundColor + const values = [luminance(style.color), luminance(background)].sort((a, b) => b - a) + const ratio = (values[0]! + 0.05) / (values[1]! + 0.05) + if (ratio < 4.5) failures.push(`${button.className}: ${style.color} on ${background} = ${ratio.toFixed(2)}`) + button.remove() + } + } + } + return failures + }) + expect(results).toEqual([]) + }) +} + +test('selection cards retain readable secondary labels and statuses', async ({ page }) => { + await page.setContent(` +
+
+
+
+
+ `) + await page.addStyleTag({ content: readFileSync(resolve('src/style.css'), 'utf8') }) + const failures = await page.evaluate(() => { + const lightness = (color: string) => { + const rgb = color.match(/[\d.]+/g)!.slice(0, 3).map(Number).map(x => { + const value = x / 255 + return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4 + }) + return 0.2126 * rgb[0]! + 0.7152 * rgb[1]! + 0.0722 * rgb[2]! + } + return [...document.querySelectorAll('button span, button small, button i')].flatMap(element => { + const color = getComputedStyle(element).color + let background = 'rgb(255, 255, 255)' + for (let current: Element | null = element; current; current = current.parentElement) { + const candidate = getComputedStyle(current).backgroundColor + if (candidate !== 'rgba(0, 0, 0, 0)') { background = candidate; break } + } + const values = [lightness(color), lightness(background)].sort((a, b) => b - a) + const contrast = (values[0]! + 0.05) / (values[1]! + 0.05) + return contrast < 4.5 ? [`${element.parentElement?.parentElement?.className} ${element.className}: ${contrast.toFixed(2)}`] : [] + }) + }) + expect(failures).toEqual([]) +}) diff --git a/web/e2e/role-layout.spec.ts b/web/e2e/role-layout.spec.ts new file mode 100644 index 0000000..40674aa --- /dev/null +++ b/web/e2e/role-layout.spec.ts @@ -0,0 +1,46 @@ +import { expect, test } from '@playwright/test' + +const routes: Record = { + SuperAdmin: ['/teaching-monitoring', '/campus-registrations', '/plugins', '/official-documents'], + Teacher: ['/dashboard', '/account', '/teaching-preferences', '/my-timetable', '/teacher-roster', '/teacher-attendance', '/classroom-reservations', '/experiments', '/experiment-grades', '/grades', '/grade-analytics', '/exams', '/makeup-exams', '/course-adjustments', '/notifications', '/academic-calendar', '/approvals', '/evaluations'], + Student: ['/dashboard', '/account', '/my-profile', '/my-curriculum', '/academic-planning', '/my-timetable', '/my-attendance', '/free-classrooms', '/classroom-reservations', '/campus-registrations', '/tuition', '/dormitory-services', '/dormitory-hygiene', '/experiments', '/experiment-grades', '/course-selections', '/grades', '/academic-overview', '/other-exams', '/physical-fitness', '/comprehensive-assessments', '/exams', '/makeup-exams', '/notifications', '/academic-calendar', '/approvals', '/warnings', '/student-status-changes', '/official-documents', '/graduation-audits', '/degree-awards', '/graduation-clearance', '/evaluations'], +} +const plugins = ['statistics', 'experiments', 'campus-services', 'evaluations', 'examinations', 'physical-fitness', 'comprehensive-assessment', 'student-services', 'graduation'] + +for (const [role, paths] of Object.entries(routes)) { + test(`${role} routes fit mobile and desktop with unavailable business data`, async ({ page }) => { + test.setTimeout(240_000) + const user = { id: 'layout-user', userName: 'layout-user', displayName: '测试用户', roles: [role], permissions: role === 'SuperAdmin' ? ['system.plugins.manage'] : [], effectiveDataScope: role === 'SuperAdmin' ? 'All' : 'Self' } + await page.addInitScript(savedUser => { + localStorage.setItem('jiaowu_token', 'layout-test-token') + localStorage.setItem('jiaowu_user', JSON.stringify(savedUser)) + localStorage.setItem('jiaowu_access_expires_at', '2099-01-01T00:00:00Z') + localStorage.setItem('jiaowu_session_expires_at', '2099-01-01T00:00:00Z') + }, user) + await page.route(url => url.pathname.startsWith('/api/'), route => { + const path = new URL(route.request().url()).pathname + if (path === '/api/auth/me') return route.fulfill({ json: user }) + if (path === '/api/plugins/runtime') return route.fulfill({ json: plugins.map(id => ({ id: `mingxu.${id}`, isEnabled: true, navigationPaths: [], capabilities: [] })) }) + if (path === '/api/licenses/status') return route.fulfill({ json: { isLicensed: true } }) + if (path === '/api/dashboard') return route.fulfill({ json: { greeting: { title: '测试教师', subtitle: '测试学期', narrative: '页面布局检查', label: '概览', insights: [] } } }) + if (path === '/api/grades/sheets') return route.fulfill({ json: { items: [], total: 0 } }) + return route.fulfill({ status: 503, json: { message: 'Test data unavailable' } }) + }) + const failures: string[] = [] + for (const width of [390, 1024]) { + await page.setViewportSize({ width, height: 844 }) + for (const path of paths) { + await page.goto(path, { waitUntil: 'domcontentloaded' }) + try { + await expect(page.locator('h1, h2').first()).toBeVisible({ timeout: 8000 }) + if (new URL(page.url()).pathname !== path) failures.push(`${width} ${path}: redirected to ${page.url()}`) + const overflow = await page.evaluate(() => document.documentElement.scrollWidth - window.innerWidth) + if (overflow > 1) failures.push(`${width} ${path}: horizontal overflow ${overflow}px`) + } catch { + failures.push(`${width} ${path}: heading did not render (${page.url()})`) + } + } + } + expect(failures).toEqual([]) + }) +} diff --git a/web/e2e/tuition-responsive.spec.ts b/web/e2e/tuition-responsive.spec.ts index f81951c..28b349d 100644 --- a/web/e2e/tuition-responsive.spec.ts +++ b/web/e2e/tuition-responsive.spec.ts @@ -2,6 +2,8 @@ import { expect, test } from '@playwright/test' for (const role of ['Student', 'AcademicAdmin']) { test(`${role} tuition and fee catalog fit a mobile viewport`, async ({ page }) => { + const pageErrors: string[] = [] + page.on('pageerror', error => pageErrors.push(error.message)) await page.setViewportSize({ width: 360, height: 800 }) const user = { id: 'user-1', userName: 'user', displayName: '测试用户', roles: [role], permissions: [], effectiveDataScope: 'All' } await page.addInitScript(savedUser => { @@ -19,6 +21,7 @@ for (const role of ['Student', 'AcademicAdmin']) { if (path === '/api/tuition/mine/payments') return route.fulfill({ json: [] }) if (path === '/api/tuition/terms') return route.fulfill({ json: [{ id: 'term-1', name: '秋季', isCurrent: true, setting: { status: 'OpenForPayment', creditUnitPrice: 10 } }] }) if (path === '/api/tuition/bills') return route.fulfill({ json: { items: [bill], total: 1 } }) + if (['/api/base-data/colleges', '/api/base-data/majors', '/api/base-data/classes'].includes(path)) return route.fulfill({ json: [] }) if (path === '/api/fee-catalog') return route.fulfill({ json: [{ id: 'fee-1', name: '学生证补办工本费', description: '长期收费项目', presetAmounts: [10, 20], allowCustomAmount: true, isEnabled: true }] }) if (path === '/api/fee-catalog/payments') return route.fulfill({ json: [] }) return route.fulfill({ json: {} }) @@ -42,6 +45,7 @@ for (const role of ['Student', 'AcademicAdmin']) { await page.setViewportSize({ width: 1440, height: 900 }) await expect(page.locator('.fee-catalog .desktop-table').first()).toBeVisible() await expect(feeCard).toBeHidden() + expect(pageErrors).toEqual([]) }) } diff --git a/web/src/App.vue b/web/src/App.vue index 3ad6cf0..6ddf442 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -53,4 +53,11 @@ const elementLocale = computed(() => currentLocale.value === 'en-US' ? en : zhCn box-shadow: 0 8px 28px rgb(32 48 58 / 18%); font-size: 14px; } +@media (max-width: 600px) { + .license-expired-notice { + position: static; + max-width: none; + margin: 12px 14px; + } +} diff --git a/web/src/components/CustomExportDialog.vue b/web/src/components/CustomExportDialog.vue index f8b2427..44eb812 100644 --- a/web/src/components/CustomExportDialog.vue +++ b/web/src/components/CustomExportDialog.vue @@ -77,7 +77,7 @@ defineExpose({ open }) .drag-handle { cursor: grab; color: var(--el-text-color-secondary); } .column-actions { display: flex; flex-shrink: 0; gap: 3px; } .column-actions button { border: 0; background: transparent; color: var(--el-color-primary); cursor: pointer; font-size: 16px; } -.column-actions button:disabled { color: var(--el-disabled-text-color); cursor: default; } +.column-actions button:disabled { color: var(--button-disabled-text); cursor: not-allowed; } .empty { color: var(--el-text-color-placeholder); text-align: center; } .export-options { margin-top: 16px; } @media (max-width: 600px) { .export-columns { grid-template-columns: 1fr; } .column-list { min-height: 80px; max-height: 180px; } } diff --git a/web/src/components/GradeAppealPanel.vue b/web/src/components/GradeAppealPanel.vue index 9deb729..f6ecc90 100644 --- a/web/src/components/GradeAppealPanel.vue +++ b/web/src/components/GradeAppealPanel.vue @@ -108,7 +108,7 @@ onMounted(load)
{{ t(student ? 'gradeAppeal.myTitle' : 'gradeAppeal.reviewTitle') }}{{ t(student ? 'gradeAppeal.myDescription' : 'gradeAppeal.reviewDescription') }}
-
{{ t('gradeAppeal.refresh') }}
+
{{ t('gradeAppeal.refresh') }}
@@ -140,5 +140,8 @@ onMounted(load) diff --git a/web/src/components/NotificationDeliverySettings.vue b/web/src/components/NotificationDeliverySettings.vue index 1bda6da..73578f4 100644 --- a/web/src/components/NotificationDeliverySettings.vue +++ b/web/src/components/NotificationDeliverySettings.vue @@ -259,4 +259,8 @@ onMounted(load) diff --git a/web/src/i18n/messages/en-US/attendance.ts b/web/src/i18n/messages/en-US/attendance.ts index 1862037..9371d72 100644 --- a/web/src/i18n/messages/en-US/attendance.ts +++ b/web/src/i18n/messages/en-US/attendance.ts @@ -317,6 +317,8 @@ export default { add: "Add event", currentTerm: "Current term", today: "Today", + previousMonth: "Previous month", + nextMonth: "Next month", teachingSchedule: "Teaching event", due: "Due soon", info: "Calendar reminders are informational. They are not tasks and do not restrict any workflow.", diff --git a/web/src/i18n/messages/zh-CN/attendance.ts b/web/src/i18n/messages/zh-CN/attendance.ts index 162e2e4..4d00a95 100644 --- a/web/src/i18n/messages/zh-CN/attendance.ts +++ b/web/src/i18n/messages/zh-CN/attendance.ts @@ -296,6 +296,8 @@ export default { add: "新增日程", currentTerm: "当前学期", today: "今天", + previousMonth: "上个月", + nextMonth: "下个月", teachingSchedule: "教学日程", due: "临期", info: "这里是校历提醒,不表示您有待办,也不会限制任何业务操作。", diff --git a/web/src/style.css b/web/src/style.css index f0b040e..b674389 100644 --- a/web/src/style.css +++ b/web/src/style.css @@ -91,12 +91,13 @@ button:disabled { cursor: not-allowed; } .workspace-context span { color: #aeb9d8; font-size: 10px; letter-spacing: .08em; } .workspace-context b { font-size: 14px; font-weight: 550; letter-spacing: .04em; } .user-block { margin-left: auto; display: flex; align-items: center; gap: 11px; } -.locale-select { width: 116px; } +.locale-select { flex: 0 0 116px; width: 116px; } .desktop-locale-select { margin-left: 2px; } .topbar .locale-select .el-select__wrapper { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); } .topbar .locale-select .el-select__selected-item, .topbar .locale-select .el-select__caret { color: #eef2ff; } -.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #123b3e; background: #59d3c1; font-weight: 750; } +.avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #123b3e; background: #59d3c1; font-weight: 750; } +.user-copy { flex: 0 0 auto; white-space: nowrap; } .user-copy b, .user-copy span { display: block; } .user-copy b { color: white; font-size: 13px; } .user-copy span { margin-top: 3px; color: #aeb9d8; font-size: 10px; } @@ -234,9 +235,11 @@ button:disabled { cursor: not-allowed; } .page-stack { display: grid; gap: 18px; } .page-stack > * { min-width: 0; } .page-intro { min-height: 106px; padding: 8px 4px; display: flex; align-items: center; justify-content: space-between; gap: 20px; } +.page-intro > div:first-child { flex: 1 1 auto; min-width: min(240px, 100%); } .page-intro h2 { margin: 7px 0 7px; font-family: "STZhongsong", "Songti SC", serif; font-size: 27px; } .page-intro p { margin: 0; color: var(--muted); font-size: 13px; } -.page-actions { display: flex; align-items: center; gap: 8px; } +.page-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; } +.page-actions .el-button + .el-button { margin-left: 0; } .data-card { border: 1px solid var(--line); background: white; overflow: hidden; } .data-tabs { display: grid; grid-template-columns: repeat(var(--tab-count, 7), minmax(105px, 1fr)); border-bottom: 1px solid var(--line); overflow-x: auto; } .data-tabs button { min-width: 110px; padding: 16px 15px 14px; text-align: left; border: none; border-right: 1px solid #eaedf1; border-bottom: 3px solid transparent; color: var(--ink); background: #fafbfc; } @@ -453,7 +456,7 @@ button:disabled { cursor: not-allowed; } .registry-switch button { padding: 22px 26px; display: grid; gap: 4px; text-align: left; border: none; border-right: 1px solid var(--line); border-bottom: 3px solid transparent; background: white; } .registry-switch button:hover { background: #fafbfc; } .registry-switch button.active { border-bottom-color: var(--teal); background: #f7fbfa; } -.registry-switch button > span { color: #9ba3b1; font: 700 9px/1.2 Consolas, monospace; letter-spacing: .13em; } +.registry-switch button > span { color: var(--text-subtle); font: 700 9px/1.2 Consolas, monospace; letter-spacing: .13em; } .registry-switch button > b { font-family: "STZhongsong", "Songti SC", serif; font-size: 19px; } .registry-switch button > small { color: var(--muted); font-size: 11px; } .registry-total { padding: 20px; display: grid; place-content: center; text-align: center; background: var(--indigo-deep); color: white; } @@ -510,10 +513,10 @@ button:disabled { cursor: not-allowed; } .plan-list > button.active { padding-left: 17px; border-left: 3px solid var(--teal); background: white; } .plan-list > button span { padding-right: 55px; color: var(--muted); font-size: 10px; } .plan-list > button b { font-size: 13px; line-height: 1.5; } -.plan-list > button small { color: #969eac; font-size: 10px; } -.plan-list > button i { position: absolute; right: 14px; top: 16px; padding: 3px 7px; border-radius: 10px; color: #777f8d; background: #eef0f3; font-size: 9px; font-style: normal; } -.plan-list > button i.published { color: var(--teal); background: #e5f4f1; } -.plan-list > button i.archived { color: #8d7760; background: #f2ece4; } +.plan-list > button small { color: var(--text-subtle); font-size: 10px; } +.plan-list > button i { position: absolute; right: 14px; top: 16px; padding: 3px 7px; border-radius: 10px; color: #505d6e; background: #eef0f3; font-size: 9px; font-style: normal; } +.plan-list > button i.published { color: #00665e; background: #e5f4f1; } +.plan-list > button i.archived { color: #69543e; background: #f2ece4; } .plan-pagination { margin-top: auto; min-height: 58px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); } .plan-pagination > span { color: var(--muted); font-size: 10px; } .plan-detail { min-width: 0; padding: 26px; } @@ -595,7 +598,7 @@ button:disabled { cursor: not-allowed; } .schedule-version-strip > button.active { color: white; border-color: var(--indigo); background: var(--indigo); } .schedule-version-strip b { font: 700 14px/1.2 Consolas, monospace; } .schedule-version-strip span, .schedule-version-strip small { font-size: 9px; } -.schedule-version-strip small { grid-column: 1 / -1; color: #9199a8; } +.schedule-version-strip small { grid-column: 1 / -1; color: var(--text-subtle); } .schedule-version-strip > button.active small { color: #cbd3eb; } .schedule-version-strip > span { align-self: center; color: var(--muted); font-size: 11px; } .schedule-sheet { min-width: 0; border: 1px solid var(--line); background: white; } @@ -701,7 +704,7 @@ button:disabled { cursor: not-allowed; } color: white; background: linear-gradient(115deg, #1b3067, #294584); } .selection-round-strip span, .selection-round-strip small { - overflow: hidden; color: #868f9e; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; + overflow: hidden; color: var(--text-subtle); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; } .selection-round-strip b { grid-column: 1 / -1; overflow: hidden; font-family: "STZhongsong", "Songti SC", serif; @@ -709,9 +712,9 @@ button:disabled { cursor: not-allowed; } } .selection-round-strip i { align-self: start; padding: 3px 7px; border-radius: 10px; - color: #6d7583; background: #edf0f3; font-size: 9px; font-style: normal; + color: #505d6e; background: #edf0f3; font-size: 9px; font-style: normal; } -.selection-round-strip i.open { color: var(--teal); background: #e5f4f1; } +.selection-round-strip i.open { color: #00665e; background: #e5f4f1; } .selection-round-strip > button.active span, .selection-round-strip > button.active small { color: #c6d0e8; } .selection-round-strip > button.active i { color: white; background: rgba(255,255,255,.14); } @@ -956,12 +959,12 @@ button:disabled { cursor: not-allowed; } font-size: 14px; white-space: nowrap; text-overflow: ellipsis; } .grade-sheet-list i { - padding: 3px 7px; border-radius: 10px; color: #777f8c; + padding: 3px 7px; border-radius: 10px; color: #505d6e; background: #eceff3; font-size: 9px; font-style: normal; } -.grade-sheet-list i.submitted { color: #a66b16; background: #fbefd9; } -.grade-sheet-list i.approved, .grade-sheet-list i.published { color: var(--teal); background: #e4f4f0; } -.grade-sheet-list i.returned { color: #b05252; background: #f8e7e7; } +.grade-sheet-list i.submitted { color: #805000; background: #fbefd9; } +.grade-sheet-list i.approved, .grade-sheet-list i.published { color: #00665e; background: #e4f4f0; } +.grade-sheet-list i.returned { color: #9b3030; background: #f8e7e7; } .grade-register { min-width: 0; } .grade-create-empty { min-height: 620px; display: grid; place-content: center; justify-items: center; @@ -1211,10 +1214,10 @@ button:disabled { cursor: not-allowed; } .degree-batch-strip { padding:10px; display:flex; gap:9px; overflow-x:auto; border:1px solid var(--line); background:white; } .degree-batch-strip button { flex:0 0 290px; padding:14px; display:grid; grid-template-columns:1fr auto; gap:6px; text-align:left; border:1px solid var(--line); background:#fafbfc; } -.degree-batch-strip button.active { color:white; border-color:#8b692d; background:linear-gradient(120deg,#263968,#8b692d); } +.degree-batch-strip button.active { color:white; border-color:#6b501f; background:linear-gradient(120deg,#263968,#6b501f); } .degree-batch-strip b { grid-column:1/-1; font:600 15px "STZhongsong","Songti SC",serif; } .degree-batch-strip span,.degree-batch-strip small,.degree-batch-strip i { color:#8b93a2; font-size:9px; font-style:normal; } -.degree-batch-strip button.active span,.degree-batch-strip button.active small { color:#e3d8bd; } +.degree-batch-strip button.active span,.degree-batch-strip button.active small { color:#fff; } .degree-workbench { border:1px solid var(--line); background:white; } .degree-workbench > header { padding:21px 24px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:1px solid var(--line); } .degree-workbench header span { color:#a27b36; font:700 9px Consolas,monospace; letter-spacing:.13em; } @@ -1262,7 +1265,7 @@ button:disabled { cursor: not-allowed; } .clearance-batch-strip button.active { color:white; border-color:var(--indigo); background:linear-gradient(120deg,#182958,#234477 66%,#19736f); } .clearance-batch-strip b { grid-column:1/-1; font:600 15px "STZhongsong","Songti SC",serif; } .clearance-batch-strip span,.clearance-batch-strip small,.clearance-batch-strip i { color:#8b93a2; font-size:9px; font-style:normal; } -.clearance-batch-strip button.active span,.clearance-batch-strip button.active small { color:#c4d6dd; } +.clearance-batch-strip button.active span,.clearance-batch-strip button.active small { color:#fff; } .clearance-workbench { border:1px solid var(--line); background:white; } .clearance-workbench > header { padding:21px 24px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-bottom:1px solid var(--line); } .clearance-workbench header span { color:var(--teal); font:700 9px Consolas,monospace; letter-spacing:.13em; } @@ -1356,6 +1359,10 @@ button:disabled { cursor: not-allowed; } .sso-binding-card > a { color: #315b73; font-size: 13px; font-weight: 650; text-decoration: none; } @media (max-width: 1100px) { + .topbar { gap: 12px; padding-inline: 20px; } + .top-brand { min-width: 0; padding-right: 16px; } + .workspace-context { min-width: 0; } + .workspace-context > span { display: none; } .desktop-navigation { padding-inline: 20px; } .horizontal-menu.el-menu--horizontal > .el-menu-item, .horizontal-menu.el-menu--horizontal > .el-sub-menu .el-sub-menu__title { padding-inline: 12px; } @@ -1486,7 +1493,7 @@ button:disabled { cursor: not-allowed; } @media (max-width: 600px) { .page-intro { align-items: flex-start; flex-direction: column; } - .page-actions { width: 100%; flex-wrap: wrap; } + .page-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; } .option-filter-grid.course, .option-filter-grid.course.compact, .option-filter-grid.classes { grid-template-columns: 1fr; } @@ -1721,6 +1728,9 @@ button:focus-visible { padding-right: 10px; padding-left: 10px; } +.el-button.el-button.is-circle { width: 36px; height: 36px; padding: 0; } +.el-button.el-button--small.is-circle { width: 30px; height: 30px; } +.el-button.el-button--large.is-circle { width: 42px; height: 42px; } .el-button.is-text, .el-button.is-link { min-height: 30px; @@ -1730,7 +1740,7 @@ button:focus-visible { } /* Keep secondary actions legible instead of falling back to Element Plus' pale default token set. */ -.el-button--default { +.el-button:not(.el-button--primary, .el-button--success, .el-button--info, .el-button--warning, .el-button--danger) { --el-button-text-color: var(--action-primary); --el-button-bg-color: var(--surface); --el-button-border-color: var(--line-strong); @@ -1744,7 +1754,7 @@ button:focus-visible { --el-button-disabled-bg-color: var(--button-disabled-surface); --el-button-disabled-border-color: var(--button-disabled-border); } -.el-button--primary { +.el-button.el-button--primary { --el-button-text-color: var(--action-primary-text); --el-button-bg-color: var(--action-primary); --el-button-border-color: var(--action-primary); @@ -1758,7 +1768,7 @@ button:focus-visible { --el-button-disabled-bg-color: var(--button-disabled-surface); --el-button-disabled-border-color: var(--button-disabled-border); } -.el-button--success { +.el-button.el-button--success { --el-button-text-color: #ffffff; --el-button-bg-color: #006f66; --el-button-border-color: #006f66; @@ -1772,7 +1782,7 @@ button:focus-visible { --el-button-disabled-bg-color: var(--button-disabled-surface); --el-button-disabled-border-color: var(--button-disabled-border); } -.el-button--info { +.el-button.el-button--info { --el-button-text-color: #ffffff; --el-button-bg-color: #46566f; --el-button-border-color: #46566f; @@ -1786,7 +1796,7 @@ button:focus-visible { --el-button-disabled-bg-color: var(--button-disabled-surface); --el-button-disabled-border-color: var(--button-disabled-border); } -.el-button--warning { +.el-button.el-button--warning { --el-button-text-color: #ffffff; --el-button-bg-color: #9a5b00; --el-button-border-color: #9a5b00; @@ -1800,7 +1810,7 @@ button:focus-visible { --el-button-disabled-bg-color: var(--button-disabled-surface); --el-button-disabled-border-color: var(--button-disabled-border); } -.el-button--danger { +.el-button.el-button--danger { --el-button-text-color: #ffffff; --el-button-bg-color: #b42318; --el-button-border-color: #b42318; @@ -1816,6 +1826,70 @@ button:focus-visible { } .el-button--primary { box-shadow: 0 2px 5px rgba(35, 56, 118, .12); } .el-button--primary:hover { box-shadow: 0 4px 9px rgba(35, 56, 118, .18); } + +/* Element Plus gives plain, text and link variants their own higher-specificity + tokens. Keep each semantic colour readable on the light surfaces they use. */ +.el-button:is(.is-plain, .is-text, .is-link, .is-dashed) { + --button-variant-ink: var(--action-primary); + --button-variant-surface: #edf1fa; + --button-variant-border: #8596b8; + --button-variant-hover: #152550; +} +.el-button--success:is(.is-plain, .is-text, .is-link, .is-dashed) { + --button-variant-ink: #00665e; + --button-variant-surface: #e8f5f2; + --button-variant-border: #65a69d; + --button-variant-hover: #004d47; +} +.el-button--info:is(.is-plain, .is-text, .is-link, .is-dashed) { + --button-variant-ink: #46566f; + --button-variant-surface: #edf1f6; + --button-variant-border: #93a1b2; + --button-variant-hover: #344157; +} +.el-button--warning:is(.is-plain, .is-text, .is-link, .is-dashed) { + --button-variant-ink: #805000; + --button-variant-surface: #fff4e2; + --button-variant-border: #bd914c; + --button-variant-hover: #653f00; +} +.el-button--danger:is(.is-plain, .is-text, .is-link, .is-dashed) { + --button-variant-ink: #a32017; + --button-variant-surface: #fff0ed; + --button-variant-border: #d48c83; + --button-variant-hover: #801a13; +} +.el-button.el-button:is(.is-plain, .is-text, .is-link, .is-dashed) { + --el-button-text-color: var(--button-variant-ink); + --el-button-bg-color: var(--button-variant-surface); + --el-button-border-color: var(--button-variant-border); + --el-button-hover-text-color: var(--button-variant-hover); + --el-button-hover-link-text-color: var(--button-variant-hover); + --el-button-hover-bg-color: var(--button-variant-surface); + --el-button-hover-border-color: var(--button-variant-ink); + --el-button-active-text-color: var(--button-variant-hover); + --el-button-active-color: var(--button-variant-hover); + --el-button-active-bg-color: var(--button-variant-surface); + --el-button-active-border-color: var(--button-variant-hover); + box-shadow: none; +} +.el-button.el-button:is(.is-text, .is-link):not(.is-disabled):hover { + color: var(--button-variant-hover); + background-color: var(--button-variant-surface); +} +.el-button.el-button.el-button.is-disabled, +.el-button.el-button.el-button.is-disabled:hover { + color: var(--button-disabled-text); + background-color: var(--button-disabled-surface); + border-color: var(--button-disabled-border); +} +.el-button.el-button.el-button:is(.is-text, .is-link).is-disabled { + color: var(--button-disabled-text); +} +@media (prefers-reduced-motion: reduce) { + .el-button, button { transition: none; } + .el-button:not(.is-disabled):active { transform: none; } +} .el-input__wrapper, .el-textarea__inner, .el-select__wrapper, diff --git a/web/src/views/AcademicCalendarView.vue b/web/src/views/AcademicCalendarView.vue index 57547f3..1294ea9 100644 --- a/web/src/views/AcademicCalendarView.vue +++ b/web/src/views/AcademicCalendarView.vue @@ -335,11 +335,11 @@ watch(locale, load); :value="term.id" />
- {{ + {{ monthTitle }}{{ t('calendar.today') }} + >
{{ t('calendar.kinds.holiday') }}{{ t('calendar.teachingSchedule') }} { .course-main small, .course-main em { overflow: hidden; - color: #7b8495; + color: var(--text-subtle); font-size: 10px; font-style: normal; text-overflow: ellipsis; @@ -2146,7 +2146,7 @@ onMounted(async () => { font-size: 9px; } .schedule-state.ready { - color: #087f5b; + color: #006b50; background: #e5f7ef; } .choice-check { diff --git a/web/src/views/CampusRegistrationsView.vue b/web/src/views/CampusRegistrationsView.vue index 72cadb0..8e2143a 100644 --- a/web/src/views/CampusRegistrationsView.vue +++ b/web/src/views/CampusRegistrationsView.vue @@ -65,4 +65,6 @@ onMounted(async () => { loading.value = true; try { await Promise.all([loadProje diff --git a/web/src/views/DashboardView.vue b/web/src/views/DashboardView.vue index 0538c14..961290b 100644 --- a/web/src/views/DashboardView.vue +++ b/web/src/views/DashboardView.vue @@ -749,7 +749,7 @@ watch(locale, async () => { .operation-alert-list { margin-top: 16px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .operation-alert-list button { padding: 14px 15px; display: grid; gap: 5px; text-align: left; border: 1px solid #e8e1d3; border-left: 3px solid var(--dashboard-amber); background: #fffcf6; } .operation-alert-list button.critical { border-left-color: #ba5145; background: #fff9f8; } -.operation-alert-list b { color: #334254; font-size: 13px; }.operation-alert-list span { color: #6d7888; font-size: 11px; line-height: 1.5; }.operation-alert-list i { color: #8b6d3a; font-size: 11px; font-style: normal; } +.operation-alert-list b { color: #334254; font-size: 13px; }.operation-alert-list span { color: var(--text-subtle); font-size: 11px; line-height: 1.5; }.operation-alert-list i { color: #80591c; font-size: 11px; font-style: normal; } .operation-alerts > p { margin: 15px 0 0; color:var(--muted); font-size: 12px; } .overview-hero::after { @@ -986,7 +986,7 @@ watch(locale, async () => { .overview-metrics button:hover { background: var(--surface-muted); } .overview-metrics span { - color: #6d7689; + color: var(--text-subtle); font-size: 11px; } @@ -998,7 +998,7 @@ watch(locale, async () => { .overview-metrics small { margin-top: 8px; overflow: hidden; - color: #727c8e; + color: var(--text-subtle); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; diff --git a/web/src/views/OfficialDocumentsView.vue b/web/src/views/OfficialDocumentsView.vue index 7d1d93b..72975ba 100644 --- a/web/src/views/OfficialDocumentsView.vue +++ b/web/src/views/OfficialDocumentsView.vue @@ -418,7 +418,7 @@ onMounted(async () => {