import request from '@/utils/request'

export function uploadOrderValueFiles(data) {
  return request({
    url: '/api/import/import-data/upload',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data',
      repeatSubmit: false
    },
    timeout: 300000
  })
}

export function getOrderMaxDate() {
  return request({
    url: '/api/analysis/max-date',
    method: 'get'
  })
}

export function getOrderGmv(params) {
  return request({
    url: '/api/analysis/gmv',
    method: 'get',
    params
  })
}

export function getOrderRBig(params) {
  return request({
    url: '/api/analysis/r-big',
    method: 'get',
    params
  })
}

export function getOrderTop5Percentage(params) {
  return request({
    url: '/api/analysis/top5-percentage',
    method: 'get',
    params
  })
}

export function getOrderAveragePaymentTime(params) {
  return request({
    url: '/api/analysis/average-payment-time',
    method: 'get',
    params
  })
}

export function getOrderTop5Products(params) {
  return request({
    url: '/api/analysis/top5-products',
    method: 'get',
    params
  })
}

export function getOrderLeakageRate(params) {
  return request({
    url: '/api/analysis/leakage-rate',
    method: 'get',
    params
  })
}

export function getOrderPaymentDecisionFunnel(params) {
  return request({
    url: '/api/analysis/payment-decision-funnel',
    method: 'get',
    params
  })
}

export function getOrderCoPurchase(params) {
  return request({
    url: '/api/analysis/co-purchase',
    method: 'get',
    params
  })
}

export function uploadShopValueFiles(data) {
  return request({
    url: '/api/shop/import/import-sales-data/upload',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data',
      repeatSubmit: false
    },
    timeout: 300000
  })
}

export function getShopMaxDate() {
  return request({
    url: '/api/shop/import/max-date',
    method: 'get'
  })
}

export function getShopTopProductContribution(params) {
  return request({
    url: '/api/shop/import/top-product-contribution',
    method: 'get',
    params
  })
}

export function getShopUnitContribution(params) {
  return request({
    url: '/api/shop/import/unit-contribution',
    method: 'get',
    params
  })
}

export function getShopChannelTotalContribution(params) {
  return request({
    url: '/api/shop/import/channel-total-contribution',
    method: 'get',
    params
  })
}

export function getShopChannelContribution(params) {
  return request({
    url: '/api/shop/import/channel-contribution',
    method: 'get',
    params
  })
}

export function getShopChannelRoiValue(params) {
  return request({
    url: '/api/shop/import/channel-roi-value',
    method: 'get',
    params
  })
}

export function getShopCrossSellingProducts(params) {
  return request({
    url: '/api/shop/import/cross-selling-products',
    method: 'get',
    params
  })
}

export function getShopDepartmentEfficiency(params) {
  return request({
    url: '/api/shop/import/department-efficiency',
    method: 'get',
    params
  })
}

export function getShopChannelDiversity(params) {
  return request({
    url: '/api/shop/import/channel-diversity',
    method: 'get',
    params
  })
}

export function getShopOperationReport(params) {
  return request({
    url: '/api/shop/report/list',
    method: 'get',
    params
  })
}
