/*
 * @Author: your name
 * @Date: 2021-07-26 10:13:31
 * @LastEditTime: 2021-09-28 09:52:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /TracerMethodology_PC/src/pages/UserMana/service.js
 */


import { request } from 'umi';

// 获用户列表
export async function getUserList(params, options) {
    return request('/api/pfm/user/list', {
      method: 'GET',
      params: {...params},
      ...(options || {}),
    });
}

// 新增人员
export async function addUser(body, options) {
    return request('/api/pfm/user/save', {
      method: 'POST',
      data: {...body},
      ...(options || {}),
    });
}

// 编辑人员
export async function editUser(body, options) {
  return request('/api/pfm/user/update', {
    method: 'POST',
    data: {...body},
    ...(options || {}),
  });
}

// 删除人员
export async function delUser(params, options) {
  const {id} = params;
  const ids = [id];
  return request(`/api/pfm/user/delete`, {
    data:ids,
    method: 'POST',
    ...(options || {}),
  });
}


// 导入excel
export async function importExcel(body, options) {
  const {formData} = body;
  return request('/api/pfm/excel/importUser', {
    method: 'POST',
    data:formData,
    ...(options || {}),
  });
}