import request from '@/utils/request'

// 查询菜单列表
export function listDept(query) {
  return request({
    url: '/work/dept/list',
    method: 'get',
    params: query
  })
}

// 查询菜单详细
export function getDept(deptId) {
  return request({
    url: '/work/dept/detail/' + deptId,
    method: 'get'
  })
}

// 查询菜单下拉树结构
export function treeselect() {
  return request({
    url: '/work/dept/treeselect',
    method: 'get'
  })
}

// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId) {
  return request({
    url: '/work/dept/roleMenuTreeselect/' + roleId,
    method: 'get'
  })
}

// 新增菜单
export function addDept(data) {
  return request({
    url: '/work/dept/add',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function updateDept(data) {
  return request({
    url: '/work/dept/edit',
    method: 'post',
    data: data
  })
}

// 删除菜单
export function delDept(deptId) {
  return request({
    url: '/work/dept/remove/' + deptId,
    method: 'get'
  })
}
