export type TypeI6table = {
  count: number
  createTime: string
  creatorName: string
  id: number
  isEnabled: number
  roleDesc: string
  roleKey: string
  roleName: string
  sort: string
  updateTime: string
}

// 功能权限列表
export type TypeI6Role = {
  authority: boolean
  children: TypeI6Role[]
  id: number
  name: string
  resourceType: string
}
export const I6processChildren = (data: TypeI6Role[], targetId: number, targetName: string) =>
  data.flatMap(
    v1 =>
      v1.children
        ?.filter(v2 => v2.id === targetId && v2.name === targetName)
        .flatMap(v2 => v2.children || []) || []
  )
