import { httpApi } from '../request/httpApi'

//用户配置保存
export const userConfigSave = (form, msg = true) => httpApi({
    url: '/api/blade-business/defaultConfig/saveOrUpdate',
    method: 'post',
    data: form,
}, msg)

//用户配置详情
export const userConfigInfo = (form, msg = true) => httpApi({
    url: '/api/blade-business/defaultConfig/detail',
    method: 'get',
    params: form,
}, msg)

//获取用户列表
export const getContractUserList = (form, msg = true) => httpApi({
    url: '/api/blade-manager/contractInfo/get-contract-userList',
    method: 'get',
    params: form,
}, msg)

//获取表单的下拉框测站点数据
export const getDapSiteData = (form, msg = true) => httpApi({
    url: '/api/blade-business/dap/site',
    method: 'get',
    params: form,
}, msg)


//获取更新信息
export const getVersionJson = () => httpApi({
    url: 'version.json?time=' + new Date().getTime(),
    method: 'get',
}, false)
//懒加载区域树
export const getLazyTree = (form, msg = true) => httpApi({
    url: '/api/blade-land/regionTreeInfo/lazyTree',
    method: 'get',
    params: form,
}, msg)
//新增或修改树
export const addOrUpdateTree = (form, msg = true) => httpApi({
    url: '/api/blade-land/regionTreeInfo/addOrUpdate',
    method: 'post',
    data: form,
}, msg)

//获取节点详情
export const getDetail = (form, msg = true) => httpApi({
    url: '/api/blade-land/regionTreeInfo/detail',
    method: 'get',
    params: form,
}, msg)

//删除节点
export const deleteTree = (form, msg = true) => httpApi({
    url: '/api/blade-land/regionTreeInfo/delete',
    method: 'get',
    params: form,
}, msg)
//获取区域
export const getAllCounty = (form, msg = true) => httpApi({
    url: '/api/blade-land/regionTreeInfo/getAllCounty',
    method: 'get',
    params: form,
}, msg)

//字典数据查询接口
export const getDictInfo = (code) => httpApi({
    url: '/api/blade-system/dict/dictionary',
    method: 'get',
    params: {
        code,
    },
}, false)

