import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DmsBaseMaintStandardVO, DmsBaseMaintStandardForm, DmsBaseMaintStandardQuery } from '@/api/dms/dmsBaseMaintStandard/types';

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

export const listDmsBaseMaintStandard = (query?: DmsBaseMaintStandardQuery): AxiosPromise<DmsBaseMaintStandardVO[]> => {
  return request({
    url: '/dms/dmsBaseMaintStandard/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询保养标准信息详细
 * @param maintStandardId
 */
export const getDmsBaseMaintStandard = (maintStandardId: string | number): AxiosPromise<DmsBaseMaintStandardVO> => {
  return request({
    url: '/dms/dmsBaseMaintStandard/' + maintStandardId,
    method: 'get'
  });
};

/**
 * 新增保养标准信息
 * @param data
 */
export const addDmsBaseMaintStandard = (data: DmsBaseMaintStandardForm) => {
  return request({
    url: '/dms/dmsBaseMaintStandard',
    method: 'post',
    data: data
  });
};

/**
 * 修改保养标准信息
 * @param data
 */
export const updateDmsBaseMaintStandard = (data: DmsBaseMaintStandardForm) => {
  return request({
    url: '/dms/dmsBaseMaintStandard',
    method: 'put',
    data: data
  });
};

/**
 * 删除保养标准信息
 * @param maintStandardId
 */
export const delDmsBaseMaintStandard = (maintStandardId: string | number | Array<string | number>) => {
  return request({
    url: '/dms/dmsBaseMaintStandard/' + maintStandardId,
    method: 'delete'
  });
};


/**
 * 下拉框查询保养标准信息列表
 * @param query
 * @returns {*}
 */
export function getDmsBaseMaintStandardList (query) {
    return request({
        url: '/dms/dmsBaseMaintStandard/getDmsBaseMaintStandardList',
        method: 'get',
        params: query
    });
};
