environment.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /** 登录接口 POST /api/login/account */
  2. import { request } from 'umi';
  3. export async function getMapList(body: any, options?: { [key: string]: any }) {
  4. return request<API.MapInfoRes>('/api/duoduo-service/setup-service/map/queryMapInfo', {
  5. method: 'POST',
  6. headers: {
  7. 'Content-Type': 'application/json',
  8. },
  9. ...(options || {}),
  10. data: body,
  11. });
  12. }
  13. export async function getBuildingList(body: any, options?: { [key: string]: any }) {
  14. //debugger;
  15. return request<API.BuildFloorList>('/api/duoduo-service/object-service/object/building/query', {
  16. method: 'POST',
  17. headers: {
  18. 'Content-Type': 'application/json',
  19. },
  20. ...(options || {}),
  21. data: body,
  22. });
  23. }
  24. export async function getFloorList(body: any, options?: { [key: string]: any }) {
  25. // debugger;
  26. return request<API.BuildFloorList>('/api/duoduo-service/object-service/object/floor/query', {
  27. method: 'POST',
  28. headers: {
  29. 'Content-Type': 'application/json',
  30. },
  31. ...(options || {}),
  32. data: body,
  33. });
  34. }
  35. export async function queryDeviceTimeManage(params: any, options?: { [key: string]: any }) {
  36. // '/api3/duoduo-service/setup-service/deviceManage/queryDeviceTimeManage'
  37. return request<API.DeviceTimeType>(
  38. '/api/duoduo-service/setup-service/deviceManage/queryDeviceTimeManage',
  39. {
  40. method: 'GET',
  41. params: {
  42. ...params,
  43. },
  44. ...(options || {}),
  45. },
  46. );
  47. }
  48. function commonParams() {
  49. return `openid=9a1ecfbacb6b4f249bf2dd3ec7793ead&pubname=sagacareAndtenantslink&projectId=Pj1101080259&userName=%E5%AE%89%E5%B0%8F%E9%9C%9E&userPhone=17611228068&userId=9a1ecfbacb6b4f249bf2dd3ec7793ead`;
  50. }
  51. // chart
  52. export async function queryPropertyData(params: any, options?: { [key: string]: any }) {
  53. return request<API.DeviceTimeType>(
  54. `/api/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData?${commonParams()}`,
  55. {
  56. method: 'GET',
  57. params: params,
  58. ...(options || {}),
  59. },
  60. );
  61. }
  62. export async function queryEnvironmentParam(body: any, otherParam: { [key: string]: any }) {
  63. //api/duoduo-service/object-service/object/floor/queryParam
  64. return request<API.EnvironmentParam>(
  65. `/api/duoduo-service/object-service/object/floor/queryParam?endTime=${otherParam.endTime}&startTime=${otherParam.startTime}&param=${otherParam.param}`,
  66. {
  67. method: 'POST',
  68. headers: {
  69. 'Content-Type': 'application/json',
  70. },
  71. data: body,
  72. },
  73. );
  74. }
  75. export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) {
  76. //
  77. return request<API.EnvironmentParam>(
  78. `/api/duoduo-service/object-service/object/equipment/queryEquipStatistics`,
  79. {
  80. method: 'GET',
  81. headers: {
  82. 'Content-Type': 'application/json',
  83. },
  84. ...(options || {}),
  85. params: {
  86. ...params,
  87. },
  88. },
  89. );
  90. }
  91. export async function querySpace(body: any, options?: { [key: string]: any }) {
  92. //
  93. return request<API.EnvironmentParam>(`/api/duoduo-service/object-service/object/space/query`, {
  94. method: 'POST',
  95. headers: {
  96. 'Content-Type': 'application/json',
  97. },
  98. ...(options || {}),
  99. data: body,
  100. });
  101. }