feat: 更新内容管理方案
This commit is contained in:
@@ -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;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user