api.js 7.5 KB

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