FuncMain.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import Func from '@/Engine/ECS/Function';
  2. import LoginHandle from './Handlers/LoginHandler';
  3. import { PAGE_KEY } from '../constants';
  4. import SysPage from '@/Frameworks/SysPage';
  5. import PlatformMenuHandle from './Handlers/PlatformMenuHandle';
  6. export enum FuncMainState {
  7. Login, // 登录页
  8. PlatformMenu, // 首页
  9. ProjectSelection, // 项目选择页
  10. PageMenu, // 菜单页
  11. Map,
  12. }
  13. export default class FuncMain extends Func<FuncMainState> {
  14. constructor(name: string) {
  15. super(name);
  16. super.initStates((sm) => {
  17. sm.addState(
  18. FuncMainState.ProjectSelection,
  19. () => window.GT_APP.funcProjectSelection.setActive(true),
  20. () => null,
  21. () => window.GT_APP.funcProjectSelection.setActive(false),
  22. );
  23. sm.addState(FuncMainState.Login, new LoginHandle());
  24. sm.addState(FuncMainState.PlatformMenu, new PlatformMenuHandle());
  25. sm.addState(
  26. FuncMainState.Map,
  27. () => window.GT_APP.funcMap.setActive(true),
  28. () => null,
  29. () => window.GT_APP.funcMap.setActive(false),
  30. );
  31. });
  32. }
  33. }