import request from '@/utils/request'

export function getDmSystem(params) {
  return request({
    url: 'api/dmSystem',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'api/dmSystem',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/dmSystem/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/dmSystem',
    method: 'put',
    data
  })
}

export function queryByRoleId(roleIds, isMenu) {
  return request({
    url: 'api/dmSystem/queryByRoleId?isMenu=' + isMenu,
    method: 'post',
    data: roleIds
  })
}

export function getSystemsTree() {
  return request({
    url: 'api/dmSystem/lazy',
    method: 'get'
  })
}

export default { add, edit, del, getDmSystem, queryByRoleId, getSystemsTree }
