/*
 * @Author: Gui
 * @Date: 2023-03-01 19:20:44
 * @LastEditors: guicheng 1625811865@qq.com
 * @LastEditTime: 2024-04-18 17:59:27
 * @Description: tel files
 * @filePath:
 */
import { http } from "@/utils/http";
import { dataResult } from "./apiResult";
import { getGroupUrl } from "@/utils/getUrl/getUrl.js";
const UrlList = await getGroupUrl();

// <*------用户板块--------*>
/** 获取用户管理列表 */
export const getUserList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.userpage.url,
    method: UrlList.prizeSet.userpage.method,
    params
  });
};
/** 修改用户密码 */
export const changeUserPassword = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.userpassword.url,
    method: UrlList.prizeSet.userpassword.method,
    params
  });
};
/** 锁定用户 */
export const lockUserList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.userlock.url,
    method: UrlList.prizeSet.userlock.method,
    params
  });
};
/** 删除用户 */
export const deleteUserList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.userremoveById.url,
    method: UrlList.prizeSet.userremoveById.method,
    params
  });
};
/** 新增用户 */
export const AddUserList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.useradd.url,
    method: UrlList.prizeSet.useradd.method,
    params
  });
};
/** 编辑用户 */
export const editUserList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.userupdate.url,
    method: UrlList.prizeSet.userupdate.method,
    params
  });
};

// <*------角色板块--------*>

/** 获取全部角色管理列表 */
export const getAllRoleList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.rolelist.url,
    method: UrlList.prizeSet.rolelist.method,
    params
  });
};
/** 获取角色管理列表 */
export const getRoleList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.rolepage.url,
    method: UrlList.prizeSet.rolepage.method,
    params
  });
};
/** 获取当前角色权限列表 */
export const getRoleRightList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.menugetRoleTree.url,
    method: UrlList.prizeSet.menugetRoleTree.method,
    params
  });
};
/** 添加系统角色 */
export const postRoleList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.roleadd.url,
    method: UrlList.prizeSet.roleadd.method,
    params
  });
};
/** 编辑系统角色 */
export const putRoleList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.roleupdate.url,
    method: UrlList.prizeSet.roleupdate.method,
    params
  });
};
/** 删除系统角色 */
export const deleteRoleList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.roleremoveById.url,
    method: UrlList.prizeSet.roleremoveById.method,
    params
  });
};
/** 获取所有角色权限列表 */
export const getRoleTreeList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.menugetRoleTree.url,
    method: UrlList.prizeSet.menugetRoleTree.method,
    params
  });
};

// <*------菜单板块--------*>

/** 获取菜单列表 */
export const getMenuList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.menutree.url,
    method: UrlList.prizeSet.menutree.method,
    params
  });
};
/** 获取菜单列表 */
export const putRoleMenuList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.rolemenu.url,
    method: UrlList.prizeSet.rolemenu.method,
    params
  });
};
/** 添加菜单 */
export const postMenuList = (params?: object): dataResult => {
  console.log(params);
  return http.Request({
    url: UrlList.prizeSet.menuadd.url,
    method: UrlList.prizeSet.menuadd.method,
    params
  });
};
/** 编辑菜单 */
export const putMenuList = (params?: object): dataResult => {
  console.log(params);
  return http.Request({
    url: UrlList.prizeSet.menuupdate.url,
    method: UrlList.prizeSet.menuupdate.method,
    params
  });
};
/** 删除菜单 */
export const deleteMenuList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.menuremoveById.url,
    method: UrlList.prizeSet.menuremoveById.method,
    params
  });
};

// <*------部门板块--------*>

/** 获取全部部门列表 */
export const getAllDeptList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.deptlist.url,
    method: UrlList.prizeSet.deptlist.method,
    params
  });
};
/** 获取部门列表 */
export const getDeptList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.depttree.url,
    method: UrlList.prizeSet.depttree.method,
    params
  });
};
/** 删除部门列表 */
export const deleteDeptList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.deptremoveById.url,
    method: UrlList.prizeSet.deptremoveById.method,
    params
  });
};
/** 编辑部门 */
export const putDeptList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.deptupdate.url,
    method: UrlList.prizeSet.deptupdate.method,
    params
  });
};
/** 添加部门 */
export const postDeptList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.deptadd.url,
    method: UrlList.prizeSet.deptadd.method,
    params
  });
};
// <*------岗位板块--------*>

/** 获取全部列表 */
export const getAllPostList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.postlist.url,
    method: UrlList.prizeSet.postlist.method,
    params
  });
};
/** 获取分页岗位列表 */
export const getPostList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.postpage.url,
    method: UrlList.prizeSet.postpage.method,
    params
  });
};
/** 删除岗位列表 */
export const deletePostList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.postremoveById.url,
    method: UrlList.prizeSet.postremoveById.method,
    params
  });
};
/** 编辑岗位 */
export const putPostList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.postupdate.url,
    method: UrlList.prizeSet.postupdate.method,
    params
  });
};
/** 添加岗位 */
export const postPostList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.postadd.url,
    method: UrlList.prizeSet.postadd.method,
    params
  });
};
// <*------公共参数--------*>

/** 修改公共参数 */
export const paramUpdate = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.paramupdate.url,
    method: UrlList.prizeSet.paramupdate.method,
    params
  });
};


// <*------市场板块--------*>

/** 获取市场列表 */
export const getRelationList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.relationtree.url,
    method: UrlList.prizeSet.relationtree.method,
    params
  });
};
/** 添加市场 */
export const postRelationList = (params?: object): dataResult => {
  console.log(params);
  return http.Request({
    url: UrlList.prizeSet.relationadd.url,
    method: UrlList.prizeSet.relationadd.method,
    params
  });
};
/** 编辑市场 */
export const putRelationList = (params?: object): dataResult => {
  console.log(params);
  return http.Request({
    url: UrlList.prizeSet.relationupdate.url,
    method: UrlList.prizeSet.relationupdate.method,
    params
  });
};
/** 删除市场 */
export const deleteRelationList = (params?: object): dataResult => {
  return http.Request({
    url: UrlList.prizeSet.relationremoveById.url,
    method: UrlList.prizeSet.relationremoveById.method,
    params
  });
};