import axios from '@/utils/axios'

export default {
  /**
   * 获取自定义分析树
   */
  getCustomTree(params) {
    return axios.get('/v2/custom/analysis/item/tree', { params })
  },
  /**
   * 获取自定义分析项
   */
  getCustomItem(data) {
    return axios.get('/v2/custom/analysis/item/' + data)
  },
  /**
   * 新增自定义分析项
   */
  addCustomItem(data) {
    return axios.post('/v2/custom/analysis/item/add', data)
  },
  /**
   * 编辑自定义分析项
   */
  editCustomItem(data) {
    return axios.post('/v2/custom/analysis/item/edit', data)
  },
  /**
   * 根据ID删除自定义分析项
   */
  deleteCustomItem(data) {
    return axios.post('/v2/custom/analysis/item/delete/' + data)
  },
  /**
   * 根据IDS删除自定义分析项
   */
  deleteBatchCustomItem(data) {
    return axios.post('/custom/analysis/item/delete/batch', data)
  },
  /**
   * 获取分析项图表配置
   */
  getCustomItemChartOption(data) {
    return axios.get('/v2/custom/analysis/item/setting/' + data)
  },
  /**
   * 修改分析项图表配置
   */
  editCustomItemChartOption(data) {
    return axios.post('/v2/custom/analysis/item/setting/edit', data)
  },
  /**
   * 新增分析项图表配置
   */
  addCustomItemChartOption(itemId, data) {
    return axios.post('/v2/custom/analysis/item/setting/add?id=' + itemId, data)
  },
  /**
   * 编辑维度数据
   */
  editCustomItemSource(data) {
    return axios.post('/v2/custom/analysis/item/source/update', data)
  },
  /**
   * 获取维度数据
   */
  getCustomItemSourceDataList(data) {
    return axios.post('/v2/custom/analysis/item/source', data)
  },
  /**
   * 获取分析项颜色设置
   */
  getItemSettingColor(params) {
    return axios.get('/v2/custom/analysis/item/color', { params })
  }
}
