import service from '@/utils/request'
// 获取项目列表
export const getProjectList = (data) => {
  return service({
    url: '/project/queryProjectList',
    method: 'post',
    data: data
  })
}

// 查询所有项目
export const getAllProject = (data) => {
  return service({
    url: '/project/queryAllProject',
    method: 'get'
  })
}

// 项目立项
export const createProject = (data) => {
  return service({
    url: '/project/createProject',
    method: 'post',
    data: data,
  })
}

// 项目数据总览
export const projectDataScreen = () => {
  return service({
    url: '/project/queryProjectsInfo',
    method: 'GET'
  })
}

// 获取项目信息
export const getProjectMessage = (code) => {
  return service({
    url: '/project/queryProjectByCode',
    method: 'GET',
    params: {
      code: code
    }
  })
}

// 项目删除
export const deleteProject = (code) => {
  return service({
    url: '/project/deleteProject',
    method: 'DELETE',
    params: {
      code: code
    }
  })
}

// 项目基本信息编辑
export const editProject = (data) => {
  return service({
    url: '/project/updateProject',
    method: 'PUT',
    data: data
  })
}

// 查询项目状态
export const queryProjectState = () => {
  return service({
    url: '/project/queryProjectState',
    method: 'GET'
  })
}

// 新增项目状态
export const createProjectState = (data) => {
  return service({
    url: '/project/createProjectState',
    method: 'POST',
    data: data
  })
}

// 更新项目状态
export const updateProjectState = (data) => {
  return service({
    url: '/project/updateProjectState',
    method: 'PUT',
    data: data
  })
}

// 删除项目状态
export const deleteProjectState = (data) => {
  return service({
    url: '/project/deleteProjectState',
    method: 'DELETE',
    data: data
  })
}

// 查询项目的收支分析
export const queryProjectExpense = (code) => {
  return service({
    url: '/finance/queryProjectFinance',
    method: 'GET',
    params: { code: code }
  })
}

// 查询项目总金
export const queryProjectSum = (code) => {
  return service({
    url: '/project/queryProjectSum?code=' + code,
    method: 'GET'
  })
}
