import { type } from 'os';
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';

export type AccountParams = BasicPageParams & {
  account?: string;
  nickname?: string;
};
export type DelAccountParams = {
  userId: string;
};

export type RoleParams = {
  roleName?: string;
  status?: string;
};

export type SaveRoleParams = {
  deptId: string;
  deptIdList: (number | string)[];
  deptName: string;
  menuIdList: number[];
  roleName: string;
};

export type RolePageParams = BasicPageParams & RoleParams;

export type CheckUserParams = {
  phone?: string;
};

export type deleteRoleParams = {
  id?: number;
};

export type DeptParams = {
  deptName?: string;
  status?: string;
};
export type RoleIdParams = {
  roleId?: number;
}
export type MenuParams = {
  icon: string;
  name: string;
  orderNum: number;
  parentId: number;
  parentName: string;
  perms: string;
  status: number;
  type: number;
  url: string;
};

export interface AccountListItem {
  id: string;
  account: string;
  email: string;
  nickname: string;
  role: number;
  createTime: string;
  remark: string;
  status: number;
}

export interface DeptListItem {
  id: string;
  orderNo: string;
  createTime: string;
  remark: string;
  status: number;
}

export interface MenuListItem {
  menuId: string;
  children?: MenuListItem[];
  icon: string;
  name: string;
  orderNum: number;
  parentId: number;
  parentName: string;
  perms: string;
  status: number;
  type: number;
  url: string;
}

export interface RoleListItem {
  id: string;
  roleName: string;
  roleType: string;
  recStatus: string;
  createUserId: number;
  roleValue: string;
  status: number;
  orderNo: string;
  createTime: string;
  description: string;
  updateTime: string;
}

/**
 * @description: Request list return value
 */
export type AccountListGetResultModel = BasicFetchResult<AccountListItem>;

export type DeptListGetResultModel = BasicFetchResult<DeptListItem>;

export type MenuListGetResultModel = BasicPageParams<MenuListItem>;

export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;

export type RoleListGetResultModel = RoleListItem[];
