import request from '@/router/axios';

export const getTypeMap = (params) => {
  return request({
    url: '/api/blade-manager/fb/getTypeMap',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const saveFormula = ({formula,remark,nodeId,elementId,scale,number,map,scope,projectId,dev,ver,formulas,method}) => {
  return request({
    url: '/api/blade-manager/formula/save',
    method: 'post',
    data: {
      formula,
      remark,
      nodeId,
      elementId,
      scale,
      number,
      map,
      scope,
      projectId,
      dev,
      ver,
      formulas,
      method
    }
  })
}

export const updateFormula = ({id,formula,remark,nodeId,elementId,scale,number,map,scope,dev,formulas,method}) => {
  return request({
    url: '/api/blade-manager/formula/update',
    method: 'post',
    data: {
      id,
      formula,
      remark,
      nodeId,
      elementId,
      scale,
      number,
      map,
      scope,
      dev,
      formulas,
      method
    }
  })
}

export const formulaDetail = (params) => {
  return request({
    url: '/api/blade-manager/formula/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}
