index.uts 1020 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * 字典数据接口
  3. */
  4. import { request } from '../../utils/request'
  5. import type { DictDataResponse } from '../../types/dict'
  6. /**
  7. * 根据字典类型查询字典数据信息
  8. * @param dictType 字典类型
  9. */
  10. export const getDictDataByType = (dictType: string): Promise<DictDataResponse> => {
  11. return request<DictDataResponse>({
  12. url: `/system/dict/data/type/${dictType}`,
  13. method: 'GET'
  14. })
  15. }
  16. /**
  17. * 根据字典类型查询字典数据信息(返回AjaxResult格式)
  18. * @param dictType 字典类型
  19. */
  20. export const getDictDataByTypeAjax = (dictType: string): Promise<AjaxResult> => {
  21. return request<AjaxResult>({
  22. url: `/system/dict/data/type/${dictType}`,
  23. method: 'GET'
  24. })
  25. }
  26. /**
  27. * 根据字典类型查询字典数据列表
  28. * @param dictType 字典类型
  29. */
  30. export const getDictDataList = (dictType: string): Promise<SysDictData[]> => {
  31. return request<SysDictData[]>({
  32. url: `/system/dict/data/type/${dictType}`,
  33. method: 'GET'
  34. })
  35. }