api.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import { http } from "@/common/service/service.js";
  2. import configService from "@/common/service/config.service.js";
  3. import buildURL from "@/common/luch-request/helpers/buildURL.js"
  4. const apiService = {
  5. /**
  6. * 登录
  7. */
  8. login(params) {
  9. return http.post("/sys/mLogin", params);
  10. },
  11. /**
  12. * 手机号码登录
  13. */
  14. phoneNoLogin(params) {
  15. return http.post("/sys/phoneLogin", params);
  16. },
  17. /**
  18. * 退出
  19. */
  20. logout(params) {
  21. return http.post("/sys/logout", params);
  22. },
  23. // 按系统查询设备分类信息
  24. getDeviceType(params) {
  25. return http.get(
  26. "/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem",
  27. params
  28. );
  29. },
  30. // 查询各类设备的列表表头信息
  31. getShowColum(params) {
  32. return http.get("/safety/ventanalyShowColum/show_colum", params);
  33. },
  34. // 按系统查询设备监测信息
  35. getDeviceMonitor(params) {
  36. return http.post("/monitor/device", params);
  37. },
  38. //查询分页列表信息 通过分类查询 各类设备在app上是否展示的字段
  39. getShowColumList(params) {
  40. // const urlParams = new URLSearchParams(params);
  41. // const url = "/safety/ventanalyShowColum/list?" + urlParams.toString();
  42. const url = buildURL("/safety/ventanalyShowColum/list", params)
  43. return http.get(url);
  44. },
  45. //设备控制
  46. controlDevice(params) {
  47. return http.put(
  48. "/ventanaly-device/safety/ventanalyMonitorData/devicecontrol",
  49. params
  50. );
  51. },
  52. //根据设备id 查询该设备关联的视频流url
  53. getCameraById(params) {
  54. // const urlParams = new URLSearchParams(params);
  55. // const url = "/safety/ventanalyCamera/list?" + urlParams.toString();
  56. const url = buildURL("/safety/ventanalyCamera/list", params)
  57. return http.get(url);
  58. },
  59. //如果上面这个接口返回code码 则使用这个接口获取url
  60. getCameraByCode(params) {
  61. // const urlParams = new URLSearchParams(params);
  62. // const url =
  63. // "/ventanaly-device/camera/queryByCameraCode?" + urlParams.toString();
  64. const url = buildURL("/ventanaly-device/camera/queryByCameraCode", params)
  65. return http.get(url);
  66. },
  67. //获取设备历史数据
  68. getDeviceHistory(params) {
  69. // const urlParams = new URLSearchParams(params);
  70. // const url =
  71. // "/ventanaly-device/safety/ventanalyMonitorData/listdays?" +
  72. // urlParams.toString();
  73. const url = buildURL("/ventanaly-device/safety/ventanalyMonitorData/listdays", params)
  74. return http.get(url);
  75. },
  76. //获取操作历史
  77. getOpreateHistory(params) {
  78. // const urlParams = new URLSearchParams(params);
  79. // const url =
  80. // "/ventanaly-device/safety/ventanalyDevicesetLog/list?" +
  81. // urlParams.toString();
  82. const url = buildURL("/ventanaly-device/safety/ventanalyDevicesetLog/list", params)
  83. return http.get(url);
  84. },
  85. //获取文件数据
  86. getFileInfo(params){
  87. return http.post(
  88. "/ventanaly-sharefile/fileServer/list",
  89. params
  90. );
  91. },
  92. //获取预警信息
  93. getWarnInfo(params){
  94. return http.get(
  95. "/safety/ventanalyAlarmLog/total",
  96. params
  97. );
  98. },
  99. /**
  100. * 获取文件访问路径
  101. * @param avatar
  102. * @param subStr
  103. * @returns {*}
  104. */
  105. getFileAccessHttpUrl(avatar, subStr) {
  106. if (!subStr) subStr = "http";
  107. if (avatar && avatar.startsWith(subStr)) {
  108. return avatar;
  109. } else {
  110. return configService.staticDomainURL + "/" + avatar;
  111. }
  112. },
  113. };
  114. export default apiService;