api.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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. 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(
  82. "/sys/api/getDictItems",
  83. params
  84. );
  85. return http.get(url);
  86. },
  87. // 按系统查询设备监测信息
  88. getDeviceMonitor(params) {
  89. return http.post("/monitor/device", params);
  90. },
  91. //查询分页列表信息 通过分类查询 各类设备在app上是否展示的字段
  92. getShowColumList(params) {
  93. // const urlParams = new URLSearchParams(params);
  94. // const url = "/safety/ventanalyShowColum/list?" + urlParams.toString();
  95. const url = buildURL("/safety/ventanalyShowColum/list", params);
  96. return http.get(url);
  97. },
  98. //设备控制
  99. controlDevice(params) {
  100. return http.put(
  101. "/ventanaly-device/safety/ventanalyMonitorData/devicecontrol",
  102. params
  103. );
  104. },
  105. //根据设备id 查询该设备关联的视频流url
  106. getCameraById(params) {
  107. // const urlParams = new URLSearchParams(params);
  108. // const url = "/safety/ventanalyCamera/list?" + urlParams.toString();
  109. const url = buildURL("/safety/ventanalyCamera/list", params);
  110. return http.get(url);
  111. },
  112. //如果上面这个接口返回code码 则使用这个接口获取url
  113. getCameraByCode(params) {
  114. // const urlParams = new URLSearchParams(params);
  115. // const url =
  116. // "/ventanaly-device/camera/queryByCameraCode?" + urlParams.toString();
  117. const url = buildURL("/ventanaly-device/camera/queryByCameraCode", params);
  118. return http.get(url);
  119. },
  120. //瓦斯日报列表数据
  121. getGas(params) {
  122. const url = buildURL(
  123. "/safety/gasDayReport/list",
  124. params
  125. );
  126. return http.get(url);
  127. },
  128. //瓦斯日报-下拉选项
  129. getSelect(params) {
  130. const url = buildURL(
  131. "/safety/gasDayReport/getGasAddressList",
  132. params
  133. );
  134. return http.get(url);
  135. },
  136. //瓦斯日报-新增保存
  137. getAdd(params) {
  138. return http.post("/safety/gasDayReport/add", params);
  139. },
  140. //瓦斯日报-编辑保存
  141. getEdit(params) {
  142. return http.post("/safety/gasDayReport/edit", params);
  143. },
  144. //瓦斯日报-删除
  145. delGas(params) {
  146. const url = buildURL("/safety/gasDayReport/delete", params);
  147. return http.delete(url);
  148. },
  149. //获取设备历史数据
  150. getDeviceHistory(params) {
  151. const url = buildURL(
  152. "/ventanaly-device/safety/ventanalyMonitorData/listdays",
  153. params
  154. );
  155. return http.get(url);
  156. },
  157. //获取操作历史
  158. getOpreateHistory(params) {
  159. const url = buildURL(
  160. "/ventanaly-device/safety/ventanalyDevicesetLog/list",
  161. params
  162. );
  163. return http.get(url);
  164. },
  165. //获取文件数据
  166. getFileInfo(params) {
  167. return http.post("/ventanaly-sharefile/fileServer/list", params);
  168. },
  169. //获取预警信息
  170. getWarnInfo(params) {
  171. return http.get("/safety/ventanalyAlarmLog/total", params);
  172. },
  173. //获取通风预警监测详情tab信息
  174. sysTypeWarn(params) {
  175. return http.post("/ventanaly-device/safety/ventanalyAlarmLog/sysTypeWarn", params);
  176. },
  177. //获取通风预警监测详情信息
  178. sysWarn(params) {
  179. return http.post("/ventanaly-device/safety/ventanalyAlarmLog/sysWarn", params);
  180. },
  181. //获取通风预警监测详情信息
  182. getDeviceVent(params) {
  183. return http.post("/ventanaly-device/monitor/device", params);
  184. },
  185. //获取设备预警实时监测数据
  186. warningList(params) {
  187. const url = buildURL("/safety/ventanalyAlarmLog/now_alarmlist", params);
  188. return http.get(url);
  189. },
  190. //获取设备预警历史监测数据
  191. historyList(params) {
  192. const url = buildURL("/safety/ventanalyAlarmLog/list", params);
  193. return http.get(url);
  194. },
  195. getFilePreview(params) {
  196. return http.post("/ventanaly-sharefile/fileServer/preview", params);
  197. },
  198. // 下载文件
  199. downloadFile(params) {
  200. return http.post("/ventanaly-sharefile/fileServer/download", params);
  201. },
  202. // 删除文件
  203. delateFile(params) {
  204. const url = buildURL("/ventanaly-sharefile/fileServer/delete", params);
  205. return http.delete(url);
  206. },
  207. //提交文件
  208. commitFile(params) {
  209. const url = buildURL("/safety/actBusiness/commit", params);
  210. return http.post(url);
  211. },
  212. // 撤回文件
  213. cancelFile(params) {
  214. const url = buildURL("/safety/actBusiness/cancelNew", params);
  215. return http.post(url);
  216. },
  217. // 审批流程
  218. getListFile(params) {
  219. const url = buildURL("/activiti/activiti_process/listData", params);
  220. return http.get(url);
  221. },
  222. //审批进度
  223. gethistoricFlowNew(params) {
  224. const url = buildURL("/safety/actTask/historicFlowNew", params);
  225. return http.get(url);
  226. },
  227. //通过id(巡检卡id)查询
  228. getCardList(params) {
  229. const url = buildURL("/safety/gasInsCard/queryByIdApp", params);
  230. return http.get(url);
  231. },
  232. //nfc卡ID校验
  233. enterCardId(params) {
  234. const url = buildURL("/safety/gasInsCard/enterCardId", params);
  235. return http.get(url);
  236. },
  237. // 获取瓦斯巡检任务统计情况
  238. queryNowGasInfoByUser(params) {
  239. const url = buildURL("/safety/gasInsCard/queryNowGasInfoByUser", params);
  240. return http.post(url);
  241. },
  242. //审批进度
  243. gethistoricFlowNew(params) {
  244. const url = buildURL("/safety/actTask/historicFlowNew", params);
  245. return http.get(url);
  246. },
  247. /**
  248. * 获取文件访问路径
  249. * @param avatar
  250. * @param subStr
  251. * @returns {*}
  252. */
  253. getFileAccessHttpUrl(avatar, subStr) {
  254. if (!subStr) subStr = "http";
  255. if (avatar && avatar.startsWith(subStr)) {
  256. return avatar;
  257. } else {
  258. return configService.staticDomainURL + "/" + avatar;
  259. }
  260. },
  261. };
  262. export default apiService;