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

export default {
    async getList(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/lazy-tree?parentId=0',
            method: 'get',
            params: form,
        })
    },
    async getLazytree(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/lazy-tree',
            method: 'get',
            params: form,
        })
    },
    async getAlltree(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/tree',
            method: 'get',
            params: form,
        })
    },
    async getDetail(id) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/detail',
            method: 'get',
            params: { id },
        })
    },
    async remove(id) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/remove',
            method: 'post',
            params: { id },
        })
    },
    async submit(data) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/submit',
            method: 'post',
            data: data,
        })
    },
    async selectByNodeTable(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/get-node-table',
            method: 'get',
            params: form,
        })
    },
    async getParamElements(form) {
        return HcApi({
            url: '/api/blade-manager/param/get-param-elements',
            method: 'get',
            params: form,
        })
    },
    async delParamElements(form) {
        return HcApi({
            url: '/api/blade-manager/param/del-param-elements',
            method: 'get',
            params: form,
        })
    },
    async specifiedParamElements(form) {
        return HcApi({
            url: '/api/blade-manager/param/specified-param-elements',
            method: 'post',
            params: form,
        })
    },
    async saveFormAndElement(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/save-table-element',
            method: 'post',
            data: form,
        })
    },
    async selectFormElements(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/get-table-elements',
            method: 'get',
            params: form,
        })
    },
    async selectPrivateFormElements(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/get-private-table-elements',
            method: 'get',
            params: form,
        })
    },
    async getTableElments(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/get-table-formula-elements',
            method: 'get',
            params: form,
        })
    },
    async removeTableById(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/remove-table',
            method: 'get',
            params: form,
        })
    },
    async importWbsTree(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/import-wbsTree',
            method: 'post',
            headers: { 'Content-Type': 'multipart/form-data' },
            data: form,
        })
    },
    async exportTemplate() {
        return HcApi({
            url: '/api/blade-manager/wbsTree/export-template',
            method: 'get',
            responseType: 'arraybuffer',
        })
    },
    async findWbsTreeSameLevel(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/get-same-level',
            method: 'get',
            params: form,
        })
    },
    async wbsTreeSort(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/submit-sort',
            method: 'post',
            data: form,
        })
    },
    async findWbsTreeTableSameLevel(form) {
        return HcApi({
            url: '/api/blade-manager/wbsFormElement/get-table-same-level',
            method: 'get',
            params: form,
        })
    },
    async wbsTreeTableSort(form) {
        return HcApi({
            url: '/api/blade-manager/wbsFormElement/submit-table-sort',
            method: 'post',
            data: form,
        })
    },
    async findWbsTreePrivateSameLevel(form) {
        return HcApi({
            url: '/api/blade-manager/wbsPrivate/get-node-same-level',
            method: 'get',
            params: form,
        })
    },
    async wbsTreePrivateSort(form) {
        return HcApi({
            url: '/api/blade-manager/wbsPrivate/submit-sort',
            method: 'post',
            data: form,
        })
    },
    async parameters(form) {
        return HcApi({
            url: '/api/blade-manager/param/list',
            method: 'get',
            params: form,
        })
    },
    async saveOrUpdateBatch(form) {
        return HcApi({
            url: '/api/blade-manager/param/saveOrUpdateBatch',
            method: 'post',
            data: form,
        })
    },
    async keymap(form) {
        return HcApi({
            url: '/api/blade-manager/param/keymap',
            method: 'get',
            params: form,
        })
    },
    async importwbsTreeFormBatch(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/import-wbsTreeFormBatch',
            method: 'post',
            data: form,
        })
    },
    async exportBatchTemplate(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/export-batchTemplate',
            method: 'get',
            params: form,
        })
    },
    async updateBatchNodeTableInfo(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/update-batch-node-tableInfo',
            method: 'post',
            data: form,
        })
    },
    async updateBatchNodeTableInfo2(form) {
        return HcApi({
            url: '/api/blade-manager/wbsPrivate/update-batch-node-tableInfo',
            method: 'post',
            data: form,
        })
    },
    async updateBatchNodeTableInfoElement(form) {
        return HcApi({
            url: '/api/blade-manager/tableinfo/update-batch-tableInfo',
            method: 'post',
            data: form,
        })
    },
    async updateStatus(form) {
        return HcApi({
            url: '/api/blade-manager/wbsPrivate/update-status',
            method: 'get',
            params: form,
        })
    },
    async getNodeTabAndParam(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/get-node-table-param',
            method: 'get',
            params: form,
        })
    },
    async submitFullName(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/submit-full-name',
            method: 'post',
            params: form,
        })
    },
    async refrehPram(form) {
        return HcApi({
            url: '/api/blade-manager/param/refresh',
            method: 'get',
            params: form,
        })
    },
    async syncCurrentFormInProject(form) {
        return HcApi({
            url: '/api/blade-manager/wbsPrivate/syncCurrentFormInProject',
            method: 'get',
            params: form,
        })
    },
    async getQueryValueByType(form) {
        return HcApi({
            url: '/api/blade-manager/wbsTree/getQueryValueByType',
            method: 'get',
            params: form,
        })
    },
}
