import request from '@/utils/http'
import { Dashboard } from '@/enums/api'
import {
  ProjectCategoryStatResParams,
  ProjectMonthCountStatReqParams,
  ProjectMonthCountStatResParams,
  ProjectMultiStatResParams,
  ProjectPlanStatReqParams,
  ProjectPlanStatResParams
} from '@/types/dashboard'

/**
 * 获取项目分类统计
 * @returns
 */
export const getProjectCategoryStat = () => {
  return request.post<ProjectCategoryStatResParams>(
     Dashboard.REPORT_PRJOJECT_CAT_STAT,
     {}
  )
}

/**
 * 获取项目计划统计
 * @param ProjectPlanStatReqParams
 * @returns
 */
export const getProjectPlanStat = (params: ProjectPlanStatReqParams) => {
  return request.post<ProjectPlanStatResParams>(
    Dashboard.REPORT_PRJOJECT_PLAN_STAT,
     params
  )
}

/**
 * 获取项目数量累计，每月底计算一次累计值，每月一条数据
 * @param ProjectMonthCountStatReqParams
 * @returns
 */
export const getProjectMonthCountStat = (
  params: ProjectMonthCountStatReqParams
) => {
  return request.post<ProjectMonthCountStatResParams>(
     Dashboard.REPORT_PRJOJECT_COUNT_STAT,
     params
  )
}

/**
 * 获取项目数量累计，每月底计算一次累计值，每月一条数据
 * @param ProjectMonthCountStatReqParams
 * @returns
 */
export const getProjectMultiStat = () => {
  return request.post<ProjectMultiStatResParams>(
    Dashboard.REPORT_PRJOJECT_MULTI_STAT,
     {}
  )
}
