import request from '@/utils/request';

/**
 * 列表
 */
export async function getList(params) {
  const res = await request.get('/eam/alarmsetting/page', { params });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 保存
 */
export async function save(data) {
  const res = await request.post('/eam/alarmsetting/save', data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 修改
 */
export async function update(data) {
  const res = await request.put('/eam/alarmsetting/update', data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// // 详情
export async function getById(id) {
  const res = await request.get(`/eam/alarmsetting/getById/${id}`);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
/**
 * 删除
 */
export async function remove(data) {
  const res = await request.delete(`/eam/alarmsetting/delete`, { data });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 列表
 */
export async function alarmlogsheetPage(params) {
  const res = await request.get('/eam/alarmlogsheet/page', { params });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}