总 Store 数量: 40 个 MobX store
已迁移: 2 个 ✅
src/pages/appCenter/appPlazaList/store.ts ✅src/pages/appCenter/categoryApps/store.ts ✅待迁移: 38 个 ❌
src/pages/login/store.ts - 登录功能src/pages/layout/store.ts - 布局状态src/store/route.tsx - 路由状态src/store/index.ts - 全局状态src/pages/home/store.ts - 首页统计src/pages/questionAnswer/info/store.ts - 创建应用src/pages/knowledgeLib/list/store.ts - 知识库列表src/pages/knowledgeLib/detail/store.ts - 知识库详情src/pages/system/audit/store.ts - 应用审核src/pages/system/apiKey/store.ts - API 管理src/pages/system/usageStatistics/store.ts - 用量统计src/pages/system/contentManagement/store.ts - 内容管理13-40. 其他 DeepSeek 相关 store...
src/pages/login/store.tssrc/pages/layout/store.tssrc/store/route.tsxsrc/pages/home/store.ts| 优先级 | 数量 | 已完成 | 进度 |
|---|---|---|---|
| P0 | 4 | 0 | 0% |
| P1 | 4 | 0 | 0% |
| P2 | 4 | 0 | 0% |
| P3 | 26 | 0 | 0% |
| 总计 | 38 | 0 | 0% |
import { makeAutoObservable } from 'mobx';
const stateGenerator = () => ({
loading: false,
data: null,
});
const stateActionsGenerator = (state: any) => ({
setLoading: (loading) => {
state.loading = loading;
},
});
const useStore = () => {
const state = makeAutoObservable(stateGenerator());
const actions = stateActionsGenerator(state);
return { state, ...actions };
};
import { create } from 'zustand';
interface State {
loading: boolean;
data: any;
}
interface Actions {
setLoading: (loading: boolean) => void;
}
export const useStore = create<State & Actions>((set) => ({
loading: false,
data: null,
setLoading: (loading) => set({ loading }),
}));
下一步: 开始迁移 P0 核心功能 Store