import request from "@/utils/request";
// 岗检小组接口
// 修改
export function updateTeam(data) {
  return request({
    url: "/postCheck/team",
    method: "put",
    data: data,
  });
}

// 新增
export function addTeam(data) {
  return request({
    url: "/postCheck/team",
    method: "post",
    data: data,
  });
}

// 查询详细
export function getTeam(Id) {
  return request({
    url: "/postCheck/team/" + Id,
    method: "get",
  });
}
// 删除
export function delTeam(Id) {
  return request({
    url: "/postCheck/team/" + Id,
    method: "delete",
  });
}

// 查询列表
export function listTeam(query) {
  return request({
    url: "/postCheck/team/list",
    method: "get",
    params: query,
  });
}

// 查询工作组列表
export function listGroupList(query) {
  return request({
    url: "/postCheck/team/groupList",
    method: "get",
    params: query,
  });
}

// 查询工作小组列表
export function getTeamListByGroupId(Id) {
  return request({
    url: "/postCheck/team/teamListByGroupId/" + Id,
    method: "get",
  });
}
// 岗检小组关联成员接口
// 修改
export function updateTeamUser(data) {
  return request({
    url: "/postCheck/teamUser",
    method: "put",
    data: data,
  });
}

// 新增
export function addTeamUser(data) {
  return request({
    url: "/postCheck/teamUser",
    method: "post",
    data: data,
  });
}

// 查询详细
export function getTeamUser(Id) {
  return request({
    url: "/postCheck/teamUser/" + Id,
    method: "get",
  });
}
// 删除
export function delTeamUser(Id) {
  return request({
    url: "/postCheck/teamUser/" + Id,
    method: "delete",
  });
}

// 查询列表
export function listTeamUser(query) {
  return request({
    url: "/postCheck/teamUser/list",
    method: "get",
    params: query,
  });
}

// 查询成员列表
export function getTeamUserByTeamId(query) {
  return request({
    url: "/postCheck/teamUser/getTeamUserByTeamId/" + query,
    method: "get"
  });
}

// 查询部门
export function getDeptTree() {
  return request({
    url: "/system/user/deptTree",
    method: "get"
  });
}

// 查询用户
export function getPostUserList(params) {
  return request({
    url: "/system/user/postUserList",
    method: "get",
    params
  });
}
export function getOptionselect(deptId) {
  return request({
    url: `/system/post/postCheck/optionselect/${deptId}`,
    method: "get",
  });
}
export function getOptionselectTwo(deptId,planId) {
  return request({
    url: `/system/post/postCheck/optionselect/${deptId}/${planId}`,
    method: "get",
  });
}
// 新增
export function addTeamDept(data) {
  return request({
    url: "/postCheck/teamDept",
    method: "post",
    data: data,
  });
}
export function getTeamDept(params) {
  return request({
    url: `/postCheck/teamDept/list`,
    method: "get",
    params
  });
}

