import request from '@/config/axios'

export interface ProjectVO {
  id: number
  projectName: string
  projectCode: string
  establishDate: Date
  createTime: Date
}

export interface ProjectPageReqVO extends PageParam {
  projectName?: string
  projectCode?: string
  establishDate?: Date[]
}

// 查询项目管理分页
export const getProjectPage = (params: ProjectPageReqVO) => {
  return request.get({ url: '/demo/project/page', params })
}

// 查询项目管理详情
export const getProject = (id: number) => {
  return request.get({ url: '/demo/project/get', params: { id } })
}

// 新增项目管理
export const createProject = (data: ProjectVO) => {
  return request.post({ url: '/demo/project/create', data })
}

// 修改项目管理
export const updateProject = (data: ProjectVO) => {
  return request.put({ url: '/demo/project/update', data })
}

// 删除项目管理
export const deleteProject = (id: number) => {
  return request.delete({ url: '/demo/project/delete', params: { id } })
}

// 批量删除项目管理
export const deleteProjectList = (ids: number[]) => {
  return request.delete({ url: '/demo/project/delete-list', params: { ids } })
}

// 导出项目管理
export const exportProject = (params) => {
  return request.download({ url: '/demo/project/export-excel', params })
}
