CzRger 1 kuukausi sitten
vanhempi
commit
fa275151c2

+ 4 - 0
src/api/modules/center/tenant.ts

@@ -0,0 +1,4 @@
+import { get, post, put, del } from '@/api/request'
+
+// 租户管理分页
+export const tenantsPage = (params) => get(`/tenants`, params, {})

+ 4 - 0
src/stores/modules/dictionary.ts

@@ -74,6 +74,10 @@ export const useDictionaryStore = defineStore('dictionary', {
       { label: '草稿', value: 0 },
       { label: '发布', value: 1 },
     ],
+    tenantStatus: [
+      { label: '启用', value: true },
+      { label: '停用', value: false },
+    ],
   }),
   getters: {
     // shareConditionsMap() {

+ 16 - 15
src/views/manage/center/tenant/index.vue

@@ -35,9 +35,9 @@
             class="__czr-table-form-column"
             :span="24"
             label-width="0px"
-            v-model:param="state.query.form.status"
+            v-model:param="state.query.form.enabled"
             link="select"
-            :options="DictionaryStore.appStatus"
+            :options="DictionaryStore.tenantStatus"
             placeholder="租户状态"
           />
           <CzrFormColumn
@@ -95,6 +95,7 @@ import { debounce } from 'lodash'
 import { useAppStore, useDialogStore, useDictionaryStore } from '@/stores'
 import { ElMessage } from 'element-plus'
 import detailCom from './detail.vue'
+import { tenantsPage } from '@/api/modules/center/tenant'
 
 const AppStore = useAppStore()
 const DialogStore = useDialogStore()
@@ -109,9 +110,9 @@ const state: any = reactive({
     loading: false,
     head: [
       { value: 'name', label: '租户名称', show: true },
-      { value: 'name', label: '租户编号', show: true },
-      { value: 'name', label: '用户配额', show: true },
-      { value: 'name', label: '租户状态', show: true },
+      { value: 'code', label: '租户编号', show: true },
+      { value: 'userQuota', label: '用户配额', show: true },
+      { value: 'enabled', label: '租户状态', show: true },
       { value: 'name', label: '用户数量', show: true, sort: true },
       {
         value: 'createTime',
@@ -200,16 +201,16 @@ const onPage = (pageNum, pageSize) => {
   //  添加排序参数
   for (const [k, v] of Object.entries(state.query.sort)) {
   }
-  // state.query.loading = true
-  // appSearch(params)
-  //   .then(({ data }: any) => {
-  //     state.query.result.total = data.total
-  //     state.query.result.data = data.records
-  //   })
-  //   .catch(() => {})
-  //   .finally(() => {
-  //     state.query.loading = false
-  //   })
+  state.query.loading = true
+  tenantsPage(params)
+    .then(({ data }: any) => {
+      state.query.result.total = data.totalElements
+      state.query.result.data = data.content
+    })
+    .catch(() => {})
+    .finally(() => {
+      state.query.loading = false
+    })
 }
 const onSearch = () => {
   state.query.formReal = JSON.parse(JSON.stringify(state.query.form))