import { Routes } from "@/router";

import { appConstant as criminalConstant } from "./criminal/constant";
import {
  routes as cRoutes,
  menuRouteNames as cMenuRouteNames,
} from "./criminal/routeConfig";

import { appConstant as fireConstant } from "./fire/constant";
import {
  routes as fireRoutes,
  menuRouteNames as firelMenuRouteNames,
} from "./fire/routeConfig";

import { appConstant as xmfireConstant } from "./xmfire/constant";
import {
  routes as xmfireRoutes,
  menuRouteNames as xmfirelMenuRouteNames,
} from "./xmfire/routeConfig";

export type AppConstant = {
  title: string;
  ico: string;
  desc: string;
  banner: string;
  deptId: number;
  name: string;
  loginComponent?: any;
};

export let appConstant: AppConstant;
export let appRoutes: Routes;
export let menuRouteNames: string[];
// 为了打包去除不需要的app只能固定写法
if (VITE_APP_APP === "fire") {
  appRoutes = fireRoutes;
  menuRouteNames = firelMenuRouteNames;
  appConstant = fireConstant;
} else if (VITE_APP_APP === "criminal") {
  appRoutes = cRoutes;
  menuRouteNames = cMenuRouteNames;
  appConstant = criminalConstant;
} else if (VITE_APP_APP === "xmfire") {
  appRoutes = xmfireRoutes;
  menuRouteNames = xmfirelMenuRouteNames;
  appConstant = xmfireConstant;
}
