api.js 7.5 KB

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