api.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. import {http} from './service.js'
  2. const uploadBase64=p => http.post('common/file/uploadBase64', p)
  3. // 权限管理
  4. let permissionsUrl={
  5. login:'/permissions/authentication/login',
  6. menuList: "/permissions/account/getMyPermissionsTreeList",
  7. orgList:"/permissions/org/pagingQuery",
  8. orgListByName: "/permissions/org/getListByLikeName",
  9. getById: "/permissions/org/get/",
  10. carList:"/permissions/xq/device/admin/user/pagingQuery",
  11. subList:"/permissions/org/getSubListByPid"
  12. }
  13. const permissions = {
  14. login:(params,header) => http.post(permissionsUrl.login,params,{header: header}),
  15. menuList:(params,header) => http.get(permissionsUrl.menuList,{params:params,header: header}),
  16. orgList:(params,header) => http.get(permissionsUrl.orgList,{params:params,header: header}),
  17. orgListByName:(params,header) => http.get(permissionsUrl.orgListByName,{params:params,header: header}),
  18. getById: (params,header) => http.get(permissionsUrl.getById+params,{header: header}),
  19. getCarList:(params,header)=>http.get(permissionsUrl.carList,{params:params,header:header}),
  20. getSubListByPid:(params)=>http.get(permissionsUrl.subList,{params:params,header:header})
  21. }
  22. //字典
  23. const dict=(params,header) => http.get('/permissions/dict/getByCode/'+params,{params:{},header})
  24. //获取当前登录用户的身份
  25. const getCurrentAccount=(params,header) => http.get('/permissions/authentication/getCurrentAccount',{params,header})
  26. //修改密码
  27. const updatePsw= (params,header) => http.post('/permissions/account/modifyPassword',params,{header})
  28. //机构列表
  29. const agency={
  30. page:(params,header) => http.get("/estate/agency/showAgencyList",{params:params,header:header})
  31. }
  32. //数据统计
  33. let dataStatisticsUrl={
  34. //小区数
  35. getResidentialAccount:"home/getResidentialAccount",
  36. //单元数
  37. getUnitAccount:"home/getUnitAccount",
  38. //住户数
  39. getUserAccount:"home/getUserAccount",
  40. //住户待审核
  41. getApplyUserAccountWithCheckState:"home/getApplyUserAccountWithCheckState"
  42. }
  43. const dataStatistics={
  44. getResidentialAccount:(params,header) => http.get(dataStatisticsUrl.getResidentialAccount,{params:{'_':new Date().getTime()},header}),
  45. getUnitAccount:(params,header) => http.get(dataStatisticsUrl.getUnitAccount,{params:{'_':new Date().getTime()},header}),
  46. getUserAccount:(params,header) => http.get(dataStatisticsUrl.getUserAccount,{params:{'_':new Date().getTime()},header}),
  47. getApplyUserAccountWithCheckState:(params,header) => http.get(dataStatisticsUrl.getApplyUserAccountWithCheckState,{params:{'_':new Date().getTime(),'checkState':'0'},header})
  48. }
  49. //小区管理
  50. let residentialUrl={
  51. page:"estate/residential/getListByLikeName",
  52. pageBycondition: "estate/residential/showResidentialList",
  53. add: "/estate/residential/addResidential",
  54. update: "/estate/residential/updateResidential",
  55. del: "/estate/residential/deleteResidential",
  56. findListByPosition:"/estate/unit/findListByPosition",
  57. pageByconditionNew:"/community/residential/listByAgencyId",//条件获取小区列表
  58. }
  59. const residential={
  60. page:(params,header) => http.get(residentialUrl.page,{params:params,header: header}),
  61. pageBycondition:(params,header) => http.get(residentialUrl.pageBycondition,{params:params,header: header}),
  62. add: (params,header) => http.post(residentialUrl.add,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  63. update: (params,header) => http.post(residentialUrl.update,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  64. del: (params,header) => http.post(residentialUrl.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  65. findListByPosition:(params,header) => http.get(residentialUrl.findListByPosition,{params:params,header: header}),
  66. pageByconditionNew:(params,header) => http.get(residentialUrl.pageByconditionNew,{params:params,header:header})
  67. }
  68. //楼栋管理
  69. let buildingUrl={
  70. page:'estate/building/showBuildingList',
  71. update:'estate/building/updateBuilding',
  72. del:'estate/building/deleteBuilding',
  73. add:'estate/building/addBuilding'
  74. }
  75. const building={
  76. page:(params,header) => http.get(buildingUrl.page,{params:params,header: header}),
  77. update: (params,header) => http.post(buildingUrl.update,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  78. del: (params,header) => http.post(buildingUrl.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  79. add: (params,header) => http.post(buildingUrl.add,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  80. }
  81. //单元管理
  82. let unitUrl={
  83. page:"/estate/unit/findListByPosition"
  84. }
  85. const unit={
  86. page:(params,header) => http.get(unitUrl.page,{params:params,header: header}),
  87. }
  88. //房间管理
  89. let roomUrl={
  90. del:'estate/room/deleteRoom',
  91. add:'estate/room/addRoom',
  92. page: "/estate/room/showRoomList",
  93. pageBycondition: "estate/room/getListByLikeName",
  94. update:"estate/room/updateRoom",
  95. }
  96. const room = {
  97. del: (params,header) => http.post(roomUrl.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  98. add: (params,header) => http.post(roomUrl.add,params,{header: header}),
  99. page:(params,header) => http.get(roomUrl.page,{params:params,header: header}),
  100. pageBycondition: (params,header) => http.get(roomUrl.pageBycondition,{params:params,header: header}),
  101. update: (params,header) => http.post(roomUrl.update,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  102. }
  103. //住户管理
  104. let userUrl={
  105. page:'estate/user/showUserList',
  106. del:'estate/user/deleteUser',
  107. add:'estate/user/addUser',
  108. update:'estate/user/updateUser'
  109. }
  110. let user={
  111. page:(params,header) => http.get(userUrl.page,{params:params,header: header}),
  112. del: (params,header) => http.post(userUrl.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  113. add: (params,header) => http.post(userUrl.add,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  114. update: (params,header) => http.post(userUrl.update,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  115. detail:(params,header) => http.get('/estate/user/getUserById/'+params,{params:{},header: header}),
  116. }
  117. //住户审核
  118. let userAuthUrl={
  119. //审核列表
  120. page:'apply/user/showApplyUserList',
  121. //认证审核
  122. updateCheckState:'apply/user/updateCheckState',
  123. }
  124. const userAuth={
  125. page: (params,header) => http.post(userAuthUrl.page,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  126. updateCheckState: (params,header) => http.post(userAuthUrl.updateCheckState,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  127. }
  128. //用户反馈
  129. let userFeedBackUrl={
  130. page:'estate/userFeedback/pagingQuery',
  131. }
  132. const userFeedBack={
  133. page:(params,header) => http.get(userFeedBackUrl.page,{params:params,header: header}),
  134. }
  135. //物业报修
  136. let estateRepairUrl={
  137. page:'estate/estateRepair/showRepairList',
  138. submit:'/estate/estateRepair/addOrEditEstateRepair',//新增修改
  139. detail:'/estate/estateRepair/findEstateRepairById/app/',
  140. userFeedback:'estate/userFeedback/pagingQuery',//用户反馈
  141. }
  142. const estateRepair={
  143. page:(params,header) => http.get(estateRepairUrl.page,{params:params,header: header}),
  144. submit: (params,header) => http.post(estateRepairUrl.submit,params,{header: header}),
  145. detail:(params,header) => http.get(estateRepairUrl.detail+params),
  146. }
  147. //车辆管理
  148. let carManageUrl={
  149. page:"/permissions/xq/device/admin/user/pagingQuery",
  150. pageBycondition:"/community/car/list",
  151. submit:"/community/car/submit",
  152. del:"/community/car/remove"
  153. }
  154. const carManage={
  155. page:(params,header) => http.get('/estate/car/page',{params:params,header: header}),
  156. pageBycondition:(params,header) => http.get(carManageUrl.pageBycondition,{params:params,header:header}),
  157. submit:(params,header) => http.post(carManageUrl.submit,params,{header:header}),
  158. del:(params,header) => http.post(carManage.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  159. update:(params,header) => http.post('/estate/car/edit',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}})
  160. }
  161. //服务人员管理
  162. const serverUser={
  163. page:(params,header) => http.get('estate/serverUser/showServerUserList',{params,header}),
  164. submit:(params,header) => http.post('estate/serverUser/addOrEditServerUser',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  165. addOrEditOpenPermission:(params,header) => http.post('estate/serverUser/addOrEditOpenPermission',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  166. accessDevicesManualPush:(params,header) => http.post('estate/serverUser/accessDevicesManualPush',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  167. deleteServerUser:(params,header) => http.post('estate/serverUser/deleteServerUser/'+params,{},{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  168. }
  169. //公告管理
  170. const notice={
  171. page:(params,header) => http.get('estate/notice/showServerUserList',{params,header}),
  172. submit:(params,header) => http.post('estate/notice/addOrEditNotice',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  173. remove:(params,header) => http.post('estate/notice/deleteNotice/'+params,{},{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
  174. }
  175. export const api={
  176. //上传base64文件
  177. uploadBase64,
  178. //权限管理
  179. permissions,
  180. //字典
  181. dict,
  182. //获取当前用户的身份信息
  183. getCurrentAccount,
  184. //修改密码
  185. updatePsw,
  186. //机构列表
  187. agency,
  188. //数据统计
  189. dataStatistics,
  190. //小区管理
  191. residential,
  192. //楼栋管理
  193. building,
  194. //单元管理
  195. unit,
  196. //房间管理
  197. room,
  198. //住户管理
  199. user,
  200. //住户审核
  201. userAuth,
  202. //用户反馈
  203. userFeedBack,
  204. //物业报修
  205. estateRepair,
  206. //车辆管理
  207. carManage,
  208. //服务人员管理
  209. serverUser,
  210. //公告管理
  211. notice
  212. }