Files
ny-exam-platform/docs/.vitepress/config.mjs
T
nxxy335 25a2e8a42c 文档部署到 /ny-exam-platform 子路径 + 移除快照/趋势/异常 + 打印与 UI 全面完善
文档站(#88)
- base 默认改为 /ny-exam-platform/,可用 DOCS_BASE=/ 覆盖本地预览
- 新增 DOCS_OUT 环境变量,避免构建时清空输出目录失败导致产物半截
- 新增 tools/docs-preview.js:按子路径重写路由的本地预览服务
- 删除 docs/guide/snapshot.md,同步清理全部相关文档

移除存快照 / 趋势 / 异常(#89)
- 后端:删除 api.php 的 snapshot_save/list/delete/trend 四个 action 与
  $WRITE_ACTIONS 中的同名条目;删除 lib/Snapshot.php 与自动加载注册;
  DataService 移除 detectAnomalies() 及其调用
- 前端:移除三个按钮与三个弹窗、相关 JS 处理与 state 字段
- 测试:移除对应用例,补充 5 条名单导入列识别断言(17+9+18+32+29+11 全过)

打印完善(#90)
- 改用隐藏 iframe 输出,规避弹窗拦截;@page A4 支持纵向/横向
- 表头每页重复、行内不跨页断开、全表连续名次、可选「是否合格」列
- 分组小计(人数/平均/最高/最低/合格人数与合格率)、可附缺考名单另起一页
- 末尾签字栏;缺考名单打印改为同一套输出

UI / 交互 / Bug 修复(#91)
- dashboard.php:补「← 主系统 / 退出」入口(此前全屏后无法离开);
  修复成员下钻 onclick 里 JSON.stringify 双引号提前闭合属性导致点击报错,
  改为 data-sid 事件委托;补 Esc 关弹窗;后台标签页暂停轮询、切回自动补拉;
  刷新中断原因写入 title;数值字段统一兜底,避免 NaN / undefined%
- draw.php / draw.js:结果表新增「登陆账号」列(导出前可核对,缺失显示 学号 ⚠);
  弹窗只关最上层且支持 Esc;「全部」改为跟随候选池,手工改人数即解除;
  候选池不足时给出明确提示;自定义比例框隐藏时清空,避免旧权重被误读
- app.js / dashboard.php:成绩着色改为按「占本卷满分的百分比」判断,
  修复满分不是 100 时整列误标红
- style.css:数值列右对齐;新增 subbar、draw-stage-sub;
  看板顶栏窄屏下拉与按钮换行,消除横向滚动
2026-09-11 16:23:08 +08:00

133 lines
4.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from 'vitepress'
// 站点部署在域名的 /ny-exam-platform 子路径下,故 base 默认为该路径。
// 本地预览时用 DOCS_BASE=/ 覆盖:DOCS_BASE=/ npm run docs:build
const base = process.env.DOCS_BASE || '/ny-exam-platform/'
// 输出目录。默认 .vitepress/dist;若需要保留旧产物(或环境禁止删除目录),
// 可用 DOCS_OUT=.vitepress/dist2 npm run docs:build 输出到新目录。
const outDir = process.env.DOCS_OUT || '.vitepress/dist'
export default defineConfig({
base,
outDir,
lang: 'zh-CN',
title: 'NY 问卷考试系统数据平台',
description: '基于 PHP 8 + 卷王(SurveyKing)社区版开放 API 的零依赖考试数据统计平台',
cleanUrls: true,
ignoreDeadLinks: true,
head: [
['meta', { name: 'theme-color', content: '#2563eb' }],
['meta', { name: 'referrer', content: 'no-referrer' }]
],
themeConfig: {
// outlineTitle: '本页目录',
outline: [2, 3],
lastUpdated: { text: '最后更新于' },
search: {
provider: 'local',
options: {
locales: {
zh: {
translations: {
button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' },
modal: {
noResultsText: '未找到相关结果',
resetButtonTitle: '清除查询条件',
footer: {
selectText: '选择',
navigateText: '切换',
closeText: '关闭'
}
}
}
}
}
}
},
nav: [
{ text: '首页', link: '/' },
{ text: '使用指南', link: '/guide/introduction', activeMatch: '/guide/' },
{ text: '安全', link: '/security/', activeMatch: '/security/' },
{ text: '开发', link: '/dev/architecture', activeMatch: '/dev/' }
],
sidebar: {
'/guide/': [
{
text: '开始',
items: [
{ text: '平台简介', link: '/guide/introduction' },
{ text: '环境要求与部署', link: '/guide/install' },
{ text: '快速上手', link: '/guide/quickstart' }
]
},
{
text: '核心功能',
items: [
{ text: '系统设置', link: '/guide/settings' },
{ text: '名单管理', link: '/guide/roster' },
{ text: '成绩明细与统计口径', link: '/guide/scores' },
{ text: '试卷设置(满分/合格率/免考)', link: '/guide/project-config' },
{ text: '导出与打印', link: '/guide/export-print' }
]
},
{
text: '其他页面',
items: [
{ text: '数据看板', link: '/guide/dashboard' },
{ text: '随机抽取', link: '/guide/draw' }
]
},
{
text: '帮助',
items: [
{ text: '常见问题', link: '/guide/faq' }
]
}
],
'/security/': [
{
text: '安全',
items: [
{ text: '安全总览', link: '/security/' },
{ text: '部署加固清单', link: '/security/hardening' }
]
}
],
'/dev/': [
{
text: '开发',
items: [
{ text: '架构与目录', link: '/dev/architecture' },
{ text: '接口一览', link: '/dev/api' },
{ text: '数据存储(SQLite)', link: '/dev/database' },
{ text: '测试', link: '/dev/testing' }
]
}
]
},
socialLinks: [],
footer: {
message: '基于 PHP 8 + 卷王(SurveyKing)社区版开放 API 构建,零第三方运行依赖。',
copyright: 'Copyright © NY 问卷考试系统数据平台'
},
docFooter: {
prev: '上一页',
next: '下一页'
},
returnToTopLabel: '回到顶部',
sidebarMenuLabel: '菜单',
darkModeSwitchLabel: '主题',
lightModeSwitchTitle: '切换到浅色模式',
darkModeSwitchTitle: '切换到深色模式'
}
})