api.js 6.1 KB

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