personInfo.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import request from '@/utils/request'
  2. import constant from '@/constant'
  3. import { getToken } from "@/utils/auth"; // get token from cookie
  4. function pageList(formData) {
  5. return request.post(constant.serverUrl + "/base/personInfo/pageList", formData);
  6. }
  7. function create() {
  8. return request.get(constant.serverUrl + "/base/personInfo/create");
  9. }
  10. function edit(id) {
  11. return request.get(constant.serverUrl + "/base/personInfo/edit/" + id);
  12. }
  13. function add(formModel) {
  14. return request.post(constant.serverUrl + "/base/personInfo/add", formModel, {
  15. headers: {
  16. "Content-Type": "application/json"
  17. }
  18. });
  19. }
  20. function update(formModel) {
  21. return request.post(constant.serverUrl + "/base/personInfo/update", formModel, {
  22. headers: {
  23. "Content-Type": "application/json"
  24. }
  25. });
  26. }
  27. function remove(id) {
  28. return request.post(constant.serverUrl + "/base/personInfo/delete/" + id);
  29. }
  30. function batchRemove(idList) {
  31. return request.post(constant.serverUrl + "/base/personInfo/batchDelete", idList, {
  32. headers: {
  33. "Content-Type": "application/json"
  34. }
  35. });
  36. }
  37. function exportXls(formData) {
  38. //导出xls
  39. return request.post(constant.serverUrl + "/base/personInfo/exportXls", formData);
  40. //window.open(constant.serverUrl + "/base/personInfo/exportXls?token=" + getToken());
  41. }
  42. function enabledFace(formData) {
  43. //人脸授权
  44. return request.post(constant.serverUrl + "/base/personInfo/enabledFace", formData);
  45. }
  46. function enabledFaceList(ids) {
  47. //批量人脸授权
  48. return request.post(constant.serverUrl + "/base/personInfo/enabledFaceList", ids, {
  49. headers: {
  50. "Content-Type": "application/json"
  51. }
  52. });
  53. }
  54. function enabledCard(formData) {
  55. //刷卡授权
  56. return request.post(constant.serverUrl + "/base/personInfo/enabledCard", formData);
  57. }
  58. function enabledApp(formData) {
  59. //手机授权
  60. return request.post(constant.serverUrl + "/base/personInfo/enabledApp", formData);
  61. }
  62. function enabledWechatNotice(formData) {
  63. //接收微信通知
  64. return request.post(constant.serverUrl + "/base/personInfo/enabledWechatNotice", formData);
  65. }
  66. function enabledGuest(formData) {
  67. //访客授权
  68. return request.post(constant.serverUrl + "/base/personInfo/enabledGuest", formData);
  69. }
  70. function dataSync(idList) {
  71. //数据同步
  72. return request.post(constant.serverUrl + "/base/personInfo/dataSync", idList, {
  73. headers: {
  74. "Content-Type": "application/json"
  75. }
  76. });
  77. }
  78. function unbindWechat(id) {
  79. return request.post(constant.serverUrl + "/base/personInfo/unbindWechat", id, {
  80. headers: {
  81. "Content-Type": "application/json"
  82. }
  83. });
  84. }
  85. function lifeRecordList(formData) {
  86. return request.post(constant.serverUrl + "/base/personInfo/lifeRecordList", formData);
  87. }
  88. function clearFaceImg(id) {
  89. return request.post(constant.serverUrl + "/base/personInfo/clearFaceImg", id, {
  90. headers: {
  91. "Content-Type": "application/json"
  92. }
  93. });
  94. }
  95. function batchClearFaceImg(idList) {
  96. return request.post(constant.serverUrl + "/base/personInfo/batchClearFaceImg", idList, {
  97. headers: {
  98. "Content-Type": "application/json"
  99. }
  100. });
  101. }
  102. function enabledSync(formData) {
  103. //开启自动同步
  104. return request.post(constant.serverUrl + "/base/personInfo/enabledSync", formData);
  105. }
  106. function enabledSyncList(ids) {
  107. //开启自动同步
  108. return request.post(constant.serverUrl + "/base/personInfo/enabledSyncList", ids, {
  109. headers: {
  110. "Content-Type": "application/json"
  111. }
  112. });
  113. }
  114. export default {
  115. pageList, create, edit, add, update, remove, batchRemove, exportXls,
  116. enabledFace, enabledCard, enabledApp, enabledGuest, dataSync, enabledFaceList,
  117. enabledWechatNotice, unbindWechat, lifeRecordList, clearFaceImg, batchClearFaceImg,
  118. enabledSync, enabledSyncList
  119. }