import request from '@/router/axios';

//初始化根节点
export const archiveTreeInit = (data) => {
    return request({
        url: '/api/blade-manager/archiveTree/init',
        method: 'post',
        params: data
    })
}


//树节点懒加载
export const lazyTree = (params) => {
    return request({
        url: '/api/blade-manager/archiveTree/lazy-tree',
        method: 'get',
        params
    })
}

//词典接口
export const dictionary = (params) => {
    return request({
        url: '/api/blade-system/dict-biz/dictionary',
        method: 'get',
        params
    })
}

//删除
export const remove = (params) => {
    return request({
        url: '/api/blade-manager/archiveTree/remove',
        method: 'post',
        params
    })
}

//新增
export const archiveTreeSave = (data) => {
    return request({
        url: '/api/blade-manager/archiveTree/save',
        method: 'post',
        data
    })
}

//编辑
export const archiveTreeUpdate = (data) => {
    return request({
        url: '/api/blade-manager/archiveTree/update',
        method: 'post',
        data
    })
}

//编辑
export const archiveTreeDetail = (params) => {
    return request({
        url: '/api/blade-manager/archiveTree/detail',
        method: 'get',
        params
    })
}

//全加载树形结构-显示树
export const archiveTreetree = (params) => {
    return request({
        url: '/api/blade-manager/archiveTree/tree',
        method: 'get',
        params
    })
}


//保存树
export const submitDisplayConfigTree = (params) => {
    return request({
        url: '/api/blade-manager/archiveTree/submitDisplayConfigTree',
        method: 'post',
        params
    })
}

//获取归档树同级节点
export const getSameGradeNode = (params) => {
  return request({
    url: '/api/blade-manager/archiveTree/getSameGradeNode',
    method: 'get',
    params
  })
}

//提交归档树手动排序
export const submitArchiveTreeSort = (data) => {
  return request({
    url: '/api/blade-manager/archiveTree/submitArchiveTreeSort',
    method: 'post',
    data
  })
}
