import { MenuTypeEnum } from '@/enums/MenuTypeEnum'

/**
 * 查询参数
 */
export interface MenuQuery {
  menuName?: string
  status?: string
}

/**
 * 接收后端返回信息
 */
export interface MenuVO extends BaseEntity {
  menuId?: string
  name: string
  title?: string
  parentId?: string
  path?: string
  icon?: string
  component?: string
  queryParam?: string
  redirect?: string
  menuType?: MenuTypeEnum
  visible?: string
  displayLayout?: string
  isLink?: string
  affix?: string
  keepLive?: string
  orderNum: number
  remark?: string
}

/**
 * 传入后端的表单信息
 */
export interface MenuBO {
  menuId?: string
  name: string
  title?: string
  parentId?: string
  path?: string
  icon?: string
  component?: string
  queryParam?: string
  redirect?: string
  menuType?: string
  visible?: string
  displayLayout?: string
  isLink?: string
  affix?: string
  keepLive?: string
  orderNum: number
  status?: string
  remark?: string
}

/**
 * 接收后端返回树信息
 */
export type MenuTreeVO = {
  id?: string
  menuId?: string
  parentId: string
  path?: string
  name?: string
  title?: string
  orderNum?: number
  menuType?: string
  component?: string | (() => Promise<unknown>)
  redirect?: string
  meta?: MetaProps
  children?: MenuTreeVO[]
}

interface MetaProps {
  icon: string
  title: string
  isLink?: boolean
  isHidden: boolean
  isFull: boolean
  isAffix: boolean
  isKeepAlive: boolean
  useDataScope: string
}
