system-org.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { httpApp } from "@/plugins/axiosIndex";
  2. import { pickBy } from "lodash-es";
  3. import { object2QueryString } from "@/utils/utils";
  4. export function searchOrgs({
  5. code = "",
  6. name = "",
  7. enable = "",
  8. pageNumber = 1,
  9. pageSize = 10,
  10. }) {
  11. const data = pickBy(
  12. { code, name, enable, pageNumber, pageSize },
  13. (v) => v !== ""
  14. );
  15. return httpApp.post("/api/admin/org/query?" + object2QueryString(data));
  16. }
  17. export function toggleEnableOrg({ id, enable }) {
  18. return httpApp.post("/api/admin/org/enable", { id, enable });
  19. }
  20. export function searchOrg(id) {
  21. return httpApp.post("/api/admin/sys/org/query?" + object2QueryString({ id }));
  22. }
  23. export function saveOrg({
  24. id = "",
  25. name = "",
  26. code = "",
  27. contactName = "",
  28. contactPhone = "",
  29. logo = null,
  30. enableSimulate = 0,
  31. enableMonitorRecord = 0,
  32. enableLiveness = 0,
  33. enable = 0,
  34. }) {
  35. const data = pickBy(
  36. {
  37. id,
  38. name,
  39. code,
  40. contactName,
  41. contactPhone,
  42. // logo,
  43. enableSimulate,
  44. enableMonitorRecord,
  45. enableLiveness,
  46. enable,
  47. },
  48. (v) => v !== ""
  49. );
  50. return httpApp.post("/api/admin/org/save", { ...data, logo });
  51. }
  52. export function syncOrg() {
  53. return httpApp.post("/api/admin/sys/sync/org?");
  54. }