export type D4formType = {
  pageSize: number
  pageNum: number
  businessTimeStart: string
  businessTimeEnd: string
  num: string
  sonNum: string
  deptName: string
  userName: string
  startTime: string
  endTime: string
  status: string
  userType: string
}

export type D4InputKeyType = keyof D4formType

export const D4baseFormData: D4formType = {
  pageSize: 10,
  pageNum: 1,

  businessTimeStart: '',
  businessTimeEnd: '',
  num: '',
  sonNum: '',
  deptName: '',
  userName: '',
  startTime: '',
  endTime: '',
  status: '',
  userType: ''
}

// 分库号重复校验
export const findFirstDuplicate = (arr: number[]) => {
  const set = new Set()
  for (const num of arr) {
    if (set.has(num)) return num // 第一个重复值
    set.add(num)
  }
  return null
}
