diff --git a/app/server/db.mjs b/app/server/db.mjs index 130d990..4e781e3 100644 --- a/app/server/db.mjs +++ b/app/server/db.mjs @@ -416,6 +416,22 @@ export const DEMO_ROWS = [ '参与企业授权渗透测试项目 3 个,编写测试报告', '获实习优秀评价', ['实习', '安全'], ['职业发展'], { position: '渗透测试实习生', mentor: '陈工' }, {}] ]; +// 演示简历配置(仅 demo 账号有展示内容;新用户简历为空白) +const DEMO_RESUME = { + version: 2, template: 'tech', accent: '#3056d3', fontScale: 1, density: 'normal', onePage: false, + sections: [ + { key: 'info', title: '基本信息', enabled: true, kind: 'info' }, + { key: 'education', title: '教育经历', enabled: true, kind: 'edu' }, + { key: 'skills', title: '核心技能', enabled: true, kind: 'text', text: '程序设计:熟悉 Python 与 C/C++,掌握常用数据结构与算法,能独立完成中小型工具与脚本开发。\n网络安全:熟悉常见 Web 漏洞原理(SQL 注入、XSS、CSRF 等)与防护方案,掌握 Burp Suite、Nmap、Wireshark 等常用工具。\n网络基础:熟悉 TCP/IP 协议栈与交换路由基础配置,理解 VLAN、NAT、ACL 等核心技术。\n运维基础:熟悉 Linux 常用操作与 Shell 脚本,了解 Docker 容器化部署与 Nginx 服务配置。' }, + { key: 'projects', title: '项目经历', enabled: true, kind: 'list', types: ['竞赛', '科研', '实习实践'] }, + { key: 'certs', title: '证书与荣誉', enabled: true, kind: 'list', types: ['荣誉惩处', '证书技能'] }, + { key: 'campus', title: '在校经历', enabled: true, kind: 'list', types: ['学生工作', '志愿公益'] }, + { key: 'activity', title: '文体活动', enabled: false, kind: 'list', types: ['文体活动'] }, + { key: 'other', title: '其他经历', enabled: false, kind: 'list' }, + { key: 'self', title: '自我评价', enabled: true, kind: 'text', text: '性格沉稳踏实,做事有计划性,习惯提前预判风险并准备预案;学习能力强,能快速上手新技术与工具;责任心强,注重细节与条理,凡事有始有终,能独立推进任务并在压力下保持稳定输出。' } + ] +}; + // 演示个人档案(虚构人设:云川理工学院 · 信息安全 · 林晓阳) export const DEMO_PROFILE = { info: { @@ -426,12 +442,14 @@ export const DEMO_PROFILE = { majorCourses: '计算机网络、数据库技术、操作系统、信息安全导论、密码学基础、网络安全、云计算与虚拟化技术', phone: '138****8000', email: 'linxy.demo@example.com', homepage: 'https://blog.example.com/linxy', photoUrl: '', selfIntro: '性格沉稳踏实,做事有计划性,习惯提前预判风险并准备预案;对网络安全方向有持续热情,动手能力强,能独立完成从方案设计到落地验证的完整流程;责任心强,注重细节与条理,是可靠的技术执行者。' - } + }, + resume: DEMO_RESUME }; // 演示附件用真实 PNG(1x1,可在预览查看并进入综测证明材料) const DEMO_PNG = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=='; + // 学期: { term, gpa, rank, total, courses: [课程名, 学分, 分数, 绩点, 类别][] } export const DEMO_SEMESTERS = [ { term: '2023-2024-1', gpa: 3.42, rank: 38, total: 156, courses: [ diff --git a/app/src/lib/resume.ts b/app/src/lib/resume.ts index 4e1346e..b77660f 100644 --- a/app/src/lib/resume.ts +++ b/app/src/lib/resume.ts @@ -23,15 +23,6 @@ export const RESUME_SECTION_DEFS: ResumeSectionDef[] = [ { key: 'self', defaultTitle: '自我评价', kind: 'text', fixed: true }, ]; -// 首次使用种子内容(虚构示例,可自由修改) -const SEED: Record = { - skills: { text: '程序设计:熟悉 Python 与 C/C++,掌握常用数据结构与算法,能独立完成中小型工具与脚本开发。\n网络安全:熟悉常见 Web 漏洞原理(SQL 注入、XSS、CSRF 等)与防护方案,掌握 Burp Suite、Nmap、Wireshark 等常用工具。\n网络基础:熟悉 TCP/IP 协议栈与交换路由基础配置,理解 VLAN、NAT、ACL 等核心技术。\n运维基础:熟悉 Linux 常用操作与 Shell 脚本,了解 Docker 容器化部署与 Nginx 服务配置。' }, - campus: { items: [ - { title: '校图书馆学生助理', subtitle: '读者服务岗', date: '2024.9 - 2025.6', desc: '负责书库整理与借阅服务,协助开展入馆培训与阅读推广活动,累计服务读者千余人次。培养了责任意识与服务意识,锻炼了多任务时间管理能力。' }, - { title: '院学生会宣传部干事', subtitle: '平面设计与文案', date: '2023.9 - 2024.6', desc: '参与学院活动的海报设计与推文撰写,负责活动现场的后勤与设备保障。锻炼了审美表达、协作沟通与临场应变能力。' }, - ]}, - self: { text: '性格沉稳踏实,做事有计划性,习惯提前预判风险并准备预案;学习能力强,能快速上手新技术与工具;责任心强,注重细节与条理,凡事有始有终,能独立推进任务并在压力下保持稳定输出。' }, -}; export type ResumeTemplate = 'classic' | 'tech' | 'minimal'; @@ -43,9 +34,6 @@ export function defaultResumeConfig(): ResumeConfig { fontScale: 1, density: 'normal', onePage: false, sections: RESUME_SECTION_DEFS.map(d => ({ key: d.key, title: d.defaultTitle, enabled: true, kind: d.kind, types: d.types, - ...(d.key === 'skills' ? { text: SEED.skills.text } : {}), - ...(d.key === 'campus' ? { items: SEED.campus.items } : {}), - ...(d.key === 'self' ? { text: SEED.self.text } : {}), })), }; } @@ -68,9 +56,6 @@ export function migrateResumeConfig(raw: unknown): ResumeConfig { kind: dd ? d.kind : (old?.kind ?? d.kind), types: dd?.types ?? old?.types, }; - if (d.key === 'skills' && base.text == null) base.text = SEED.skills.text; - if (d.key === 'campus' && !(base.items?.length)) base.items = SEED.campus.items; - if (d.key === 'self' && base.text == null) base.text = SEED.self.text; return base; }); // 旧版本已被取代的板块 key:直接丢弃,避免残留造成内容重复 diff --git a/app/src/pages/assessment/AssessmentPage.tsx b/app/src/pages/assessment/AssessmentPage.tsx index 17cae44..e55d581 100644 --- a/app/src/pages/assessment/AssessmentPage.tsx +++ b/app/src/pages/assessment/AssessmentPage.tsx @@ -4,7 +4,7 @@ import { Download, Printer, RotateCcw } from 'lucide-react'; import { attachmentList, attachmentThumb, footprintList, gradesOverview, profileGet, profileUpsert } from '@/lib/api'; import type { FootprintRow, ProfileInfo, ZcOverrides } from '@/lib/types'; import { computeZongce, gradeLabel, ZC_DEFAULT_RULES, type ZcRules, type ZcResult } from '@/lib/zongce'; -import { Button, Select, useToast } from '@/components/ui'; +import { Button, Dialog, Select, useToast } from '@/components/ui'; interface Evidence { recordId: number; title: string; images: string[] } @@ -72,6 +72,7 @@ export function AssessmentPage() { const [year, setYear] = useState(''); const [ovMap, setOvMap] = useState>({}); const [evidence, setEvidence] = useState([]); + const [initOpen, setInitOpen] = useState(false); useEffect(() => { if (!stored) return; @@ -124,13 +125,6 @@ export function AssessmentPage() { setOvMap(m => ({ ...m, [year]: next })); void profileUpsert({ info: profile, zongce: { rules, overrides: { ...ovMap, [year]: next } } }).catch(e => toast('error', e.message)); }; - const resetOverrides = () => { - const next = { ...ovMap }; - delete next[year]; - setOvMap(next); - void profileUpsert({ info: profile, zongce: { rules, overrides: next } }).then(() => toast('success', '已恢复自动计算')).catch(e => toast('error', e.message)); - }; - const termLabel = year === 'all' ? '全部学年' : gradeLabel(year, profile.eduStart); const exportWord = () => { @@ -149,8 +143,8 @@ export function AssessmentPage() {