feat:更新core 和首页代码

This commit is contained in:
R524809
2026-03-27 17:31:52 +08:00
parent dc5e057cb3
commit 1b45ba7d11
44 changed files with 2891 additions and 1087 deletions
+7 -6
View File
@@ -1,4 +1,7 @@
import type { WorksheetType } from '../../core/models/worksheet';
import type {
WorksheetDefinition,
WorksheetType,
} from '../../core/models/worksheet';
import {
getWorksheetPath,
getWorksheetsByAge,
@@ -63,7 +66,7 @@ function toDisplayList(list: WorksheetType[]): DisplayItem[] {
Page({
data: {
title: '分类',
sourceItems: [] as WorksheetType[],
sourceItems: [] as WorksheetDefinition[],
items: [] as DisplayItem[],
ageFilters: [
{ key: 'all', label: '全部' },
@@ -95,13 +98,11 @@ Page({
const minAge = options.minAge != null ? Number(options.minAge) : NaN;
const maxAge = options.maxAge != null ? Number(options.maxAge) : NaN;
if (!Number.isNaN(minAge) && !Number.isNaN(maxAge)) {
const map = new Map<string, WorksheetType>();
const map = new Map<string, WorksheetDefinition>();
const lo = Math.min(minAge, maxAge);
const hi = Math.max(minAge, maxAge);
for (let age = lo; age <= hi; age += 1) {
getWorksheetsByAge(base, age).forEach((w) =>
map.set(w.id, w),
);
getWorksheetsByAge(base, age).forEach((w) => map.set(w.id, w));
}
base = Array.from(map.values());
}