feat: 更新内容管理方案
This commit is contained in:
@@ -6,6 +6,8 @@ import {
|
||||
type FocusTypeConfig,
|
||||
type FocusTypeAction,
|
||||
} from './registry';
|
||||
import { getPublishMetaByFocusState } from './focusDraw.config';
|
||||
import type { DebugPublishMeta } from '../../utils/debugPublish';
|
||||
|
||||
const TYPE_LIST = FOCUS_TYPE_CONFIGS.map((t) => ({
|
||||
id: t.id,
|
||||
@@ -36,6 +38,10 @@ createFocusPage({
|
||||
currentActions: [] as FocusTypeAction[],
|
||||
currentMode: '',
|
||||
isPreviewFavorite: false,
|
||||
isDevEnv: false,
|
||||
debugPublishVisible: false,
|
||||
debugPublishLoading: false,
|
||||
debugPublishMeta: null as DebugPublishMeta | null,
|
||||
},
|
||||
|
||||
onLoad(options: { id?: string; mode?: string }) {
|
||||
@@ -43,6 +49,8 @@ createFocusPage({
|
||||
const result = findTypeByRouteId(routeId);
|
||||
if (!result) return;
|
||||
|
||||
this.syncDebugPublishEnv();
|
||||
|
||||
const { typeConfig, mode } = result;
|
||||
const initialMode =
|
||||
options.mode || mode || typeConfig.defaultMode || '';
|
||||
@@ -196,4 +204,16 @@ createFocusPage({
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
|
||||
getPublishMeta(): DebugPublishMeta {
|
||||
const meta = getPublishMetaByFocusState(
|
||||
this.data.functionId,
|
||||
this.data.selectedTypeId,
|
||||
this.data.currentMode,
|
||||
);
|
||||
if (!meta) {
|
||||
throw new Error('当前题型配置不存在');
|
||||
}
|
||||
return meta;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user