environment.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/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>('/api2/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>('/api2/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. '/api4/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>(`/server/spaceAdjust/queryPropertyData?${commonParams()}`, {
  54. method: 'GET',
  55. params: params,
  56. ...(options || {}),
  57. });
  58. }
  59. export async function queryEnvironmentParam(body: any, otherParam: { [key: string]: any }) {
  60. //api2/duoduo-service/object-service/object/floor/queryParam
  61. return request<API.EnvironmentParam>(
  62. `/api2/object/floor/queryParam?endTime=${otherParam.endTime}&startTime=${otherParam.startTime}&param=${otherParam.param}`,
  63. {
  64. method: 'POST',
  65. headers: {
  66. 'Content-Type': 'application/json',
  67. },
  68. data: body,
  69. },
  70. );
  71. }
  72. export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) {
  73. //
  74. return request<API.EnvironmentParam>(
  75. `/duoduo-service/object-service/object/equipment/queryEquipStatistics`,
  76. {
  77. method: 'GET',
  78. headers: {
  79. 'Content-Type': 'application/json',
  80. },
  81. ...(options || {}),
  82. params: {
  83. ...params,
  84. },
  85. },
  86. );
  87. }
  88. export async function querySpace(body: any, options?: { [key: string]: any }) {
  89. //
  90. return request<API.EnvironmentParam>(`/api2/object/space/query`, {
  91. method: 'POST',
  92. headers: {
  93. 'Content-Type': 'application/json',
  94. },
  95. ...(options || {}),
  96. data: body,
  97. });
  98. }