import { get, post, CITY_SERVICE, PUBLISH_SERVICE } from '@/services/index';

/*
 ** params
 */
// 获取机构树
export const getOUTree = params =>
  get(`${CITY_SERVICE}/OMS.svc/U_GetOUTree?_version=9999&node=-1`, params);
// 获取站点信息
export const getWebModuleTree = userMode =>
  get(
    `${PUBLISH_SERVICE}/PlatformCenter/WebModuleTree?${qs.stringify({
      userMode,
    })}`,
  );

// 新增站点
export const addStation = params => get(`${PUBLISH_SERVICE}/UserCenter/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 getUserByStation = params => get(`${CITY_SERVICE}/OMS.svc/P_GetUserByStation`, params);

// 获取站点一级列表
export const getAllGroup = params => get(`${PUBLISH_SERVICE}/UserCenter/GetAllGroup`, params);

// 获取站点二级列表
export const getStationUserList = params =>
  get(`${PUBLISH_SERVICE}/UserCenter/GetStationUserList`, params);

// 获取站点管理一二级列表+分页
export const groupUserPagingList = params =>
  post(`${PUBLISH_SERVICE}/UserCenter/GroupUserPagingList`, params);
// 添加子站点
export const addChildSiteNode = params =>
  get(`${PUBLISH_SERVICE}/UserCenter/AddChildSiteNode`, params);
// 获取树状站点列表
export const getSiteTree = params => get(`${PUBLISH_SERVICE}/UserCenter/GetSiteTree`, params);
// 获取当前站点关联的用户
export const getStationUsers = params =>
  get(`${PUBLISH_SERVICE}/UserCenter/GetStationUsers`, params);
// 菜单拖拽
export const DragGroup = params => post(`${PUBLISH_SERVICE}/UserCenter/DragGroup  `, params);
