import request, { postBlob } from '@/utils/request'

export function getDataDictionary(data) {
  return request({
    url: `/dict/page?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function getDataDictionaryExport(data, name) {
  return postBlob({
    url: '/dict/page/export',
    data,
    name
  })
}

export function addDataDictionary(data) {
  return request({
    url: `/dict/add`,
    method: 'post',
    data
  })
}

export function updateDataDictionary(data) {
  return request({
    url: `/dict/update`,
    method: 'post',
    data
  })
}

export function delDataDictionary(params) {
  return request({
    url: `/dict/del`,
    method: 'post',
    params
  })
}

export function dictDetail(params) {
  return request({
    url: `/dict/detail`,
    method: 'post',
    params
  })
}

export function dictListDict(params) {
  return request({
    url: `/common/dict/listDict`,
    method: 'post',
    params
  })
}

export function dictTypeList(data) {
  return request({
    url: `/dict/type/list`,
    method: 'post',
    data
  })
}
