import request from '@/utils/request'

const api = 'bi-api'
export const categorySave = (data) => {
  return request({
    url: api + '/visual/classify/submit',
    method: 'post',
    data
  })
}

export const categoryList = (params) => {
  return request({
    url: api + '/visual/classify/list',
    method: 'get',
    params
  })
}

export const categoryDel = (params) => {
  return request.post(
    api + '/visual/classify/remove',
    {},
    {
      params
    }
  )
}

export const optionList = (params) => {
  return request({
    url: api + '/visual/dynamicData/enumValueList',
    method: 'get',
    params
  })
}

export const bigdataList = (params) => {
  return request({
    url: api + '/visual/data/list',
    method: 'get',
    params
  })
}

export const adjustOrder = (data) => {
  return request({
    url: api + '/visual/data/adjustOrder?ids=' + data,
    method: 'post',
    data
  })
}

export const chartPreview = (data) => {
  return request({
    url: api + '/visual/component/preview',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export const chartDetailPreview = (data) => {
  return request({
    url: api + '/visual/component/detailPreview',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export const bigdataSave = (data) => {
  return request({
    url: api + '/visual/data/submit',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export const bigdataDetail = (params) => {
  return request({
    url: api + '/visual/data/detail',
    method: 'get',
    params
  })
}

export const chartDetail = (params) => {
  return request({
    url: api + '/visual/component/detail',
    method: 'get',
    params
  })
}

export const bigdataDel = (params) => {
  return request.post(
    api + '/visual/data/delete',
    {},
    {
      params
    }
  )
}

export const chartGetData = (params) => {
  return request.post(
    api + '/visual/component/queryData',
    {},
    {
      params
    }
  )
}

export const chartDel = (params) => {
  return request.post(
    api + '/visual/component/delete',
    {},
    {
      params
    }
  )
}

export const bigdataCopy = (params) => {
  return request.post(
    api + '/visual/data/copy',
    {},
    {
      params
    }
  )
}

export const bigdataUpdate = (data) => {
  return request({
    url: api + '/visual/data/update',
    method: 'post',
    data
  })
}

export const folderList = (params) => {
  return request({
    url: api + '/visual/reportfolder/list',
    method: 'get',
    params
  })
}

export const folderSave = (data) => {
  return request({
    url: api + '/visual/reportfolder/submit',
    method: 'post',
    data
  })
}

export const folderDel = (params) => {
  return request.post(
    api + '/visual/reportfolder/remove',
    {},
    {
      params
    }
  )
}

export const reportCopySave = (data) => {
  return request({
    url: api + '/visual/reportinfo/copySave',
    method: 'post',
    data
  })
}

export const reportList = (params) => {
  return request({
    url: api + '/visual/reportinfo/list',
    method: 'get',
    params
  })
}

export const reportSaveSimple = (data) => {
  return request({
    url: api + '/visual/reportinfo/update',
    method: 'post',
    data
  })
}

export const reportDel = (params) => {
  return request.post(
    api + '/visual/reportinfo/remove',
    {},
    {
      params
    }
  )
}

export const reportDetail = (params) => {
  return request({
    url: api + '/visual/reportinfo/detail',
    method: 'get',
    params
  })
}

export const enumCheck = (params) => {
  return request({
    url: api + '/visual/dynamicData/checkTableUseEnum',
    method: 'get',
    params
  })
}
