index.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import { http } from '@/utils/http/axios';
  2. import type { tenantFormType } from '@/types/tenant/type';
  3. /**
  4. * @description: 租户列表
  5. */
  6. export function tenantList(params) {
  7. return http.request({
  8. url: '/tenant/list',
  9. method: 'get',
  10. params,
  11. });
  12. }
  13. /**
  14. * @description: 添加租户
  15. */
  16. export function addTenant(data) {
  17. return http.request({
  18. url: '/tenant/add',
  19. method: 'post',
  20. data,
  21. });
  22. }
  23. /**
  24. * @description: 删除租户
  25. */
  26. export function deleteTenant(data) {
  27. return http.request({
  28. url: '/tenant/delete',
  29. method: 'post',
  30. data,
  31. });
  32. }
  33. /**
  34. * @description: 编辑租户
  35. */
  36. export function editTenant(data) {
  37. return http.request({
  38. url: '/tenant/update',
  39. method: 'post',
  40. data,
  41. });
  42. }
  43. /**
  44. * @description: 租户详情
  45. */
  46. export function tenantInfo(params) {
  47. return http.request({
  48. url: '/tenant/view',
  49. method: 'get',
  50. params,
  51. });
  52. }
  53. /** 获取有总部权限时的所有租户 */
  54. export function getListUseZongbu() {
  55. return http.request(
  56. {
  57. url: '/tenant/listUseZongbu',
  58. method: 'get',
  59. },
  60. { isShowErrorMessage: false, isShowMessage: false },
  61. );
  62. }
  63. /**
  64. * @description: 查询租户树
  65. */
  66. export function queryTenantTreeApi(params: { tenantName: string; tenantCode: string }) {
  67. return http.request({
  68. url: '/admin/tenant/queryTenantTree',
  69. method: 'post',
  70. params,
  71. });
  72. }
  73. /**
  74. * @description: 添加租户(新)
  75. */
  76. export function saveTenantApi(params: tenantFormType) {
  77. return http.request({
  78. url: '/admin/tenant/saveTenant',
  79. method: 'post',
  80. params,
  81. });
  82. }
  83. /**
  84. * @description: 删除租户(新)
  85. */
  86. export function deleteTenantApi(tenantId: number) {
  87. return http.request({
  88. url: `/admin/tenant/deleteTenant?tenantId=${tenantId}`,
  89. method: 'post',
  90. });
  91. }
  92. /**
  93. * @description: 修改租户(新)
  94. */
  95. export function updateTenantApi(params: tenantFormType) {
  96. return http.request({
  97. url: '/admin/tenant/updateTenant',
  98. method: 'post',
  99. params,
  100. });
  101. }
  102. /* V4: 获取租户列表 */
  103. export function queryListTenant() {
  104. return http.request(
  105. {
  106. url: '/admin/tenant/listTenantForTargetTenant',
  107. method: 'post',
  108. },
  109. { isShowErrorMessage: false, isShowMessage: false },
  110. );
  111. }