import { request } from '/@/utils/service'
import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud'
import emitter from '/@/utils/emitter'


export const apiPrefix = '/api/sellers/product/trend/daily/'
export function getCardData(query: UserPageQuery) {
  return request({
    url: '/api/sellers/product/trend/total/',
    method: 'GET',
    params: query,
  })
}
export function getLineData(query: UserPageQuery) {
  query['dateRangeType'] = 'D'
  return request({
    url: apiPrefix,
    method: 'GET',
    params: query,
  })
}
export function getLineWeekData(query: UserPageQuery) {
  query['dateRangeType'] = 'W'
  return request({
    url: apiPrefix,
    method: 'GET',
    params: query,
  })
}

export function getLineMonthData(query: UserPageQuery) {
  query['dateRangeType'] = 'M'
  return request({
    url: apiPrefix,
    method: 'GET',
    params: query,
  })
}

export function getProductLineSelect(query) {
  return request({
    url: '/api/sellers/productline/',
    method: 'GET',
    params: query,
  })
}
export function getProduct(query) {
  return request({
    url: '/api/sellers/product/',
    method: 'GET',
    params: query,
  })
}
export function getDetail(query) {
  return request({
    url: '/api/sellers/product/trend/detail/',
    method: 'GET',
    params: query,
  })
}
export function getListData(query) {
  return request({
    url: '/api/sellers/product/trend/daily/',
    method: 'GET',
    params: query,
  })
}
export function getSalesListData(query) {
  return request({
    url: '/api/sellers/product/sales/',
    method: 'GET',
    params: query,
  })
}
