feat: 更新内容管理方案

This commit is contained in:
R524809
2026-04-29 17:47:14 +08:00
parent 63fa08ff1a
commit 2cb9ec55d6
44 changed files with 1181 additions and 625 deletions
@@ -6,6 +6,8 @@ import {
type MathTypeConfig,
type MathTypeAction,
} from './registry';
import { getPublishMetaByMathState } from './mathDraw.config';
import type { DebugPublishMeta } from '../../utils/debugPublish';
const TYPE_LIST = MATH_TYPE_CONFIGS.map((t) => ({
id: t.id,
@@ -40,6 +42,10 @@ createMathPage({
numberList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
selectedNumber: 0,
isPreviewFavorite: false,
isDevEnv: false,
debugPublishVisible: false,
debugPublishLoading: false,
debugPublishMeta: null as DebugPublishMeta | null,
},
onLoad(options: { id?: string; mode?: string }) {
@@ -47,6 +53,8 @@ createMathPage({
const result = findTypeByRouteId(routeId);
if (!result) return;
this.syncDebugPublishEnv();
const { typeConfig, mode, extra } = result;
const initialMode =
options.mode || mode || typeConfig.defaultMode || '';
@@ -260,4 +268,16 @@ createMathPage({
icon: 'none',
});
},
getPublishMeta(): DebugPublishMeta {
const meta = getPublishMetaByMathState(
this.data.functionId,
this.data.selectedTypeId,
this.data.currentMode,
);
if (!meta) {
throw new Error('当前题型配置不存在');
}
return meta;
},
});