import request from '@/utils/request'
// 寿命数据分析
/**
 * 
 * @param {* ewb-project-controller} data 
 */
// 项目列表
export function project_list(data) {
  return request({
    url: request.apiModule.wb + '/project/list',
    method: 'get',
    params:data
  })
}
// 项目删除
export function project_delete(data) {
  return request({
    url: request.apiModule.wb + '/project/delete',
    method: 'get',
    params:data
  })
}
// 项目创建
export function project_create(data) {
  return request({
    url: request.apiModule.wb + '/project/create',
    // url: request.apiModule.wb + '/project/create?objectName=123&wbName=333',
    method: 'post',
    data
  })
}
// 项目编辑保存
export function project_save(data) {
  return request({
    url: request.apiModule.wb + '/project/save',
    method: 'post',
    data
  })
}

/**
 * 
 * @param {*ewb-analysis-controller 分析} data 
 */
// 保存分析设置
export function analysis_setting_save(data) {
  return request({
    url: request.apiModule.wb + '/analysis/analysis-setting-save',
    method: 'post',
    data
  })
}
// 分析复制
export function analysis_copy(data) {
  return request({
    url: request.apiModule.wb + '/analysis/copy',
    method: 'get',
    params:data
  })
}

// 分析创建
export function analysis_create(data) {
  return request({
    url: request.apiModule.wb + '/analysis/create',
    method: 'post',
    data
  })
}
// 分析删除
export function analysis_del(data) {
  return request({
    url: request.apiModule.wb + '/analysis/del',
    method: 'get',
    params:data
  })
}
// 获取参数估计
export function getanalysis_setting(data) {
  return request({
    url: request.apiModule.wb + '/analysis/getAnalysis-setting',
    method: 'post',
    data
  })
}

// 分析列表
export function analysis_list(data) {
  return request({
    url: request.apiModule.wb + '/analysis/list',
    method: 'get',
    params:data
  })
}

// 分析编辑保存
export function analysis_save(data) {
  return request({
    url: request.apiModule.wb + '/analysis/save',
    method: 'post',
    data
  })
}

/**
 * 
 * @param {* ewb-data-controller} query 
 */
// 导出
export function data_exportData(data) {
  return request({
    url: request.apiModule.wb + '/data/exportData',
    method: 'get',
    params:data
  })
}

// 获取数据
export function data_getData(data) {
  return request({
    url: request.apiModule.wb + '/data/getData',
    method: 'get',
    params:data
  })
}

// 导入模板下载
export function data_importTemplate(data) {
  return request({
    url: request.apiModule.wb + '/data/import-template',
    method: 'get',
    params:data
  })
}

// 导入
export function data_importData(data) {
  return request({
    url: request.apiModule.wb + '/data/importData',
    method: 'post',
    data
  })
}
// 随机数生成
export function data_random(data) {
  return request({
    url: request.apiModule.wb + '/data/random',
    method: 'post',
    data
  })
}
// 保存数据
export function data_saveData(data) {
  return request({
    url: request.apiModule.wb + '/data/saveData',
    method: 'post',
    data
  })
}

/**
 * 
 * @param {* ewb-chart-controller} query 
 */
// 计算器
export function chart_calc(data) {
  return request({
    url: request.apiModule.wb + '/chart/calc',
    method: 'post',
    data
  })
}
// 等高图
export function chart_contourPlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/contourPlot',
    method: 'post',
    data
  })
}
// 失效率
export function chart_failureRatePlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/failureRatePlot',
    method: 'post',
    data
  })
}
// 柱状图
export function chart_histogramPlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/histogramPlot',
    method: 'post',
    data
  })
}
// 概率密度
export function chart_probabilityDensityPlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/probabilityDensityPlot',
    method: 'post',
    data
  })
}
// 概率图
export function chart_probabilityPlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/probabilityPlot',
    method: 'post',
    data
  })
}
// 可靠度
export function chart_reliabilityPlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/reliabilityPlot',
    method: 'post',
    data
  })
}
// 不可靠度
export function chart_unreliabilityPlot(data) {
  return request({
    url: request.apiModule.wb + '/chart/unreliabilityPlot',
    method: 'post',
    data
  })
}
// 获取分布向导列表
export function getDistributionWizard(data) {
  return request({
    url: request.apiModule.wb + '/analysis/distribution-wizard',
    method: 'get',
    params: data
  })
}
// 计算分布向导列表
export function computedDistributionWizard(data) {
  return request({
    url: request.apiModule.wb + '/analysis/distribution-wizard-calc',
    method: 'post',
    data
  })
}
// 获取计算器设置
export function getCalculatorSetting(data) {
  return request({
    url: request.apiModule.wb + '/chart/calc-setting',
    method: 'get',
    params: data
  })
}
// 开始计算
export function startComputed(data) {
  return request({
    url: request.apiModule.wb + '/chart/calc',
    method: 'post',
    data
  })
}

// 选择分布向导
export function distributionWizardSelect(data) {
  return request({
    url: request.apiModule.wb + '/analysis/distribution-wizard-select',
    method: 'post',
    data
  })
}

//获取分组列表
export function getGroupList(data) {
  return request({
    url: request.apiModule.wb + '/group/list?dataId='+data.dataId,
    method: 'get'
  })
}

//保存分组列表
export function saveGroupList(data) {
  return request({
    url: request.apiModule.wb + '/group/save',
    method: 'post',
    data
  })
}

//获取多图分析列表
export function multiAnalysis_list(data) {
  return request({
    url: request.apiModule.wb + '/multichart/analysis-list',
    method: 'get',
    params:data
  })
}
//等高图
export function multiChart_contourPlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/contourPlot',
    method: 'get',
    params:data
  })
}
//多图创建
export function multiAnalysis_create(data) {
  return request({
    url: request.apiModule.wb + '/multichart/create',
    method: 'post',
    data
  })
}

//多图名称修改-删除
export function multiAnalysis_edit(data) {
  return request({
    url: request.apiModule.wb + '/multichart/edit',
    method: 'post',
    data
  })
}

// 失效率
export function multiChart_failureRatePlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/failureRatePlot',
    method: 'get',
    params:data
  })
}
// 柱状图
export function multiChart_histogramPlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/histogramPlot',
    method: 'get',
    params:data
  })
}

//多图列表
export function multiTree_list(data) {
  return request({
    url: request.apiModule.wb + '/multichart/list',
    method: 'get',
    params:data
  })
}

//多图分析保存
export function multiChart_edit(data) {
  return request({
    url: request.apiModule.wb + '/multichart/save-list',
    method: 'post',
    data
  })
}

// 概率密度
export function multiChart_probabilityDensityPlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/probabilityDensityPlot',
    method: 'get',
    params:data
  })
}
// 概率图
export function multiChart_probabilityPlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/probabilityPlot',
    method: 'get',
    params:data
  })
}
// 可靠度
export function multiChart_reliabilityPlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/reliabilityPlot',
    method: 'get',
    params:data
  })
}
// 不可靠度
export function multiChart_unreliabilityPlot(data) {
  return request({
    url: request.apiModule.wb + '/multichart/unreliabilityPlot',
    method: 'get',
    params:data
  })
}
// export function fetchList(query) {
//   return request({
//     url: request.apiModule.wb + '/information',
//     method: 'get',
//     params: query
//   })
// }



// export function updateFMEA(data) {
//   return request({
//     url: request.apiModule.wb + '/information',
//     method: 'put',
//     data
//   })
// }

// export function deleteFMEA(param) {
//   return request({
//     url: request.apiModule.wb + '/information/' + param,
//     method: 'delete'
//   })
// }
