api.js 7.8 KB

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