import request from '@/utils/request'

export function searchCategory(data) {
  return request({
    url: '/project/category/search',
    method: 'post',
    data
  })
}

export function createCategory(data) {
  return request({
    url: '/project/category/create',
    method: 'post',
    data
  })
}

export function updateCategory(data) {
  return request({
    url: '/project/category/update',
    method: 'post',
    data
  })
}

export function getCategoryInfo(data) {
  return request({
    url: '/project/category/info',
    method: 'post',
    data
  })
}

export function deleteCategory(data) {
  return request({
    url: '/project/category/delete',
    method: 'post',
    data
  })
}

// 项目相关

export function searchProject(data) {
  return request({
    url: '/project/search',
    method: 'post',
    data
  })
}

export function createProject(data) {
  return request({
    url: '/project/create',
    method: 'post',
    data
  })
}

export function updateProject(data) {
  return request({
    url: '/project/update',
    method: 'post',
    data
  })
}

export function getProjectInfo(data) {
  return request({
    url: '/project/info',
    method: 'post',
    data
  })
}

export function deleteProject(data) {
  return request({
    url: '/project/delete',
    method: 'post',
    data
  })
}

/* 关联模版 */

export function relate(data) {
  return request({
    url: '/project/relate',
    method: 'post',
    data
  })
}

/* 获取绑定数据内容  template/searchTemplateList*/

export function searchTemplateList(data) {
  return request({
    url: '/template/searchTemplateList',
    method: 'post',
    data
  })
}

/* 获取绑定数据模板列表  template/seachTemplateListNoData*/

export function searchTemplateListNoData(data) {
  return request({
    url: '/template/seachTemplateListNoData',
    method: 'post',
    data
  })
}

/* 阶段 project/getphases */

export function getphases(data) {
  return request({
    url: '/project/getphases',
    method: 'post',
    data
  })
}

/* 目前状态  */

export function getstatus(data) {
  return request({
    url: '/project/getstatus',
    method: 'post',
    data
  })
}

/* 完成度 */

export function calculate(data) {
  return request({
    url: '/project/calculate',
    method: 'post',
    data
  })
}

/* 导出文献列表 */

export function exportItems(data) {
  return request({
    url: '/project-input/export',
    method: 'post',
    data,
    responseType: 'blob' // 重要：需要设置responseType为blob以接收文件流
  })
}
