api.js 8.1 KB

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