export const getPageList = (params) => {
  let displayCount = params.displayCount  // 显示的页面总数（最大值）
  let page = params.page    // 当前页面
  let pages = params.pages    // 总页数
  let limit = []
  for (let i = 1; i <= pages; i++) {
    limit.push(i)
  }
  if (displayCount >= pages) return limit
  if (Math.ceil(displayCount / 2) > page) {
    return limit.slice(0, displayCount)
  } else if (pages - page < Math.ceil(displayCount / 2)) {
    return limit.slice(pages - displayCount, pages)
  } else {
    return limit.slice(page - Math.ceil(displayCount / 2), page + Math.floor(displayCount / 2))
  }
}
