import request from './request';
// 员工列表
export const listEmployee = (param) => {
  let params = param || {}
  return request({
    url: `employee/findAll`,
    data: {
      'userType': (params.userType == undefined ? 1 : params.userType),
      'workFlag': (params.workFlag == undefined ? 1 : params.workFlag)
    },
    method: 'post'
  })
}

// 删除员工
export const delEmployee = param => {
  return request({
    url: `employee/del/${param.id}`,
    method: 'get'
  })
}

// 员工详细
export const getEmployee = param => {
  return request({
    url: `employee/${param.id}`,
    method: 'get'
  })
}

// 修改完保存
export const saveEmployee = params => {
  return request({
    url: 'employee/save',
    data: params,
    method: 'POST'
  })
}
// 修改图像
export const saveHeadImage = params => {
  return request({
    url: 'employee/setSelfHeadImage',
    data: params,
    method: 'POST'
  })
}
// 员工信息列表
export const searchEmployee = params => {
  let url = `employee/queryLike/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 设置为负责人setManager
export const setManager = params => {
  return request({
    url: 'employee/setManager',
    data: params,
    method: 'POST'
  })
}
