import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { VulcAlarmStandardVO, VulcAlarmStandardForm, VulcAlarmStandardQuery } from '@/api/mes/vulcAlarmStandard/types';

/**
 * 查询报警标准信息列表
 * @param query
 * @returns {*}
 */

export const listVulcAlarmStandard = (query?: VulcAlarmStandardQuery): AxiosPromise<VulcAlarmStandardVO[]> => {
  return request({
    url: '/mes/vulcAlarmStandard/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询报警标准信息详细
 * @param alarmStandardId
 */
export const getVulcAlarmStandard = (alarmStandardId: string | number): AxiosPromise<VulcAlarmStandardVO> => {
  return request({
    url: '/mes/vulcAlarmStandard/' + alarmStandardId,
    method: 'get'
  });
};

/**
 * 新增报警标准信息
 * @param data
 */
export const addVulcAlarmStandard = (data: VulcAlarmStandardForm) => {
  return request({
    url: '/mes/vulcAlarmStandard',
    method: 'post',
    data: data
  });
};

/**
 * 修改报警标准信息
 * @param data
 */
export const updateVulcAlarmStandard = (data: VulcAlarmStandardForm) => {
  return request({
    url: '/mes/vulcAlarmStandard',
    method: 'put',
    data: data
  });
};

/**
 * 删除报警标准信息
 * @param alarmStandardId
 */
export const delVulcAlarmStandard = (alarmStandardId: string | number | Array<string | number>) => {
  return request({
    url: '/mes/vulcAlarmStandard/' + alarmStandardId,
    method: 'delete'
  });
};


/**
 * 下拉框查询报警标准信息列表
 * @param query
 * @returns {*}
 */
export function getProdVulcAlarmStandardList (query) {
    return request({
        url: '/mes/vulcAlarmStandard/getProdVulcAlarmStandardList',
        method: 'get',
        params: query
    });
};
