import {
  PermQueryParam,
  PermPageResult,
  PermFormData
} from '@/types/api/system/perm';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * "系统管理" => "权限管理"
 * @param data
 */
export function permissionManage(data: PermQueryParam): AxiosPromise<PermPageResult> {
  return request({
    url: 'admin/system/permission/page-query',
    method: 'post',
    params: data
  });
}

/**
 * "系统管理" => "添加编辑权限"
 * @param data
 */
export function addAuditPermission(data: PermFormData): any {
  return request({
    url: 'admin/system/permission/merge',
    method: 'post',
    params: data
  });
}

/**
 * "系统管理" => "删除权限"
 * @param ids
 */
export function delPermission(ids: any): any {
  return request({
    url: 'admin/system/permission/deletes',
    method: 'post',
    params: ids
  });
}
