api.js 7.3 KB

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