import type { AxiosResponse } from 'axios'
import request from 'Plugins/axios'

export type DictData = Array<{
  color: string
  jsonObject: any
  label: string
  text: ''
  title: ''
  value: ''
}>
// 数据字典
export const apiDict = (data: { code: string }): AxiosResponseDataType<DictData> => request.get('/jeecgboot/shop/sys/dict', data)
// 分类字典
export const apiCategory = (data: { all?: boolean; code?: string }): AxiosResponseDataType<DictData> =>
  request.get('/jeecgboot/shop/sys/category', data)

// 等级信息列表
export const apiRanks = (): AxiosResponseDataType<DictData> => request.get('/jeecgboot/vendor/user/ranks')

// 获取中台产品分类
export const getProductCategoryApi = (data: any): AxiosResponseDataType<DictData> => request.get('/jeecgboot/api/centerCategory/loadAllTreeChildren', data)
// 获取行业分类
export const getIndustryCategoryApi = (data: any): AxiosResponseDataType<DictData> => request.get('/jeecgboot/sys/category/loadTreeRoot', data)
// 获取品牌分类
export const getBrandCategoryApi = (data: any): AxiosResponseDataType<DictData> => request.get('/jeecgboot/api/categoryUsa/loadAllTreeChildren', data)