import request from '@/router/axios';

export const submitProject = (projectInfo) => {
    return request({
        url: '/api/blade-manager/projectInfo/submit',
        method: 'post',
        data: projectInfo
    })
}

//项目类型
export const getProjectList = (current, size, params) => {
    return request({
        url: '/api/blade-manager/projectInfo/list',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}


//获取合同段信息
export const getProjectDeatil2 = (id) => {
    return request({
        url: '/api/blade-manager/contractInfo/detail2',
        method: 'get',
        params: {
            id
        }
    })
}

export const getProjectDeatil = (id) => {
    return request({
        url: '/api/blade-manager/projectInfo/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const getProjectDeatilWbsId = (id, ReferenceWbsTemplateId, ReferenceWbsTemplateType) => {
    return request({
        url: '/api/blade-manager/projectInfo/detail2',
        method: 'get',
        params: {
            id,
            ReferenceWbsTemplateId,
            ReferenceWbsTemplateType
        }
    })
}

export const findLogWbsTreeList = () => {
  return request({
    url: '/api/blade-manager/wbsInfo/queryLogTree',
    method: 'get',
  })
}

export const findWbsTreeList = (type) => {
    return request({
        url: '/api/blade-manager/projectInfo/getWbsTreeList',
        method: 'get',
        params: {
            type
        }
    })
}

export const findProjectTree = (projectId, wbsId) => {
    return request({
        url: '/api/blade-manager/projectInfo/tree',
        method: 'get',
        params: {
            projectId,
            wbsId
        }
    })
}

export const getContractRelation = (contractId) => {
  return request({
    url: ' /api/blade-manager/contractInfo/getContractRelationInfo',
    method: 'get',
    params: {
      contractId,
    }

  })
}

export const submitLogWbsTreeInProject = (obj) => {
  return request({
    url: '/api/blade-manager/wbsPrivate/saveContractLogNode',
    method: 'post',
    data: obj
  })
}

export const submitWbsTreeInProject = (obj) => {
    return request({
        url: '/api/blade-manager/projectInfo/submitWbsTreeInProject',
        method: 'post',
        data: obj
    })
}

export const removeProject = (ids) => {
    return request({
        url: '/api/blade-manager/projectInfo/remove',
        method: 'post',
        params: {
            ids
        }
    })
}


//施工方合同段权限配置枚举接口
export const treeAllConstruction = (params) => {
    return request({
        url: '/api/blade-manager/contractInfo/treeAllConstruction',
        method: 'get',
        params
    })
}
