/*
 * @Description:
 * @Author: leizhe
 * @Date: 2021-05-27 16:31:05
 * @LastEditTime: 2021-11-02 14:23:38
 * @LastEditors: leizhe
 */
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';

// 新增站点
export const addStation = params => get(`${CITY_SERVICE}/OMS.svc/W4_AddStation`, params);
// 删除站点
export const deleteStation = params => get(`${PUBLISH_SERVICE}/UserCenter/DeleteStation`, params);
// 编辑站点
export const editStation = params => get(`${PUBLISH_SERVICE}/UserCenter/EditStation`, params);

// 角色关联用户
export const chooseUserToStation = (params, options) =>
  get(`${PUBLISH_SERVICE}/UserCenter/ChooseUserToStation?`, params, options);

// 获取所有角色信息
export const getUserRelationList = params =>
  get(`${CITY_SERVICE}/OMS.svc/W4_GetUserRelationList`, params);

// 角色管理保存选择
export const setMenuToRole = (params, options) =>
  post(`${PUBLISH_SERVICE}/UserCenter/SetMenuToRole?`, params, options);
/**
 * @角色管理
 */

// 获取角色树
export const getRoleGroupList = params =>
  get(`${PUBLISH_SERVICE}/UserCenter/RoleGroupList`, params);

// 新增角色
export const addRole = params => get(`${PUBLISH_SERVICE}/UserCenter/AddRole`, params);

// 获取分组列表
export const getRoleGroup = params => get(`${CITY_SERVICE}/OMS.svc/P_GetRoleGroup`, params);
// 获取角色备注
export const GetRoleGroup = params => get(`${PUBLISH_SERVICE}/UserCenter/GetRoleGroup`, params);
// 编辑角色
export const editRole = params => get(`${PUBLISH_SERVICE}/UserCenter/EditRole`, params);
// 删除角色
export const deleteRole = params => get(`${PUBLISH_SERVICE}/UserCenter/DeleteRole`, params);
// 编辑分组名称
export const updateGroupName = params =>
  get(`${PUBLISH_SERVICE}/UserCenter/UpdateGroupName`, params);

// 通过角色id获取组件菜单
export const getMenuByRoleWithLevel = params =>
  get(`${PUBLISH_SERVICE}/UserCenter/GetMenuByRoleWithLevel`, params);

// 获取角色类别
export const getWebConfigTypes = params =>
  get(`${PUBLISH_SERVICE}/PlatformCenter/GetWebConfigTypes`, params);
// 菜单拖拽
export const DragGroup = params => post(`${PUBLISH_SERVICE}/UserCenter/DragGroup  `, params);
