api.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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(
  74. "/ventanaly-device/safety/ventanalyMonitorData/listdays",
  75. params
  76. );
  77. return http.get(url);
  78. },
  79. //获取操作历史
  80. getOpreateHistory(params) {
  81. // const urlParams = new URLSearchParams(params);
  82. // const url =
  83. // "/ventanaly-device/safety/ventanalyDevicesetLog/list?" +
  84. // urlParams.toString();
  85. const url = buildURL(
  86. "/ventanaly-device/safety/ventanalyDevicesetLog/list",
  87. params
  88. );
  89. return http.get(url);
  90. },
  91. //获取文件数据
  92. getFileInfo(params) {
  93. return http.post("/ventanaly-sharefile/fileServer/list", params);
  94. },
  95. //获取预警信息
  96. getWarnInfo(params) {
  97. return http.get("/safety/ventanalyAlarmLog/total", params);
  98. },
  99. getFilePreview(params) {
  100. return http.post("/ventanaly-sharefile/fileServer/preview", params);
  101. },
  102. // 下载文件
  103. downloadFile(params) {
  104. return http.post("/ventanaly-sharefile/fileServer/download", params);
  105. },
  106. // 删除文件
  107. delateFile(params) {
  108. const url = buildURL("/ventanaly-sharefile/fileServer/delete", params);
  109. return http.delete(url);
  110. },
  111. //提交文件
  112. commitFile(params) {
  113. const url = buildURL("/safety/actBusiness/commit", params);
  114. return http.post(url);
  115. },
  116. // 撤回文件
  117. cancelFile(params) {
  118. const url = buildURL("/safety/actBusiness/cancelNew", params);
  119. return http.post(url);
  120. },
  121. // 审批流程
  122. getListFile(params) {
  123. const url = buildURL("/activiti/activiti_process/listData", params);
  124. return http.get(url);
  125. },
  126. //审批进度
  127. gethistoricFlowNew(params) {
  128. const url = buildURL("/safety/actTask/historicFlowNew", params);
  129. return http.get(url);
  130. },
  131. //审批进度图
  132. getHighlightImgNew(params) {
  133. const url = buildURL("/activiti/models/getHighlightImgNew", params);
  134. return http.get(url);
  135. },
  136. /**
  137. * 获取文件访问路径
  138. * @param avatar
  139. * @param subStr
  140. * @returns {*}
  141. */
  142. getFileAccessHttpUrl(avatar, subStr) {
  143. if (!subStr) subStr = "http";
  144. if (avatar && avatar.startsWith(subStr)) {
  145. return avatar;
  146. } else {
  147. return configService.staticDomainURL + "/" + avatar;
  148. }
  149. },
  150. };
  151. export default apiService;