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

export default {
    //分页
    async page(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/list',
            method: 'get',
            params: form,
        })
    },
    //树节点懒加载
    async lazyTree(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/lazy-tree',
            method: 'get',
            params: form,
        })
    },
    //初始化根节点
    async treeInit(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/init',
            method: 'post',
            params: form,
        })
    },
    //全加载树形结构
    async allTree(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/tree',
            method: 'get',
            params: form,
        })
    },
    //同步节点
    async syncProjectTree(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/syncProjectTree',
            method: 'post',
            params: form,
        })
    },
    //节点详情
    async treeDetail(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/detail',
            method: 'get',
            params: form,
        })
    },
    //节点更新
    async treeUpdate(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/update',
            method: 'post',
            data: form,
        })
    },
    //节点新增
    async treeAdd(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/save',
            method: 'post',
            data: form,
        })
    },
    //获取归档树同级节点
    async getSameGradeNode(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/get-same-grade-node',
            method: 'get',
            params: form,
        })
    },
    //提交归档树手动排序
    async submitTreeSort(form) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/submit-tree-sort',
            method: 'post',
            data: form,
        })
    },
    //删除节点
    async removeTree(id) {
        return HcApi({
            url: '/api/blade-manager/archiveTree/remove',
            method: 'post',
            params: { id },
        })
    },
    //保存调整元素-设置输入框
    async saveTextInfo(form) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/saveTextInfo',
            method: 'post',
            data: form,
        })
    },
    //电签 -- 获取所属方
    async getRoleType(form = {}) {
        return HcApi({
            url: '/api/blade-system/role/getRoleTypeInfo',
            method: 'get',
            params: form,
        })
    },
    //电签 -- 获取角色类型
    async getRoleInfoByParentId(form = {}) {
        return HcApi({
            url: '/api/blade-system/role/getRoleInfoByParentId',
            method: 'get',
            params: form,
        })
    },
    //电签 -- 获取签章类型
    async findPfxType(form = {}) {
        return HcApi({
            url: '/api/blade-business/task/query-task-type-status',
            method: 'get',
            params: form,
        })
    },
    //电签 -- 获取电签信息
    async getSignDetail(form = {}) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/detail',
            method: 'get',
            params: form,
        })
    },
    //电签 -- 修改电签信息
    async updateDetail(form = {}) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/update',
            method: 'post',
            data: form,
        })
    },
    //电签 -- 获取数据
    async getSigList(form = {}) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/page',
            method: 'get',
            params: form,
        })
    },
    //电签 -- 获取预览数据
    async getPriwbsPdf(pkeyId) {
        return HcApi({
            url: '/api/blade-manager/exceltab/get-priwbs-pdf',
            method: 'get',
            params: { pkeyId },
        })
    },
    async saveSig(form) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/save_sigInfo',
            method: 'post',
            data: form,
        })
    },
    async remove(ids, tabId) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/remove',
            method: 'post',
            params: { ids, tabId },
        })
    },
    //保存默认值
    async saveDdefual(form) {
        return HcApi({
            url: '/api/blade-manager/textdictinfo/save_defaulVal',
            method: 'post',
            data: form,
        })
    },
}
