http.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import request from './request'
  2. //登录
  3. export function wxLogin(params) {
  4. return new Promise((resolve, reject) => {
  5. request.post("/user/login", params).then(result => {
  6. resolve(result)
  7. }).catch(err => {
  8. reject(err)
  9. });
  10. })
  11. }
  12. //换电监控接口开始
  13. //换电信息
  14. export function swapInfo(params) {
  15. return request.post("/swap/swapInfo", params)
  16. }
  17. //已连接站控车辆列表
  18. export function CarOnline() {
  19. return request.post("/vehicle/online")
  20. }
  21. //修改车牌号
  22. export function EditPlate(params) {
  23. return request.post("/vehicle/editPlate", params)
  24. }
  25. //车辆上锁
  26. export function Updatelock(params) {
  27. return request.post("/vehicle/lock", params)
  28. }
  29. //车辆解锁
  30. export function Updateunlock(params) {
  31. return request.post("/vehicle/unlock", params)
  32. }
  33. //暂停恢复PLC
  34. export function EditSwapplc(data) {
  35. return request.post("/swap/plc", data)
  36. }
  37. //开始换电
  38. export function beginSwap(params) {
  39. return request.post("/swap/startSwap", params)
  40. }
  41. //设置选电模式(0自动、1手动)
  42. export function setMode(params) {
  43. return request.post("/swap/setMode", params)
  44. }
  45. //急停中止
  46. export function plcStop(params) {
  47. return request.post("/swap/plcStop", params)
  48. }
  49. //锁止屏蔽
  50. export function EditforbidLock(data) {
  51. return request.post("/vehicle/forbidLock", data)
  52. }
  53. //换电监控接口结束
  54. //故障告警
  55. export function alarmList(data) {
  56. return request.post("/alarm/list", data)
  57. }
  58. // 处理告警
  59. export function alarmDispose(data) {
  60. return request.post("/alarm/dispose", data)
  61. }
  62. //开始充电
  63. export function startCharge(params) {
  64. return request.post(`/discharge/startCharge?chargerId=${params.chargerId}&sn=${params.sn}`)
  65. }
  66. //断电
  67. export function stopCharge(params) {
  68. return request.post(`/discharge/stopCharge?chargerId=${params.chargerId}`)
  69. }
  70. // 获取充电机ID
  71. export function getChargeCode() {
  72. return request.get('/device/getChargeCode')
  73. }
  74. // 充电记录列表
  75. export function chargeList(data) {
  76. return request.post('/charge/list',data)
  77. }
  78. // 换电记录列表
  79. export function swapList(data) {
  80. return request.post('/swapRecord/list',data)
  81. }
  82. //获取用户信息
  83. export function getInfo(data) {
  84. return request.get('/user/info',data)
  85. }
  86. //车辆管理、基础数据
  87. export function vehicleList(data) {
  88. return request.post('/vehicle/list',data)
  89. }
  90. //删除车辆、基础数据
  91. export function delvehicle(data) {
  92. return request.post('/vehicle/del',data)
  93. }
  94. //添加车辆、基础数据
  95. export function addvehicle(data) {
  96. return request.post('/vehicle/save',data)
  97. }
  98. //编辑车辆、基础数据
  99. export function Editvehicle(data) {
  100. return request.post('/vehicle/edit',data)
  101. }
  102. //普通调仓
  103. export function RuleChangestorage(data) {
  104. return request.post('/device/exchangeBattery',data)
  105. }
  106. //消防调仓
  107. export function FireChangestorage(data) {
  108. return request.post('/device/fireProtection',data)
  109. }
  110. //消防告警
  111. export function getwarnList(data) {
  112. return request.post("/alarm/toDayAlarm", data)
  113. }
  114. // 处理告警
  115. export function getfireProtection(data) {
  116. return request.post("/device/fireProtection", data)
  117. }
  118. //首页数据概览
  119. export function getoverview() {
  120. return request.post("/statistics/overview")
  121. }
  122. //云端同步时间获取
  123. export function getSyncTime() {
  124. return request.post("/vehicle/getSyncTime")
  125. }
  126. //云端同步
  127. export function getSync() {
  128. return request.post("/vehicle/sync")
  129. }
  130. //侧边栏消防告警数量
  131. export function getToDayAlarm() {
  132. return request.post("/alarm/toDayAlarm")
  133. }
  134. //换电监控 车牌号刷新接口
  135. export function getRefresh() {
  136. return request.post("/vehicle/refresh")
  137. }
  138. //换电编号
  139. export function getStationCode() {
  140. return request.post("/swap/getStationCode")
  141. }
  142. //云端
  143. export function getcloudConnState() {
  144. return request.post("/swap/cloudConnState")
  145. }