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 getProjectListPage = (form) => {
    return request({
        url: '/api/blade-manager/projectInfo/pageList',
        method: 'get',
        params:form
    })
}

//获取合同段信息
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/get-wbsTree-list',
        method: 'get',
        params: {
            type
        }
    })
}

export const findProjectTree = (projectId, wbsId) => {
    return request({
        url: '/api/blade-manager/projectInfo/tree',
        method: 'get',
        params: {
            projectId,
            wbsId
        }
    })
}
//获取试验配合比树接口
export const findProjectTreeTrial = (projectId, wbsId,pKeyId ) => {
    return request({
        url: '/api/blade-manager/projectInfo/tree-record-trial',
        method: 'get',
        params: {
            projectId,
            wbsId,
            pKeyId
        }
    })
}

export const getContractRelation = (contractId) => {
  return request({
    url: ' /api/blade-manager/contractInfo/get-contract-relationInfo',
    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/submit-wbsTree-project',
        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/tree-all-construction',
        method: 'get',
        params
    })
}
//收藏项目接口
export const collectProject = (obj) => {
    return request({
        url: '/api/blade-manager/projectInfo/collectProject',
        method: 'post',
        params: obj
    })
}

//所有项目排序
export const sortProject = (obj) => {
    return request({
        url: '/api/blade-manager/projectInfo/sortProject',
        method: 'post',
        data: obj
    })
}
//收藏项目排序
export const sortProjectCollect = (obj) => {
    return request({
        url: '/api/blade-manager/projectInfo/sortProjectCollect',
        method: 'post',
        data: obj
    })
}
//合同段排序
export const sortContract = (obj) => {
    return request({
        url: '/api/blade-manager/contractInfo/sort',
        method: 'post',
        data: obj
    })
}