import request from '@/utils/request'

// 添加团队绩效数据
export function addTeamPerformance(params) {
  return request({
    url: 'api/TeamGrade/Add',
    method: 'post',
    params
  })
}
// 团队绩效列表数据
export function getTeamPerformance(params) {
  return request({
    url: 'api/TeamGrade/getlistbypage',
    method: 'post',
    params
  })
}
// 团队绩效列表数据详情
export function getTeamPerformanceDetail(id) {
  return request({
    url: 'api/TeamGrade/getdetail',
    method: 'post',
    data:{
        id
    }
  })
}
// 编辑团队绩效数据
// export function editTeamPerformance(params) {
//     return request({
//       url: 'api/TeamGrade/update',
//       method: 'post',
//       params
//     })
//   }
  export function editTeamPerformance(data) {
    return request({
      headers: {
        'Content-Type': 'application/json'
      },
      transformRequest: [function(data) {
        data = JSON.stringify(data)
        return data
      }],
      url: 'api/TeamGrade/update',
      method: 'post',
      params: {},
      data
    })
  }
// 删除团队绩效数据
export function deleteTeamPerformance(id) {
    return request({
      url: 'api/TeamGrade/delete',
      method: 'post',
      data:{
        id
      }
    })
  }