/*
 * @Author: wjc
 * @Date: 2024-06-05 17:14:01
 * @LastEditors: wjc
 * @LastEditTime: 2024-06-25 15:08:20
 * @Description:
 */
export interface UserState {
  isPrivacyShowed: boolean
  isInstall: boolean
  token: string
  userInfo: Employees
  storageLoginInfo: ILogin
  storageUserId: string
}

export interface ILogin {
  account: string
  password: string
  entCode: string
}

export interface LoginData {
  id: string
  account: string
  entCode: string
  entName: string
  name: string
  imgUrl: string
  positionName: string
}

export class LoginRes implements LoginData {
  id: string
  account: string
  entCode: string
  entName: string
  name: string
  imgUrl: string
  positionName: string

  constructor(json: LoginData) {
    this.id = json.id
    this.account = json.account
    this.entCode = json.entCode
    this.entName = json.entName
    this.imgUrl = json.imgUrl
    this.positionName = json.positionName
  }
}

export interface Roles {
  roleId: string
  roleName: string
}

export interface IEmployees {
  id?: string
  companyId?: string
  companyName?: string
  organId?: string
  organName?: string
  positionId?: string
  positionName?: string
  name?: string
  sex?: string
  birthday?: string
  phone?: string
  account?: string
  password?: string
  identityCard?: string
  employeeNumber?: string
  imgUrl?: string
  onJob?: string
  onJobDesc?: string
  hireDate?: string
  leaveDate?: any
  loginPermit?: number
  remark?: any
  loginCount?: any
  loginTime?: any
  wechatBind?: any
  roles?: Roles[]
  open?: any
  cardQrCode?: any
}

export class Employees implements IEmployees {
  id?: string
  companyId?: string
  companyName?: string
  organId?: string
  organName?: string
  positionId?: string
  positionName?: string
  name?: string
  sex?: string
  birthday?: string
  phone?: string
  account?: string
  password?: string
  identityCard?: string
  employeeNumber?: string
  imgUrl?: string
  onJob?: string
  onJobDesc?: string
  hireDate?: string
  leaveDate?: any
  loginPermit?: number
  remark?: any
  loginCount?: any
  loginTime?: any
  wechatBind?: any
  roles?: Roles[]
  open?: any
  cardQrCode?: any

  constructor(data: Partial<IEmployees> = {}) {
    this.id = data.id
    this.companyId = data.companyId
    this.companyName = data.companyName
    this.organId = data.organId
    this.organName = data.organName
    this.positionId = data.positionId
    this.positionName = data.positionName
    this.name = data.name
    this.sex = data.sex
    this.birthday = data.birthday
    this.phone = data.phone
    this.account = data.account
    this.password = data.password
    this.identityCard = data.identityCard
    this.employeeNumber = data.employeeNumber
    this.imgUrl = data.imgUrl
    this.onJob = data.onJob
    this.onJobDesc = data.onJobDesc
    this.hireDate = data.hireDate
    this.leaveDate = data.leaveDate
    this.loginPermit = data.loginPermit
    this.remark = data.remark
    this.loginCount = data.loginCount
    this.loginTime = data.loginTime
    this.wechatBind = data.wechatBind
    this.roles = data.roles
    this.open = data.open
    this.cardQrCode = data.cardQrCode
  }
}
