api.js 7.1 KB

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