|
|
|
@ -3,19 +3,15 @@ import { storeToRefs } from 'pinia' |
|
|
|
import { getStatistics } from '@/http/api/statistics' |
|
|
|
import type { Query, TagType } from '@/http/api/statistics/types' |
|
|
|
|
|
|
|
/** |
|
|
|
* @description 店铺编码: tag=navigation或shop或brandSearch或时必传 |
|
|
|
* @description industryCode: tag=industry时必传 |
|
|
|
* @param tag 统计类型为以下几种: 'navigation' | 'shop' | 'brandSearch' | 'device' | 'program' | 'industry' |
|
|
|
* @param shopCode 店铺唯一编码 |
|
|
|
* @param industryCode 业态唯一编码 |
|
|
|
*/ |
|
|
|
export const useStatistics = ({ tag, shopCode, industryCode = '' }: { tag: TagType; shopCode: string | number; industryCode?: string }) => { |
|
|
|
type Params = { tag: TagType; shopCode?: string | number; industryCode?: string } |
|
|
|
//店铺编码: tag=navigation或shop或brandSearch或时必传
|
|
|
|
//industryCode : tag=industry时必传
|
|
|
|
export const useStatistics = ({ tag, shopCode, industryCode = '' }: Params) => { |
|
|
|
const store = useRootStore() |
|
|
|
const { device } = storeToRefs(store) |
|
|
|
|
|
|
|
const params: Query = { |
|
|
|
deviceCode: device.value.deviceCode, |
|
|
|
deviceCode: device.value.machineCode, |
|
|
|
projectCode: device.value.projectCode, |
|
|
|
tag, |
|
|
|
shopCode, |
|
|
|
|