/*
 * @Author: jixiang
 * @Date: 2021-07-08 15:36:23
 * @Description:
 * @FilePath: /vite-project/src/@type/layout.ts
 * One World One Drefeel(56580223@qq.com)
 */
export enum IMenubarStatus {
  PCE, // 电脑展开
  PCN, // 电脑合并
  PHE, // 手机展开
  PHN, // 手机合并
}
export interface ISetting {
  theme: number;
  showTags: boolean;
  color: {
    primary: string;
  };
  usePinyinSearch: boolean;
}
export interface IMenubar {
  status: IMenubarStatus;
  menuList: Array<IMenubarList>;
  isPhone: boolean;
}
export interface IUserInfo {
  name: string;
  role: string[];
}
export interface ITags {
  tagsList: Array<ITagsList>;
  cachedViews: string[];
}
export interface IStatus {
  isLoading: boolean;
  ACCESS_TOKEN: string;
}
export interface ILayout {
  // 用户信息
  userInfo: IUserInfo;

  status: IStatus;
}
export interface IMenubarList {
  parentId?: number | string;
  id?: number | string;
  name: string;
  path: string;
  redirect?: string | { name: string };
  meta: {
    icon: string;
    title: string;
    permission?: string[];
    activeMenu?: string; // 路由设置了该属性，则会高亮相对应的侧边栏
    noCache?: boolean; // 页面是否不缓存
    hidden?: boolean; // 是否隐藏路由
    alwaysShow?: boolean; // 当子路由只有一个的时候是否显示当前路由
  };
  component: (() => Promise<typeof import('*.vue')>) | string;
  children?: Array<IMenubarList>;
}

export interface ITagsList {
  name: string;
  title: string;
  path: string;
  isActive: boolean;
}
