import axios from '@/libs/api.request'

export const login = (data = {}) => {
  return axios.request({
    url: '/api/Account/Login',
    data,
    method: 'post'
  })
}

export const getUserInfo = (data = {}) => {
  return axios.request({
    url: '/api/User/GetUserInfo',
    data,
    method: 'post'
  })
}

// 退出
export const logout = (token, roleKey) => {
  return axios.request({
    url: '/api/User/loginQuit',
    data: {
      roleKey: roleKey
    },
    method: 'post'
  })
}

// 角色列表
export const GetRolePageList = (data = {}) => {
  return axios.request({
    url: '/api/System/GetRolePageList',
    data,
    method: 'post'
  })
}

// 新增角色
export const AddRole = (data = {}) => {
  return axios.request({
    url: '/api/System/RoleAdd',
    data,
    method: 'post'
  })
}

// 编辑角色
export const UpdateRole = (data = {}) => {
  return axios.request({
    url: '/api/System/RoleUpdate',
    data,
    method: 'post'
  })
}

// 删除角色
export const DeleteRole = (data = {}) => {
  return axios.request({
    url: '/api/System/RoleDelete',
    data,
    method: 'post'
  })
}

// 部门树形下拉数据
export const GetDeptZTreeChildren = (data = {}) => {
  return axios.request({
    url: '/api/System/GetZTreeChildren',
    data,
    method: 'post'
  })
}

// 新增部门
export const DepartmentAdd = (data = {}) => {
  return axios.request({
    url: '/api/System/DepartmentAdd',
    data,
    method: 'post'
  })
}

// 编辑部门
export const DepartmentUpdate = (data = {}) => {
  return axios.request({
    url: '/api/System/DepartmentUpdate',
    data,
    method: 'post'
  })
}

// 删除部门
export const DepartmentDelete = (data = {}) => {
  return axios.request({
    url: '/api/System/DepartmentDelete',
    data,
    method: 'post'
  })
}

// 用户列表
export const GetUserPageList = (data = {}) => {
  return axios.request({
    url: '/api/User/GetPageList',
    data,
    method: 'post'
  })
}

// 发起盘点用户列表
export const GetUserList = (data = {}) => {
  return axios.request({
    url: '/api/Stock/GetUserList',
    data,
    method: 'post'
  })
}

// 新增用户
export const UserAdd = (data = {}) => {
  return axios.request({
    url: '/api/User/Add',
    data,
    method: 'post'
  })
}

// 编辑用户
export const UserUpdate = (data = {}) => {
  return axios.request({
    url: '/api/User/Update',
    data,
    method: 'post'
  })
}

// 删除用户
export const UserDelete = (data = {}) => {
  return axios.request({
    url: '/api/User/Delete',
    data,
    method: 'post'
  })
}

// 重置密码
export const ResetPassword = (data = {}) => {
  return axios.request({
    url: '/api/User/ResetPassword',
    data,
    method: 'post'
  })
}

// 获取用户菜单
export const GetMenuOperateList = (data = {}) => {
  return axios.request({
    url: '/api/System/GetMenuOperateList',
    data,
    method: 'post'
  })
}

// 编辑用户菜单
export const EditRoleMenu = (data = {}) => {
  return axios.request({
    url: '/api/System/EditRoleMenu',
    data,
    method: 'post'
  })
}

// 用户列表
export const GetMenuZTreeChildren = (data = {}) => {
  return axios.request({
    url: '/api/System/GetMenuZTreeChildren',
    data,
    method: 'post'
  })
}

// 新增菜单
export const MenuAdd = (data = {}) => {
  return axios.request({
    url: '/api/System/MenuAdd',
    data,
    method: 'post'
  })
}

// 编辑菜单
export const MenuUpdate = (data = {}) => {
  return axios.request({
    url: '/api/System/MenuUpdate',
    data,
    method: 'post'
  })
}

// 删除菜单
export const MenuDelete = (data = {}) => {
  return axios.request({
    url: '/api/System/MenuDelete',
    data,
    method: 'post'
  })
}

// 首页待办事项
export const GetDealWithItem = (data = {}) => {
  return axios.request({
    url: '/api/ApprovalFlow/GetDealWithItem',
    data,
    method: 'post'
  })
}

// 修改密码
export const ChangePassword = (data = {}) => {
  return axios.request({
    url: '/api/User/ChangePassword',
    data,
    method: 'post'
  })
}

// 上传app版本
export const UploadApkFile = (data = {}) => {
  return axios.request({
    url: '/api/User/UploadApkFile',
    data,
    method: 'post'
  })
}

// 上传app版本
export const DownloadApkFile = (data = {}) => {
  return axios.request({
    url: '/api/User/DownloadApkFile',
    data,
    method: 'post'
  })
}
