// 系统api
import request from "@/utils/request";
/**
 *  系统参数
 */
// 获取系统参数列表
export const getParamList = (data) => {
  return request({
    url: `/bill/param/list`,
    method: "post",
    data,
  });
};
// 查看系统参数
export const getParamInfo = (params) => {
  return request({
    url: `/bill/param/info`,
    method: "get",
    params,
  });
};
// 保存编辑系统参数
export const saveParam = (data) => {
  return request({
    url: `/bill/param/save`,
    method: "post",
    data,
  });
};
// 删除系统参数
export const delParam = (params) => {
  return request({
    url: `/bill/param/delete`,
    method: "get",
    params,
  });
};

/**
 *  任务信息
 */
// 获取任务信息列表
export const getTaskList = (data) => {
  return request({
    url: `/bill/task/list`,
    method: "post",
    data,
  });
};
// 查看任务信息
export const getTaskInfo = (params) => {
  return request({
    url: `/bill/task/info`,
    method: "get",
    params,
  });
};
// 保存编辑任务信息
export const saveTask = (data) => {
  return request({
    url: `/bill/task/save`,
    method: "post",
    data,
  });
};
// 删除任务信息
export const delTask = (params) => {
  return request({
    url: `/bill/task/delete`,
    method: "get",
    params,
  });
};

/**
 *  操作日志
 */

// 获取操作日志
export const getlogsList = (data) => {
  return request({
    url: `/bill/oper/log/list`,
    method: "post",
    data,
  });
};
// 查看操作日志
export const getlog = (params) => {
  return request({
    url: `/bill/oper/log/info`,
    method: "get",
    params,
  });
};

/**
 *  资源信息
 */

// 获取资源信息列表
export const getResourceList = (data) => {
  return request({
    url: `/bill/resource/list`,
    method: "post",
    data,
  });
};
// 获取资源信息详情
export const getResourceDetail = (params) => {
  return request({
    url: `/bill/resource/info`,
    method: "get",
    params,
  });
};
// 添加资源信息
export const saveResource = (data) => {
  return request({
    url: `/bill/resource/save`,
    method: "post",
    data,
  });
};
// 删除资源信息
export const deleteResource = (params) => {
  return request({
    url: `/bill/resource/delete`,
    method: "get",
    params,
  });
};
// 刷新资源
export const refreshResource = (data) => {
  return request({
    url: `/bill/resource/refreshUrl`,
    method: "post",
    data,
  });
};
// 资源分组
export const getResourceGroup = (data) => {
  return request({
    url: `/bill/resource/group`,
    method: "post",
    data,
  });
};
/**
 *  区县接入系统
 */

// 获取接入区县列表
export const getAccessList = (data) => {
  return request({
    url: `/bill/access/list`,
    method: "post",
    data,
  });
};
// 查看接入区县
export const getAccessInfo = (params) => {
  return request({
    url: `/bill/access/info`,
    method: "get",
    params,
  });
};
// 保存编辑接入区县
export const saveAccess = (data) => {
  return request({
    url: `/bill/access/save`,
    method: "post",
    data,
  });
};
// 删除接入区县
export const delAccess = (params) => {
  return request({
    url: `/bill/access/delete`,
    method: "get",
    params,
  });
};

/**
 *  角色
 */

// 获取角色列表
export const getRoleList = (data) => {
  return request({
    url: `/bill/role/list`,
    method: "post",
    data,
  });
};
// 获取角色详情
export const getRole = (params) => {
  return request({
    url: `/bill/role/get`,
    method: "get",
    params,
  });
};
// 保存角色
export const addRole = (data) => {
  return request({
    url: `/bill/role/save`,
    method: "post",
    data,
  });
};
// 删除角色
export const deleteRole = (params) => {
  return request({
    url: `/bill/role/delete`,
    method: "get",
    params,
  });
};
// 获取角色资源列表
export const getRoleResourceList = (data) => {
  return request({
    url: `/bill/role/auth/list`,
    method: "post",
    data,
  });
};
// 添加角色资源
export const addRoleResource = (data) => {
  return request({
    url: `/bill/role/auth/distributionSource`,
    method: "post",
    data,
  });
};

// 添加角色菜单
export const addRoleMenu = (data) => {
  return request({
    url: `/bill/role/auth/distributionMenu`,
    method: "post",
    data,
  });
};

// 获取角色菜单
export const getRoleMenuList = (data) => {
  return request({
    url: `/bill/role/auth/editMenu`,
    method: "post",
    data,
  });
};

/**
 *  用户管理
 */
// 获取用户列表
export const getUserList = (data) => {
  return request({
    url: `/bill/user/list`,
    method: "post",
    data,
  });
};
// 获取用户信息
export const getUserInfo = (params) => {
  return request({
    url: `/bill/user/info`,
    method: "get",
    params,
  });
};
// 保存用户
export const saveUser = (data) => {
  return request({
    url: `/bill/user/save`,
    method: "post",
    data,
  });
};
// 删除用户
export const deleteUser = (params) => {
  return request({
    url: `/bill/user/delete`,
    method: "get",
    params,
  });
};

/**
 *  区县系统
 */
// 获取区县系统列表
export const getSystemList = (data) => {
  return request({
    url: `/bill/access/system/list`,
    method: "post",
    data,
  });
};

// 获取区县系统详情
export const getSystemInfo = (params) => {
  return request({
    url: `/bill/access/system/info`,
    method: "get",
    params,
  });
};

// 保存区县系统
export const saveSystem = (data) => {
  return request({
    url: `/bill/access/system/save`,
    method: "post",
    data,
  });
};

// 删除区县系统
export const deleteSystem = (params) => {
  return request({
    url: `/bill/access/system/delete`,
    method: "get",
    params,
  });
};

/**
 * 菜单管理
 */

// 获取菜单列表
export const getMenuList = (data) => {
  return request({
    url: `/bill/menu/list`,
    method: "post",
    data,
  });
};
// 获取菜单信息
export const getMenuInfo = (params) => {
  return request({
    url: `/bill/menu/info`,
    method: "get",
    params,
  });
};
// 保存菜单
export const saveMenu = (data) => {
  return request({
    url: `/bill/menu/save`,
    method: "post",
    data,
  });
};
// 删除菜单
export const deleteMenu = (params) => {
  return request({
    url: `/bill/menu/delete`,
    method: "get",
    params,
  });
};

// 改变菜单排序
export const changeMenuSort = (data) => {
  return request({
    url: `/bill/menu/upOrDown`,
    method: "post",
    data,
  });
};

// 获取菜单树列表
export const getMenuTreeselect = (data) => {
  return request({
    url: `/bill/menu/treeselect`,
    method: "post",
    data,
  });
};
