import request from "@/utils/request";

const BASE_URL = "/sysUser";

// 账号管理-分页列表
export function accountPageList(query) {
  return request({
    url: `${BASE_URL}/page`,
    method: "get",
    params: query,
  });
}

// 账号管理-新增
export function addAccount(data) {
  return request({
    url: `${BASE_URL}/save`,
    method: "post",
    data,
  });
}

// 账号管理-编辑
export function editAccount(data) {
  return request({
    url: `${BASE_URL}/edit`,
    method: "post",
    data,
  });
}

// 账号管理-删除
export function delAccount(id) {
  return request({
    url: `${BASE_URL}/del/${id}`,
    method: "post",
  });
}

// 账号管理-详情
export function getAccountDetail(id) {
  return request({
    url: `${BASE_URL}/${id}`,
    method: "get",
  });
}

// 账号管理-启用
export function enableAccount(id) {
  return request({
    url: `${BASE_URL}/enable/${id}`,
    method: "post",
  });
}

// 账号管理-停用
export function disableAccount(id) {
  return request({
    url: `${BASE_URL}/disable/${id}`,
    method: "post",
  });
}

// 检查科室是否已被账号关联
export function checkDeptUse(id) {
  return request({
    url: `${BASE_URL}/check-dept/${id}`,
    method: "get",
  });
}
