import request from '../js/request'
import config from '../js/config'

export function queryDictData(dictTypeName) {
    return request({
        url: '/dictData/getDicDataByTypeName',
        method: 'get',
        data: {
            dictTypeName,
        },
    })
}

export function queryDictDataCache(dictTypeName) {
    return request({
        url: '/system-boot/dictType/dictDataCache',
        method: 'get',
    })
}

// 字典树接口通过code
export const queryByCode = (code) => {
    return request({
        url: '/system-boot/dictTree/queryByCode',
        method: 'post',
        data: {
            code,
        },
    })
}

// 字典树接口
export const queryCsDictTree = (pid) => {
    return request({
        url: '/system-boot/dictTree/query',
        method: 'post',
        data: {
            pid,
        },
    })
}
// 字典树接口
export const queryStatistical = (data) => {
    return request({
        url: '/system-boot/csstatisticalset/queryStatistical',
        method: 'post',
        data: data,
    })
}

// 字典树接口通过id
export const queryByid = (id) => {
    return request({
        url: '/system-boot/dictTree/queryByid',
        method: 'post',
        data: {
            id,
        },
    })
}

// 程序版本
export const queryEdDataPage = () => {
    return request({
        url: '/cs-device-boot/edData/queryEdDataPage',
        method: 'post',
        header: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: {
            pageNum: 1,
            devName: '',
            devType: '',
            pageSize: 999,
            versionStartDate: '',
            versionendDate: '',
        },
    })
}
