http.api.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import {apiurl} from "./apiurl.js"
  2. // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
  3. // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
  4. const install = (Vue, vm) => {
  5. // 登录
  6. let getLogin = (params = {}) => vm.$u.post(apiurl.loginUrl, params);
  7. let getParkingRecord = (params = {}) => vm.$u.get(apiurl.getParkingRecordUrl,params);
  8. let getDeviceStatis = (params = {}) => vm.$u.get(apiurl.getDeviceStatisUrl,params);
  9. let getDeviceTypeList = (params = {}) => vm.$u.get(apiurl.getDeviceTypeListUrl,params);
  10. let updatePwd = (params = {}) => vm.$u.put(apiurl.updatePwdUrl,params);
  11. let getLoginOut = (params = {}) => vm.$u.get(apiurl.getLoginOutUrl,params);
  12. let getRoadAllList = (params = {}) => vm.$u.get(apiurl.getRoadAllListUrl,params);
  13. let report = (params = {}) => vm.$u.post(apiurl.reportUrl, params);
  14. let selectOtherExcptionList = (params = {}) => vm.$u.get(apiurl.selectOtherExcptionList,params);
  15. let reportDetail = (params = {}) => vm.$u.get(apiurl.reportDetail,params);
  16. let emergencyReportList = (params = {}) => vm.$u.get(apiurl.emergencyReportList,params);
  17. let reportEmergency = (params = {}) => vm.$u.post(apiurl.reportEmergency, params);
  18. let payeeReportList = (params = {}) => vm.$u.get(apiurl.payeeReportList,params);
  19. let payeeReportDetail = (params = {}) => vm.$u.get(apiurl.payeeReportDetail,params);
  20. let payeeReport = (params = {}) => vm.$u.post(apiurl.payeeReport, params);
  21. let payeeExceptionType = (params = {}) => vm.$u.get(apiurl.payeeExceptionType,params);
  22. let punchInfo = (params = {}) => vm.$u.get(apiurl.punchInfoUrl+params.roadNo);
  23. let punchIn = (params = {}) => vm.$u.post(apiurl.punchInUrl, params);
  24. let getDeviceList = (params = {}) => vm.$u.get(apiurl.getDeviceListUrl,params);
  25. let getRoadList = (params = {}) => vm.$u.get(apiurl.getRoadListUrl,params);
  26. let getSelectDeviceList = (params = {}) => vm.$u.get(apiurl.getSelectDeviceListUrl,params);
  27. let geoDeviceStatust = (params = {}) => vm.$u.get(apiurl.geoDeviceStatustUrl,params);
  28. let lockDeviceStatust = (params = {}) => vm.$u.get(apiurl.lockDeviceStatustUrl,params);
  29. let findRoadSpaceVoById = (params = {}) => vm.$u.get(apiurl.findRoadSpaceVoByIdUrl,params);
  30. let deviceLog = (params = {}) => vm.$u.get(apiurl.deviceLogUrl,params);
  31. let deviceexcptionprocess = (params = {}) => vm.$u.post(apiurl.deviceexcptionprocessUrl, params);
  32. let editDeviceexcptionprocess = (params = {}) => vm.$u.put(apiurl.deviceexcptionprocessUrl, params);
  33. let getReportList = (params = {}) => vm.$u.get(apiurl.deviceexcptionprocessUrl, params);
  34. let placeStatus = (params = {}) => vm.$u.get(apiurl.placeStatusUrl,params);
  35. let selectParkDeviceList = (params = {}) => vm.$u.get(apiurl.selectParkDeviceListUrl,params);
  36. let selectParkVehicleList = (params = {}) => vm.$u.get(apiurl.selectParkVehicleList,params);
  37. let selectParkNum = (params = {}) => vm.$u.get(apiurl.selectParkNumUrl,params);
  38. let findParkDeviceById = (params = {}) => vm.$u.get(apiurl.findParkDeviceByIdUrl,params);
  39. let controlDevice = (params = {}) => vm.$u.post(apiurl.controlDeviceUrl, params);
  40. let inspecmsg = (params = {}) => vm.$u.get(apiurl.inspecmsgUrl,params);
  41. let inspecmsgDetails = (params = {}) => vm.$u.get(apiurl.inspecmsgDetailsUrl,params);
  42. let updateInspecMsgStatus = (params = {}) => vm.$u.put(apiurl.updateInspecMsgStatusUrl,params);
  43. let getUnreadMsgTotal = (params = {}) => vm.$u.get(apiurl.getUnreadMsgTotalUrl,params);
  44. let deviceLockStatus = (params = {}) => vm.$u.get(apiurl.deviceLockStatusUrl,params);
  45. let payeeList = (params = {}) => vm.$u.get(apiurl.payeeList,params);
  46. let processDevice = (params = {}) => vm.$u.get(apiurl.processDevice,params);
  47. let processDeviceGeo = (params = {}) => vm.$u.get(apiurl.processDeviceGeo,params);
  48. let processDeviceLock = (params = {}) => vm.$u.get(apiurl.processDeviceLock,params);
  49. let processDeviceRoom = (params = {}) => vm.$u.get(apiurl.processDeviceRoom,params);
  50. let damageType = (params = {}) => vm.$u.get(apiurl.damageType,params);
  51. let processType = (params = {}) => vm.$u.get(apiurl.processType,params);
  52. let excptionById = (params = {}) => vm.$u.get(apiurl.excptionById,params);
  53. // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
  54. vm.$u.api = {
  55. getLogin,
  56. getParkingRecord,
  57. getDeviceStatis,
  58. getDeviceTypeList,
  59. updatePwd,
  60. getLoginOut,
  61. getRoadAllList,
  62. report,
  63. selectOtherExcptionList,
  64. reportDetail,
  65. emergencyReportList,
  66. reportEmergency,
  67. payeeReport,
  68. payeeReportDetail,
  69. payeeReportList,
  70. payeeExceptionType,
  71. punchInfo,
  72. punchIn,
  73. getDeviceList,
  74. getRoadList,
  75. getSelectDeviceList,
  76. geoDeviceStatust,
  77. lockDeviceStatust,
  78. findRoadSpaceVoById,
  79. deviceLog,
  80. deviceexcptionprocess,
  81. editDeviceexcptionprocess,
  82. getReportList,
  83. placeStatus,
  84. selectParkDeviceList,
  85. selectParkVehicleList,
  86. selectParkNum,
  87. findParkDeviceById,
  88. controlDevice,
  89. inspecmsg,
  90. inspecmsgDetails,
  91. updateInspecMsgStatus,
  92. getUnreadMsgTotal,
  93. deviceLockStatus,
  94. payeeList,
  95. processDevice,
  96. processDeviceGeo,
  97. processDeviceLock,
  98. processDeviceRoom,
  99. damageType,
  100. processType,
  101. excptionById,
  102. };
  103. }
  104. export default {
  105. install
  106. }