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