api.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. import {http} from './service.js'
  2. //文件上传
  3. const uploadFile={
  4. submit:p => http.upload('/upload/putfile', {name:'file',filePath:p}),
  5. }
  6. //短信api
  7. const SMSApi = {
  8. sendSms:p => http.post('huawei/sms/sendSms'+p),
  9. validCode:p => http.post('huawei/sms/validCode'+p),
  10. }
  11. //字典
  12. const dict=p => http.get('/blade-system/dict-biz/dictionary',{params:p})
  13. //微信基本参数
  14. let wxData={
  15. //国信的
  16. // appId:'wx988577c5a9061283',
  17. // secret:'5013c82bf72e6266dfb2720757433e74',
  18. //园区的
  19. appId:'wxcfb2b48079ca59e4',
  20. secret:'30f9cf566aa57892e55aee0406356b9e',
  21. subscribe_grant_type:'client_credential', //订阅消息的grant_type
  22. }
  23. //微信api
  24. const wxApi = {
  25. subscribe:p => http.post('/wx/msgSend', p),
  26. getAccessToken:p => http.get('/wx/getAccessToken', {params:p}),
  27. getOpenId:p => http.get('/wx/getOpenId', {params:p}),
  28. //获取小程序的audit状态
  29. getAppletStatus:p => http.get('appconf/appconf/getById', {params:p}),
  30. }
  31. //登录
  32. const login=p => http.post('community/enterprisestaff/app/login', p)
  33. //修改密码
  34. const updatePassword=p => http.post('community/enterprisestaff/app/updatePassword'+p)
  35. //获取管理员的openid集合
  36. const getManagerOpenList=p => http.get('/community/enterprisestaff/app/getManagerList',{params:p})
  37. //获取token
  38. const getToken=p => http.post('blade-auth/oauth/token'+p,{},{header: {"Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0"}})
  39. //园区api
  40. const agency = {
  41. getAgencyTenantList:p => http.get('agency/agency/getAgencyTenantList', {params:p}),
  42. page:p => http.get('/agency/agency/getAgencyList', {params:p}),
  43. submit:p => http.post('/agency/agency/submit', p),
  44. }
  45. //区域api
  46. const residential = {
  47. page:p => http.get('/community/residential/listByAgencyId', {params:p}),
  48. }
  49. //企业api
  50. const enterprise = {
  51. page:p => http.get('/enterprise/enterprise/list', {params:p}),
  52. detail:p => http.get('/enterprise/enterprise/detail', {params:p}),
  53. submit:p => http.post('/enterprise/enterprise/submit', p),
  54. }
  55. //企业员工
  56. const enterprisestaff = {
  57. page:p => http.get('/community/enterprisestaff/getEnterpriseList', {params:p}),
  58. detail:p => http.get('/community/enterprisestaff/detail', {params:p}),
  59. submit:p => http.post('/community/enterprisestaff/submit', p),
  60. }
  61. //CMS
  62. const CMS={
  63. page:p => http.get('/estate/article/list', {params:p}),
  64. detail:p => http.get('/estate/article/detail', {params:p}),
  65. addReaderCount:p => http.post('/estate/article/addReaderCount', p),
  66. }
  67. //banner 轮播图
  68. const banner={
  69. page:p => http.get('/estate/banners/list', {params:p}),
  70. }
  71. //消防设备
  72. const fireDevice={
  73. //企业角色的设备列表接口
  74. page:p => http.get('/smartapplication/smartdevice/list', {params:p}),
  75. //园区角色的设备列表接口
  76. agencyPage:p => http.get('/smartapplication/smartdevice/getDeviceList', {params:p}),
  77. //报警记录接口
  78. alarmRecord:p => http.get('/smartapplication/smartdevice/getAlarmRecord', {params:p}),
  79. //电表抄表记录
  80. electricmeterrecord:p => http.get('/electricmeterrecord/electricmeterrecord/list', {params:p}),
  81. }
  82. //用户反馈
  83. const feedback = {
  84. submit:p => http.post('/estate/feedback/submit', p),
  85. }
  86. //园区公告
  87. const notice = {
  88. page:p => http.get('/estate/parknotice/list', {params:p}),
  89. remove:p => http.post('/estate/parknotice/remove?ids='+p),
  90. submit:p => http.post('/estate/parknotice/save', p),
  91. }
  92. //测温记录
  93. const temperatureRecord = {
  94. page:p => http.get('/smartapplication/temperaturerecord/getTemperatureRecord', {params:p}),
  95. }
  96. //健康码
  97. const healthCode = {
  98. getCode:p => http.post('/health/getCode', p)
  99. }
  100. const car = {
  101. //出入记录
  102. condition:p => http.get('carenterrecord/carenterrecord/queryRecord', {params:p}),
  103. //入场记录
  104. enterPage:p => http.get('/carenterrecord/carenterrecord/list', {params:p}),
  105. //出场记录
  106. outPage:p => http.get('/caroutrecord/caroutrecord/list', {params:p}),
  107. //车辆列表
  108. carList:p => http.get('/community/car/app/list', {params:p}),
  109. //添加车辆
  110. carAdd:p => http.post('/community/car/submit', p),
  111. //删除车辆
  112. carRemove:p => http.post('/community/car/remove?ids='+p),
  113. //车辆审核
  114. carAudit:p => http.post('/community/car/audit', p),
  115. }
  116. //开门设备
  117. const device={
  118. page:p => http.get('facedevice/facedevice/list', {params:p}),
  119. open:p => http.post('facedevice/facedevice/remoteOpenDoor', p)
  120. }
  121. //园区统计
  122. const statistical={
  123. //园区信息统计
  124. agencyStatistical:p => http.get('/statistics/agency', {params:p}),
  125. //当日动态数据
  126. todayData:p => http.get('/statistics/screen/park/todayData', {params:p}),
  127. //人员进出记录
  128. carTendency:p => http.get('statistics/screen/park/carTendency', {params:p}),
  129. //三十天内用电量
  130. electricMeterStatic:p => http.get('statistics/electricMeterStatic', {params:p}),
  131. //消防设备数据统计
  132. getGateStatic:p => http.get('smartapplication/smartdevice/getFireStatic', {params:p}),
  133. //消防场景告警事件统计
  134. getDeviceJobStaticByApp:p => http.get('jobs/devicejob/getDeviceJobStaticByApp', {params:p}),
  135. }
  136. //出入记录
  137. const accessrecord={
  138. page:p => http.get('/community/accessrecord/list', {params:p}),
  139. }
  140. //访客授权
  141. const guest={
  142. submit:p => http.post('estate/guest/application', p),
  143. page:p => http.get('estate/guest/list', {params:p}),
  144. getByGuestOpenId:p => http.get('/estate/guest/getByGuestOpenId', {params:p}),
  145. check:p => http.post('estate/guest/check', p),
  146. }
  147. export const api={
  148. //上传文件
  149. uploadFile,
  150. //短信
  151. SMSApi,
  152. //字典
  153. dict,
  154. //微信基本参数
  155. wxData,
  156. //微信api
  157. wxApi,
  158. //登录
  159. login,
  160. //修改密码
  161. updatePassword,
  162. //获取管理员的openid集合
  163. getManagerOpenList,
  164. //获取token
  165. getToken,
  166. //园区
  167. agency,
  168. //区域
  169. residential,
  170. //企业
  171. enterprise,
  172. //企业员工
  173. enterprisestaff,
  174. //CMS
  175. CMS,
  176. //banner 轮播图
  177. banner,
  178. //消防设备
  179. fireDevice,
  180. //用户反馈
  181. feedback,
  182. //园区公告
  183. notice,
  184. //测温记录
  185. temperatureRecord,
  186. //健康码
  187. healthCode,
  188. //车辆出入
  189. car,
  190. //开门设备
  191. device,
  192. //统计
  193. statistical,
  194. //出入记录
  195. accessrecord,
  196. //访客授权
  197. guest
  198. }