tenant.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. import request from '@/utils/request'
  2. import { SAAS_URL } from '@/api/baseUrl'
  3. const BASE_MAPPING = '/saas/tenant'
  4. /**
  5. * 查询列表数据
  6. * @param {*} params
  7. */
  8. export function queryPageList(params) {
  9. return request({
  10. url: SAAS_URL() + BASE_MAPPING + '/query',
  11. method: 'post',
  12. data: params
  13. })
  14. }
  15. /**
  16. * 查询未审核列表数据
  17. * @param {*} params
  18. */
  19. export function queryWaitPageList(params) {
  20. return request({
  21. url: SAAS_URL() + BASE_MAPPING + '/query/wait',
  22. method: 'post',
  23. data: params
  24. })
  25. }
  26. /**
  27. * 删除数据
  28. * @param {*} params
  29. */
  30. export function remove(params) {
  31. return request({
  32. url: SAAS_URL() + BASE_MAPPING + '/remove',
  33. method: 'post',
  34. isLoading: true,
  35. params
  36. })
  37. }
  38. /**
  39. * 创建租户空间
  40. * @param {*} params
  41. */
  42. export function schemaCreate(params) {
  43. return request({
  44. url: SAAS_URL() + BASE_MAPPING + '/schema/create',
  45. method: 'post',
  46. isLoading: true,
  47. params
  48. })
  49. }
  50. /**
  51. * 删除租户空间
  52. * @param {*} params
  53. */
  54. export function schemaDrop(params) {
  55. return request({
  56. url: SAAS_URL() + BASE_MAPPING + '/schema/drop',
  57. method: 'post',
  58. isLoading: true,
  59. params
  60. })
  61. }
  62. /**
  63. * 查询 待创建的空间信息
  64. * @param {*} params
  65. */
  66. export function schema(params) {
  67. return request({
  68. url: SAAS_URL() + BASE_MAPPING + '/schema/find/tenant/schema',
  69. method: 'post',
  70. data: params
  71. })
  72. }
  73. /**
  74. * 查询 已创建空间信息
  75. * @param {*} params
  76. */
  77. export function query(params) {
  78. return request({
  79. url: SAAS_URL() + BASE_MAPPING + '/schema/query',
  80. method: 'post',
  81. data: params
  82. })
  83. }
  84. /**
  85. *
  86. 获取租户空间信息
  87. * @param {*} params
  88. */
  89. export function getSpace(params) {
  90. return request({
  91. url: SAAS_URL() + BASE_MAPPING + '/schema/get',
  92. method: 'get',
  93. params
  94. })
  95. }
  96. /**
  97. * 创建空间
  98. * @param {*} params
  99. */
  100. export function createSpace(params) {
  101. return request({
  102. url: SAAS_URL() + BASE_MAPPING + '/schema/schema/create',
  103. method: 'post',
  104. isLoading: true,
  105. data: params
  106. })
  107. }
  108. /**
  109. * 逻辑删除空间
  110. * @param {*} params
  111. */
  112. export function removeSpace(params) {
  113. return request({
  114. url: SAAS_URL() + BASE_MAPPING + '/schema/remove',
  115. method: 'post',
  116. isLoading: true,
  117. params
  118. })
  119. }
  120. /**
  121. * 物理删除空间
  122. * @param {*} params
  123. */
  124. export function dropSpace(params) {
  125. return request({
  126. url: SAAS_URL() + BASE_MAPPING + '/schema/schema/drop',
  127. method: 'post',
  128. isLoading: true,
  129. params
  130. })
  131. }
  132. /**
  133. * 企业注册
  134. * @param {*} data
  135. */
  136. export function register(data) {
  137. return request({
  138. url: SAAS_URL() + BASE_MAPPING + '/register',
  139. method: 'post',
  140. isLoading: true,
  141. data
  142. })
  143. }
  144. /**
  145. * 保存数据
  146. * @param {*} data
  147. */
  148. export function save(data) {
  149. return request({
  150. url: SAAS_URL() + BASE_MAPPING + '/save',
  151. method: 'post',
  152. isLoading: true,
  153. data
  154. })
  155. }
  156. /**
  157. * 企业审核
  158. * @param {*} data
  159. */
  160. export function approve(data) {
  161. return request({
  162. url: SAAS_URL() + BASE_MAPPING + '/approve',
  163. method: 'post',
  164. isLoading: true,
  165. data
  166. })
  167. }
  168. /**
  169. * 获取数据
  170. * @param {*} params
  171. */
  172. export function get(params) {
  173. return request({
  174. url: SAAS_URL() + BASE_MAPPING + '/get',
  175. method: 'get',
  176. params
  177. })
  178. }
  179. /**
  180. * 获取设置关联的数据
  181. * @param {*} data
  182. */
  183. export function getTenant(data) {
  184. return request({
  185. url: SAAS_URL() + BASE_MAPPING + '/find/tenant',
  186. method: 'post',
  187. data: data
  188. })
  189. }
  190. /**
  191. * 保存设置关联的数据
  192. * @param {*} data
  193. */
  194. export function saveRelation(data) {
  195. return request({
  196. url: SAAS_URL() + BASE_MAPPING + '/save/user/relation',
  197. method: 'post',
  198. data: data
  199. })
  200. }
  201. /**
  202. * 保存设置关联的数据
  203. * @param {*} data
  204. */
  205. export function approveBatch(params) {
  206. return request({
  207. url: SAAS_URL() + BASE_MAPPING + '/approve/batch',
  208. method: 'post',
  209. params: params
  210. })
  211. }