Browse Source

租户信息完善

张梦琪 1 year ago
parent
commit
4323249dcd
1 changed files with 14 additions and 26 deletions
  1. 14 26
      src/views/admin/tenant/index.vue

+ 14 - 26
src/views/admin/tenant/index.vue

@@ -13,7 +13,8 @@
     </el-card>
 
     <el-card class="my-fill mt8" shadow="never">
-      <el-table v-loading="state.loading" :data="state.tenantListData" row-key="id" height="'100%'" style="width: 100%; height: 100%">
+      <el-table v-loading="state.loading" :data="state.tenantListData" row-key="id" height="'100%'"
+        style="width: 100%; height: 100%">
         <el-table-column prop="name" label="企业名称" min-width="120" show-overflow-tooltip />
         <el-table-column prop="code" label="企业编码" width="120" show-overflow-tooltip />
         <el-table-column prop="pkgNames" label="套餐" width="140" show-overflow-tooltip>
@@ -23,20 +24,14 @@
         </el-table-column>
         <el-table-column prop="realName" label="姓名" width="120" show-overflow-tooltip />
         <el-table-column prop="phone" label="手机号" width="120" show-overflow-tooltip />
+        <el-table-column prop="subNum" label="代理数量" width="120" show-overflow-tooltip />
+        <el-table-column prop="totalAmount" label="累计收益(元)" width="120" show-overflow-tooltip />
         <!-- <el-table-column prop="email" label="邮箱" min-width="180" show-overflow-tooltip /> -->
         <el-table-column label="状态" width="80" align="center" fixed="right">
           <template #default="{ row }">
-            <el-switch
-              v-if="auth('api:admin:tenant:set-enable')"
-              v-model="row.enabled"
-              :loading="row.loading"
-              :active-value="true"
-              :inactive-value="false"
-              inline-prompt
-              active-text="启用"
-              inactive-text="禁用"
-              :before-change="() => onSetEnable(row)"
-            />
+            <el-switch v-if="auth('api:admin:tenant:set-enable')" v-model="row.enabled" :loading="row.loading"
+              :active-value="true" :inactive-value="false" inline-prompt active-text="启用" inactive-text="禁用"
+              :before-change="() => onSetEnable(row)" />
             <template v-else>
               <el-tag type="success" v-if="row.enabled">启用</el-tag>
               <el-tag type="danger" v-else>禁用</el-tag>
@@ -46,7 +41,8 @@
         <el-table-column prop="h5WebSite" label="H5网址" min-width="120" show-overflow-tooltip />
         <el-table-column label="操作" width="140" header-align="center" align="center" fixed="right">
           <template #default="{ row }">
-            <el-button v-auth="'api:admin:tenant:update'" icon="ele-EditPen" size="small" text type="primary" @click="onEdit(row)">编辑</el-button>
+            <el-button v-auth="'api:admin:tenant:update'" icon="ele-EditPen" size="small" text type="primary"
+              @click="onEdit(row)">编辑</el-button>
             <my-dropdown-more v-auths="['api:admin:tenant:delete']">
               <template #dropdown>
                 <el-dropdown-menu>
@@ -59,17 +55,9 @@
       </el-table>
 
       <div class="my-flex my-flex-end" style="margin-top: 20px">
-        <el-pagination
-          v-model:currentPage="state.pageInput.currentPage"
-          v-model:page-size="state.pageInput.pageSize"
-          :total="state.total"
-          :page-sizes="[10, 20, 50, 100]"
-          small
-          background
-          @size-change="onSizeChange"
-          @current-change="onCurrentChange"
-          layout="total, sizes, prev, pager, next, jumper"
-        />
+        <el-pagination v-model:currentPage="state.pageInput.currentPage" v-model:page-size="state.pageInput.pageSize"
+          :total="state.total" :page-sizes="[10, 20, 50, 100]" small background @size-change="onSizeChange"
+          @current-change="onCurrentChange" layout="total, sizes, prev, pager, next, jumper" />
       </div>
     </el-card>
 
@@ -131,7 +119,7 @@ const onQuery = async () => {
 }
 
 const onAdd = () => {
-  state.tenantFormTitle = '新增租户'  
+  state.tenantFormTitle = '新增租户'
   tenantFormRef.value.open()
 }
 
@@ -147,7 +135,7 @@ const onDelete = (row: TenantListOutput) => {
       await new TenantApi().delete({ id: row.id }, { loading: true, showSuccessMessage: true })
       onQuery()
     })
-    .catch(() => {})
+    .catch(() => { })
 }
 
 const onSetEnable = (row: TenantListOutput & { loading: boolean }) => {