feat: 新增软考高项时间轴数据骨架
This commit is contained in:
@@ -9,6 +9,7 @@ import processesData from './processes.json';
|
||||
import artifactsData from './artifacts.json';
|
||||
import toolsData from './tools.json';
|
||||
import changelogData from './changelog.json';
|
||||
import timelineItemsData from './timeline-items.json';
|
||||
|
||||
import type {
|
||||
KnowledgeArea,
|
||||
@@ -21,6 +22,7 @@ import type {
|
||||
ProcessRef,
|
||||
ProcessEntityUse,
|
||||
} from '../types/itto';
|
||||
import type { TimelineItem } from '../types/timeline';
|
||||
|
||||
// 导出原始数据
|
||||
export const knowledgeAreas: KnowledgeArea[] = knowledgeAreasData.knowledgeAreas as KnowledgeArea[];
|
||||
@@ -32,6 +34,10 @@ export const changelogEntries: ChangelogEntry[] = [
|
||||
...(changelogData.changelogEntries as ChangelogEntry[]),
|
||||
].sort((a, b) => b.date.localeCompare(a.date));
|
||||
|
||||
export const timelineItems: TimelineItem[] = [
|
||||
...(timelineItemsData.timelineItems as TimelineItem[]),
|
||||
].sort((a, b) => a.sortKey.localeCompare(b.sortKey));
|
||||
|
||||
// 创建查找映射表
|
||||
export const knowledgeAreaMap = new Map<string, KnowledgeArea>(
|
||||
knowledgeAreas.map(ka => [ka.id, ka])
|
||||
@@ -53,6 +59,18 @@ export const toolMap = new Map<string, ToolTechnique>(
|
||||
tools.map(t => [t.id, t])
|
||||
);
|
||||
|
||||
export const timelineItemMap = new Map<string, TimelineItem>(
|
||||
timelineItems.map(item => [item.id, item])
|
||||
);
|
||||
|
||||
export const timelineItemsByTheme = new Map<string, TimelineItem[]>();
|
||||
[...new Set(timelineItems.map(item => item.theme))].forEach(theme => {
|
||||
timelineItemsByTheme.set(
|
||||
theme,
|
||||
timelineItems.filter(item => item.theme === theme)
|
||||
);
|
||||
});
|
||||
|
||||
// 按知识领域分组的过程
|
||||
export const processesByKnowledgeArea = new Map<string, Process[]>();
|
||||
knowledgeAreas.forEach(ka => {
|
||||
|
||||
34
src/data/timeline-items.json
Normal file
34
src/data/timeline-items.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"timelineItems": [
|
||||
{
|
||||
"id": "TL001",
|
||||
"timeText": "2020年",
|
||||
"sortKey": "20200000",
|
||||
"timePrecision": "year",
|
||||
"theme": "农业现代化与乡村振兴战略",
|
||||
"excerpt": "党的十九届五中全会着眼2035年基本实现社会主义现代化,提出“关键核心技术实现重大突破,进入创新型国家前列”的远景目标。",
|
||||
"sourceAnchor": "党的十九届五中全会",
|
||||
"sourceAnchorType": "meeting"
|
||||
},
|
||||
{
|
||||
"id": "TL002",
|
||||
"timeText": "2021年",
|
||||
"sortKey": "20210000",
|
||||
"timePrecision": "year",
|
||||
"theme": "产业数字化转型",
|
||||
"excerpt": "《中华人民共和国国民经济和社会发展第十四个五年规划和2035年远景目标纲要》明确提出了推进产业数字化转型,实施“上云用数赋智”行动,推动数据赋能全产业链协同转型。",
|
||||
"sourceAnchor": "《中华人民共和国国民经济和社会发展第十四个五年规划和2035年远景目标纲要》",
|
||||
"sourceAnchorType": "document"
|
||||
},
|
||||
{
|
||||
"id": "TL003",
|
||||
"timeText": "2021年12月",
|
||||
"sortKey": "20211200",
|
||||
"timePrecision": "month",
|
||||
"theme": "数字政府",
|
||||
"excerpt": "《“十四五”国家信息化规划》中提出打造协同高效的数字政府服务体系,深入坚持整体集约建设数字政府。",
|
||||
"sourceAnchor": "《“十四五”国家信息化规划》",
|
||||
"sourceAnchorType": "document"
|
||||
}
|
||||
]
|
||||
}
|
||||
30
src/types/timeline.ts
Normal file
30
src/types/timeline.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 时间轴数据类型定义
|
||||
* 用于软考高项时间类知识点的结构化存储与展示
|
||||
*/
|
||||
|
||||
// 时间精度
|
||||
export type TimelineTimePrecision = 'year' | 'month' | 'day';
|
||||
|
||||
// 来源锚点类型
|
||||
export type SourceAnchorType =
|
||||
| 'meeting' // 会议
|
||||
| 'document' // 文件
|
||||
| 'organization' // 组织
|
||||
| 'person' // 人物
|
||||
| 'policy' // 政策
|
||||
| 'report' // 报告
|
||||
| 'other'; // 其他
|
||||
|
||||
// 时间轴节点
|
||||
export interface TimelineItem {
|
||||
id: string; // 唯一标识,如 TL001
|
||||
timeText: string; // 原文中的显式时间,如“2035年”
|
||||
sortKey: string; // 排序键,如“20350000”
|
||||
timePrecision: TimelineTimePrecision; // 时间精度:年/月/日
|
||||
theme: string; // 所属主题/章节
|
||||
excerpt: string; // 原文摘录
|
||||
sourceAnchor?: string; // 来源锚点,如“党的十九届五中全会”
|
||||
sourceAnchorType?: SourceAnchorType; // 来源锚点类型
|
||||
sourcePosition?: string; // 教材定位信息,如“第3章 第2节”
|
||||
}
|
||||
Reference in New Issue
Block a user