api.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. validateCasLogin(params) {
  15. return http.get("/sys/cas/client/validateLogin", params);
  16. },
  17. /**
  18. * 手机号码登录
  19. */
  20. phoneNoLogin(params) {
  21. return http.post("/sys/phoneLogin", params);
  22. },
  23. /**
  24. * 退出
  25. */
  26. logout(params) {
  27. return http.post("/sys/logout", params);
  28. },
  29. // 按系统查询设备分类信息
  30. getDeviceType(params) {
  31. return http.get(
  32. "/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem",
  33. params
  34. );
  35. },
  36. // 查询各类设备的列表表头信息
  37. getShowColum(params) {
  38. return http.get("/safety/ventanalyShowColum/show_colum", params);
  39. },
  40. // 按系统查询设备监测信息
  41. getDeviceMonitor(params) {
  42. return http.post("/monitor/device", params);
  43. },
  44. //查询分页列表信息 通过分类查询 各类设备在app上是否展示的字段
  45. getShowColumList(params) {
  46. // const urlParams = new URLSearchParams(params);
  47. // const url = "/safety/ventanalyShowColum/list?" + urlParams.toString();
  48. const url = buildURL("/safety/ventanalyShowColum/list", params);
  49. return http.get(url);
  50. },
  51. //设备控制
  52. controlDevice(params) {
  53. return http.put(
  54. "/ventanaly-device/safety/ventanalyMonitorData/devicecontrol",
  55. params
  56. );
  57. },
  58. //根据设备id 查询该设备关联的视频流url
  59. getCameraById(params) {
  60. // const urlParams = new URLSearchParams(params);
  61. // const url = "/safety/ventanalyCamera/list?" + urlParams.toString();
  62. const url = buildURL("/safety/ventanalyCamera/list", params);
  63. return http.get(url);
  64. },
  65. //如果上面这个接口返回code码 则使用这个接口获取url
  66. getCameraByCode(params) {
  67. // const urlParams = new URLSearchParams(params);
  68. // const url =
  69. // "/ventanaly-device/camera/queryByCameraCode?" + urlParams.toString();
  70. const url = buildURL("/ventanaly-device/camera/queryByCameraCode", params);
  71. return http.get(url);
  72. },
  73. //瓦斯上报列表数据
  74. getGas(params) {
  75. const url = buildURL(
  76. "/safety/gasDayReport/list",
  77. params
  78. );
  79. return http.get(url);
  80. },
  81. //瓦斯上报-下拉选项
  82. getSelect(params) {
  83. const url = buildURL(
  84. "/safety/gasDayReport/getGasAddressList",
  85. params
  86. );
  87. return http.get(url);
  88. },
  89. //瓦斯上报-新增保存
  90. getAdd(params) {
  91. return http.post("/safety/gasDayReport/add", params);
  92. },
  93. //瓦斯上报-编辑保存
  94. getEdit(params) {
  95. return http.post("/safety/gasDayReport/edit", params);
  96. },
  97. //瓦斯上报-删除
  98. delGas(params) {
  99. const url = buildURL("/safety/gasDayReport/delete", params);
  100. return http.delete(url);
  101. },
  102. //获取设备历史数据
  103. getDeviceHistory(params) {
  104. const url = buildURL(
  105. "/ventanaly-device/safety/ventanalyMonitorData/listdays",
  106. params
  107. );
  108. return http.get(url);
  109. },
  110. //获取操作历史
  111. getOpreateHistory(params) {
  112. const url = buildURL(
  113. "/ventanaly-device/safety/ventanalyDevicesetLog/list",
  114. params
  115. );
  116. return http.get(url);
  117. },
  118. //获取文件数据
  119. getFileInfo(params) {
  120. return http.post("/ventanaly-sharefile/fileServer/list", params);
  121. },
  122. //获取预警信息
  123. getWarnInfo(params) {
  124. return http.get("/safety/ventanalyAlarmLog/total", params);
  125. },
  126. //获取通风预警监测详情tab信息
  127. sysTypeWarn(params) {
  128. return http.post("/ventanaly-device/safety/ventanalyAlarmLog/sysTypeWarn", params);
  129. },
  130. //获取通风预警监测详情信息
  131. sysWarn(params) {
  132. return http.post("/ventanaly-device/safety/ventanalyAlarmLog/sysWarn", params);
  133. },
  134. //获取通风预警监测详情信息
  135. getDeviceVent(params) {
  136. return http.post("/ventanaly-device/monitor/device", params);
  137. },
  138. //获取设备预警实时监测数据
  139. warningList(params) {
  140. const url = buildURL("/safety/ventanalyAlarmLog/now_alarmlist", params);
  141. return http.get(url);
  142. },
  143. //获取设备预警历史监测数据
  144. historyList(params) {
  145. const url = buildURL("/safety/ventanalyAlarmLog/list", params);
  146. return http.get(url);
  147. },
  148. getFilePreview(params) {
  149. return http.post("/ventanaly-sharefile/fileServer/preview", params);
  150. },
  151. // 下载文件
  152. downloadFile(params) {
  153. return http.post("/ventanaly-sharefile/fileServer/download", params);
  154. },
  155. // 删除文件
  156. delateFile(params) {
  157. const url = buildURL("/ventanaly-sharefile/fileServer/delete", params);
  158. return http.delete(url);
  159. },
  160. //提交文件
  161. commitFile(params) {
  162. const url = buildURL("/safety/actBusiness/commit", params);
  163. return http.post(url);
  164. },
  165. // 撤回文件
  166. cancelFile(params) {
  167. const url = buildURL("/safety/actBusiness/cancelNew", params);
  168. return http.post(url);
  169. },
  170. // 审批流程
  171. getListFile(params) {
  172. const url = buildURL("/activiti/activiti_process/listData", params);
  173. return http.get(url);
  174. },
  175. //审批进度
  176. gethistoricFlowNew(params) {
  177. const url = buildURL("/safety/actTask/historicFlowNew", params);
  178. return http.get(url);
  179. },
  180. //审批进度图
  181. getHighlightImgNew(params) {
  182. const url = buildURL("/activiti/models/getHighlightImgNew", params);
  183. return http.get(url);
  184. },
  185. /**
  186. * 获取文件访问路径
  187. * @param avatar
  188. * @param subStr
  189. * @returns {*}
  190. */
  191. getFileAccessHttpUrl(avatar, subStr) {
  192. if (!subStr) subStr = "http";
  193. if (avatar && avatar.startsWith(subStr)) {
  194. return avatar;
  195. } else {
  196. return configService.staticDomainURL + "/" + avatar;
  197. }
  198. },
  199. };
  200. export default apiService;