import request from '@/config/axios'

// 项目 VO
export interface ProjectVO {
  id: number // 主键ID
  projectName: string // 项目名称
  projectCode: string // 项目编号
}

// 项目 API
export const ProjectApi = {
  // 查询项目分页
  getProjectPage: async (params: any) => {
    return await request.get({ url: `/contract/project/page`, params })
  },

  // 查询项目详情
  getProject: async (id: number) => {
    return await request.get({ url: `/contract/project/get?id=` + id })
  },

  // 新增项目
  createProject: async (data: ProjectVO) => {
    return await request.post({ url: `/contract/project/create`, data })
  },

  // 修改项目
  updateProject: async (data: ProjectVO) => {
    return await request.put({ url: `/contract/project/update`, data })
  },

  // 删除项目
  deleteProject: async (id: number) => {
    return await request.delete({ url: `/contract/project/delete?id=` + id })
  },

  // 导出项目 Excel
  exportProject: async (params) => {
    return await request.download({ url: `/contract/project/export-excel`, params })
  }
}
