import { http } from '@/utils/http/axios';

/**
 * @description: 列表
 */
export function getLayoutList(params?) {
  return http.request({
    url: '/layout/item/page',
    method: 'GET',
    params,
  });
}

/**
 * @description: 根据ID获取详情
 */
export function getLayoutDetail(layoutId) {
  return http.request({
    url: '/layout/item/detail/' + layoutId,
    method: 'get',
  });
}

/**
 * @description: 添加
 */
export function layoutAdd(data: any) {
  return http.request({
    url: '/layout/item/add',
    method: 'POST',
    data,
  });
}

/**
 * @description: 更新
 */
export function layoutUpdate(data: any) {
  return http.request({
    url: '/layout/item/update',
    method: 'PUT',
    data,
  });
}

/**
 * @description: 删除
 */
export function layoutDelete(layoutId) {
  return http.request({
    url: '/layout/item/delete/' + layoutId,
    method: 'DELETE',
  });
}

/**
 * @description: 批量删除
 */
export function layoutBatchDelete(data: any) {
  return http.request({
    url: '/layout/item/batchDelete',
    method: 'DELETE',
    data,
  });
}
