import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseInspectStandardVO, DmsBaseInspectStandardForm, DmsBaseInspectStandardQuery } from '@/api/dms/dmsBaseInspectStandard/types';

/**
 * 查询点巡检标准信息列表
 * @param query
 * @returns {*}
 */

export const listDmsBaseInspectStandard = (query?: DmsBaseInspectStandardQuery): AxiosPromise<DmsBaseInspectStandardVO[]> => {
  return request({
    url: '/dms/dmsBaseInspectStandard/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询点巡检标准信息详细
 * @param inspectStandardId
 */
export const getDmsBaseInspectStandard = (inspectStandardId: string | number): AxiosPromise<DmsBaseInspectStandardVO> => {
  return request({
    url: '/dms/dmsBaseInspectStandard/' + inspectStandardId,
    method: 'get'
  });
};

/**
 * 新增点巡检标准信息
 * @param data
 */
export const addDmsBaseInspectStandard = (data: DmsBaseInspectStandardForm) => {
  return request({
    url: '/dms/dmsBaseInspectStandard',
    method: 'post',
    data: data
  });
};

/**
 * 修改点巡检标准信息
 * @param data
 */
export const updateDmsBaseInspectStandard = (data: DmsBaseInspectStandardForm) => {
  return request({
    url: '/dms/dmsBaseInspectStandard',
    method: 'put',
    data: data
  });
};

/**
 * 删除点巡检标准信息
 * @param inspectStandardId
 */
export const delDmsBaseInspectStandard = (inspectStandardId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseInspectStandard/' + inspectStandardId,
    method: 'delete'
  });
};


/**
 * 下拉框查询点巡检标准信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseInspectStandardList (query) {
    return request({
        url: '/dms/dmsBaseInspectStandard/getDmsBaseInspectStandardList',
        method: 'get',
        params: query
    });
};
