dictionary.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2022-07-06 11:46:24
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2023-01-10 13:16:27
  6. * @FilePath: /KC-MiddlePlatform/src/service/dictionary.ts
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. import { request } from 'umi';
  10. //获取平台字典
  11. export type PlatformPubDirDataType = { code: string; value: string | number; dataVoList: { code: string; value: string | number; sort: number; defaultValue: number }[] }
  12. export const getPlatformDictionary = async (key?: string) => {
  13. return request<PlatformPubDirDataType[]>('/centerSys/sysdictdata/getDictData', {
  14. method: 'GET',
  15. params: { dictType: key },
  16. });
  17. };
  18. //获取指标相关字典
  19. export type IndicatorDictionaryDataType = {
  20. type:number;
  21. status:string;
  22. parentId:number;
  23. name:string;
  24. id:number;
  25. dictSort:number;
  26. code:string;
  27. children:IndicatorDictionaryDataType[]
  28. }
  29. export const getIndicatorDictionary = async () => {
  30. return request<IndicatorDictionaryDataType[]>('/centerSys/indicator/getDict', {
  31. method: 'GET',
  32. });
  33. };