import { HcApi } from '../../request/index'

export default {
    async page(form) {
        return HcApi({
            url: '/api/blade-system/dict/parent-list',
            method: 'get',
            params: form,
        })
    },
    async detail(id) {
        return HcApi({
            url: '/api/blade-system/dict/detail',
            method: 'get',
            params: { id },
        })
    },
    async submit(form) {
        return HcApi({
            url: '/api/blade-system/dict/submit',
            method: 'post',
            data: form,
        })
    },
    async del(ids) {
        return HcApi({
            url: '/api/blade-system/dict/remove',
            method: 'post',
            params: { ids },
        })
    },
    async getList(form) {
        return HcApi({
            url: '/api/blade-system/dict/list',
            method: 'get',
            params: form,
        })
    },
    async getChildList(form) {
        return HcApi({
            url: '/api/blade-system/dict/child-list',
            method: 'get',
            params: form,
        })
    },
    async getDictTree() {
        return HcApi({
            url: '/api/blade-system/dict/tree?code=DICT',
            method: 'get',
            params: {},
        })
    },
    async getDictionary(code) {
        return HcApi({
            url: '/api/blade-system/dict/dictionary',
            method: 'get',
            params: { code },
        })
    },
}
