environment.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. }