/*
 * @Description:
 * @Author: leizhe
 * @Date: 2022-01-13 17:10:28
 * @LastEditTime: 2022-04-24 15:46:27
 * @LastEditors: leizhe
 */
import { post, get, PUBLISH_SERVICE } from '../index';

export const GetDataDictionaryList = params =>
  get(`${PUBLISH_SERVICE}/DataManger/GetDataDictionaryList`, params);
export const AddDataDictionary = params =>
  get(`${PUBLISH_SERVICE}/DataManger/AddDataDictionary`, params);
export const DeleteDataDictionary = params =>
  get(`${PUBLISH_SERVICE}/DataManger/DeleteDataDictionary`, params);
export const EditDataDictionary = params =>
  post(`${PUBLISH_SERVICE}/DataManger/EditDataDictionary`, params);
export const AddDataDictionaryList = params =>
  post(`${PUBLISH_SERVICE}/DataManger/AddDataDictionaryList`, params);
export const SearchDataDictionaryList = params =>
  get(`${PUBLISH_SERVICE}/DataManger/SearchDataDictionaryList`, params);
// 获取数据字典
export const GetKeyValue = params => get(`${PUBLISH_SERVICE}/DataManger/GetKeyValue`, params);
export const AddKeyValue = params => get(`${PUBLISH_SERVICE}/DataManger/AddKeyValue`, params);
export const EditKeyValue = params => get(`${PUBLISH_SERVICE}/DataManger/EditKeyValue`, params);
export const DeleteKeyValue = params => get(`${PUBLISH_SERVICE}/DataManger/DeleteKeyValue`, params);
// 导出文件
export const ExportDataDictionary = params =>
  get(`${PUBLISH_SERVICE}/DataManger/ExportDataDictionary`, params, {
    responseType: 'blob',
  });
// 拖拽组件
export const DataDictionaryChangeOrder = params =>
  post(`${PUBLISH_SERVICE}/DataManger/DataDictionaryChangeOrder`, params);

export const ImportDataDictionary = query =>
  post(`${PUBLISH_SERVICE}/DataManger/ImportDataDictionary`, query, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8',
    },
  });
