/*
 * @Author: zc
 * @Description: 字典管理
 * @version:
 * @Date: 2022-08-09 16:19:55
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-09-21 15:36:01
 */
import request from '/@/utils/request';

/**
 * @description: 获取字典类型列表
 * @param 
 * @return {*}
 */
export const dictypeList = () => {
    return request({
        url: '/api/v1/Sys/dictype-list',
        method: 'post'
    });
};

/**
 * @description: 根据字典类型ID获取字典列表
 * @param {object} data 
 * @return {*}
 */
export const getDataByTypeid = (data: object) => {
    return request({
        url: `/api/v1/Sys/dictdata-type`,
        method: 'get',
        params:data
    });
};

/**
 * @description: 根据字典类型Code获取字典列表
 * @param {object} code 字典类型code
 * @return {*}
 */
export const getDataByCode= (code: string) => {
    return request({
        url: `/api/v1/Sys/dictdata-code/${code}`,
        method: 'get',
    });
};

/**
 * @description: 获取字典对象 详情
 * @param {object} id 字典类型id
 * @return {*}
 */
export const getDetail = (id: string) => {
    return request({
        url: `/api/v1/Sys/dicdata/${id}`,
        method: 'get',
    });
};
/**
 * @description: 新增字典数据
 * @param {object} data 数据
 * @return {*}
 */
export const addDic = (data: object) => {
    return request({
        url: `/api/v1/Sys/add-dicdata`,
        method: 'post',
        data
    });
};
/**
 * @description: 修改字典数据
 * @param {object} data 数据
 * @return {*}
 */
export const editDic = (data: object) => {
    return request({
        url: `/api/v1/Sys/update-dicdata`,
        method: 'post',
        data
    });
};
