import request from '@/utils/request'

// 查询数据接入列表
export function listDictType(data) {
  return request({
    url: '/system/dicts/listDictType',
    method: 'post',
    data
  })
}

export function selDictData(dictType) {
  return request({
    url: '/system/dicts/selDictData/' + dictType,
    method: 'post'
  })
}

/**
 * 新增字典
 * @param data
 * @returns {AxiosPromise}
 */
export function indexDictType(dictType) {
  return request({
    url: '/system/dicts/indexDictType/' + dictType,
    method: 'post'
  })
}

/**
 * 添加字典字段
 * @param data
 * @returns {AxiosPromise}
 */
export function indexDictData(data) {
  return request({
    url: '/system/dicts/indexDictData',
    method: 'post',
    data
  })
}

/**
 * 删除字典字段
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteDictData(data) {
  return request({
    url: '/system/dicts/deleteDictData',
    method: 'post',
    data
  })
}

/**
 * 查询详情
 * @param data
 * @returns {AxiosPromise}
 */
export function selectDictData(data) {
  return request({
    url: '/system/dicts/selectDictData',
    method: 'post',
    data
  })
}
// 删除
export function deleteDictType(dictType) {
  return request({
    url: '/system/dicts/deleteDictType?dictType=' + dictType,
    method: 'post'
  })
}
//详情
export function selectDictType(dictType) {
  return request({
    url: '/system/dicts/selectDictType?dictType=' + dictType,
    method: 'post'
  })
}
