import http from "@/api/http.js"

/**
 * 品种列表  IsAnalyse
 * @param {*} params 
 * @returns 
 */
export const varietyList = params => {
  return http.get('/supply_analysis/variety/list',params)
}

/**
 * 添加品种 
 * @param {VarietyName AdminIdList} params 
 * @returns 
 */
export const addVariety = params => {
  return http.post('/supply_analysis/variety/add',params)
}

/**
 * 编辑品种
 * @param {VarietyId VarietyName AdminIdList} params 
 * @returns 
 */
export const editVariety = params => {
  return http.post('/supply_analysis/variety/edit',params)
}

/**
 * 删除品种监测
 * @param {*VarietyId} params 
 * @returns 
 */
export const delVariety = params => {
  return http.post('/supply_analysis/variety/delete',params)
}

/**
 * 装置列表
 * @param {*VarietyId} params 
 * @returns 
 */
export const plantList = params => {
  return http.get('/supply_analysis/variety/plant/list',params)
}

/**
 * 添加装置
 * @param {*} params
 * "VarietyId": 1,
    "Province": "江西省",
    "City": "南昌市",
    "FactoryName": "第一工厂",
    "PlantName": "第一装置",
    "MaintenanceDate": "2023-02-10",
    "ResumptionDate": "2023-03-24",
    "AnnualCapacity": 1293,
    "Coefficient": 0.7,
    "AverageDailyCapacityReduction": 2.4797 
 * @returns 
 */
export const addPlant = params => {
  return http.post('/supply_analysis/variety/plant/add',params)
}

/**
 * 编辑装置
 * @param {*} params 
 *  "VarietyPlantId": 1,
    "Province": "江西省",
    "City": "南昌市",
    "FactoryName": "第一工厂(修改）",
    "PlantName": "第一装置",
    "MaintenanceDate": "2023-02-10",
    "ResumptionDate": "2023-03-24",
    "AnnualCapacity": 1293,
    "Coefficient": 0.7,
    "AverageDailyCapacityReduction": 2.4797
 * @returns 
 */
export const editPlant = params => {
  return http.post('/supply_analysis/variety/plant/edit',params)
}

/**
 * 删除装置
 * @param {*VarietyPlantId} params 
 * @returns 
 */
export const delPlant =  params => {
  return http.post('/supply_analysis/variety/plant/delete',params)
}

/**
 * 指标列表
 * @param {*VarietyId} params 
 * @returns 
 */
export const targetList = params => {
  return http.get('/supply_analysis/variety/edb/list',params)
}

/**
 * 分析品种
 * @param {*VarietyId} params 
 * @returns 
 */
export const analyseVariety = params => {
  return http.post('/supply_analysis/variety/analysis',params)
}

/**
 * 加入eta指标库
 * @param {* VarietyEdbId Frequency EdbName Unit ClassifyId} params 
 */
export const addIntoEtaBase = params => {
  return http.post('/supply_analysis/variety/edb/add',params)
}

/**
 * 获取指标数据
 * @param {* VarietyEdbId} params 
 * @returns 
 */
export const getEdbData = params => {
  return http.get('/supply_analysis/variety/edb/data/list',params)
}


/**
 * 品种详情
 * @param {*VarietyId} params 
 * @returns 
 */
export const varietyDetail = params => {
  return http.get('/supply_analysis/variety/detail',params)
}

/**一键成图
 * 获取曲线数据
 * @param {*} params VarietyEdbId
 * @returns 
 */
export const getEdbDetailData = params => {
  return http.get('/supply_analysis/variety/edb/data/list/v2',params)
}

/**
 * 季节数据
 * @param {*} params VarietyEdbId
 * @returns 
 */
export const getEdbSeasonData = params => {
  return http.get('/supply_analysis/variety/edb/data/seasonal',params)
}

/**
 * 同比数据
 * @param {*} params VarietyEdbId
 * @returns 
 */
export const getEdbOnyearData = params => {
  return http.get('/supply_analysis/variety/edb/data/tb',params)
}

/**
 * 添加其他装置
 * @param {*} params  VarietyId PrevVarietyPlantId VarietyPlantIdList
 * @returns 
 */
export const copyOtherPlant = params => {
  return http.post('/supply_analysis/variety/plant/copy',params)
}

/**
 * 设置品种信息
 * @param {*} params VarietyId Day
 * @returns 
 */
export const setVareityInfo = params => {
  return http.post('/supply_analysis/variety/production_day/modify',params)
}