فهرست منبع

fix: 修改租户管理员按钮显示逻辑

qindao 1 سال پیش
والد
کامیت
6156439644
3فایلهای تغییر یافته به همراه35 افزوده شده و 15 حذف شده
  1. 3 1
      src/api/auth/dept.ts
  2. 19 6
      src/types/dept/type.ts
  3. 13 8
      src/views/system/user/user.vue

+ 3 - 1
src/api/auth/dept.ts

@@ -1,4 +1,6 @@
 import { http } from '@/utils/http/axios';
+import { DeptPageRequest } from '@/types/dept/type';
+import { QueryUserGroupListRes } from '@/types/dept/type';
 
 /**
  * @description: 部门列表
@@ -69,7 +71,7 @@ export function deleteDept(params) {
 /**
  * @description: V4:组织列表
  */
- export function queryUserGroupList(params) {
+ export function queryUserGroupList(params:DeptPageRequest):QueryUserGroupListRes {
   return http.request({
     url: '/userGroup/queryUserGroupList',
     method: 'post',

+ 19 - 6
src/types/dept/type.ts

@@ -1,7 +1,20 @@
-export interface DeptPageRequest {
-  queryUserGroupListReq: {
-    pageNumber: number;
-    pageSize: number;
-    queryStr: string;
-  }
+import { PaginationRequest, PaginationResponse } from '@/types/common/type';
+
+export type DeptPageRequest = PaginationRequest & {
+  queryStr: string;
+}
+
+export interface DeptListItem {
+  /*用户组id */
+  id: number;
+  /*用户组名称 */
+  name: string;
+  /*分组描述 */
+  description: string;
+  /*人数 */
+  total: number;
+  /*操作人姓名 */
+  operatorName: string;
+  /*操作时间 */
+  operationTime: string;
 }

+ 13 - 8
src/views/system/user/user.vue

@@ -18,7 +18,7 @@
             </template>
             添加用户
           </el-button>
-          <el-button @click="openAddAdminDrawer" v-if="isSysTenant">
+          <el-button @click="openAddAdminDrawer" v-if="!isSysTenant">
             <template #icon>
               <el-icon>
                 <Plus />
@@ -74,11 +74,17 @@
         <el-table-column label="认证方式" prop="certify" />
         <el-table-column label="创建时间" prop="createdAt" />
         <el-table-column label="操作" width="200">
-          <template #default="scope ">
+          <template #default="scope">
             <el-space v-if="scope.row.roleType !== RoleTypeEnum.SUPER_ADMIN">
               <el-button type="primary" :icon="Edit" text @click="handleEdit(scope.row)" />
-              <el-button type="primary" :icon="Delete" text @click="handleDelete(scope.row.id)"  />
-              <el-button type="primary" v-if="visibleRestPassBtn(scope.row.roleType) " text @click="handleResetCode(scope.row)">重置密码</el-button>
+              <el-button type="primary" :icon="Delete" text @click="handleDelete(scope.row.id)" />
+              <el-button
+                type="primary"
+                v-if="visibleRestPassBtn(scope.row.roleType)"
+                text
+                @click="handleResetCode(scope.row)"
+                >重置密码</el-button
+              >
             </el-space>
           </template>
         </el-table-column>
@@ -137,7 +143,7 @@
   import { ResultEnum } from '@/enums/httpEnum';
   import { useTargetTenantIdSetting } from '@/utils/useTargetTenantIdSetting';
   import type { RoleListItem } from '@/api/system/user-operate';
-  import type {DeptTreeItem } from '@/api/system/user-query'
+  import type { DeptTreeItem } from '@/api/system/user-query';
   import SearchForm from './component/SearchForm.vue';
   import AddUser from './component/AddUser.vue';
   import CreateDrawer from './CreateDrawer.vue';
@@ -164,7 +170,6 @@
 
   const openAddSingleDrawer = () => {
     drawerTitle.value = '添加用户';
-    
     if (!isSysTenant) {
       createAdminType.value = EditType.create;
       createAdminDrawerRef.value?.openDrawer();
@@ -231,10 +236,10 @@
   /* 是否能重置密码 */
   const visibleRestPassBtn = (type: RoleTypeEnum): boolean => {
     if (isSysTenant || (!isSysTenant && type !== RoleTypeEnum.TENANT_ADMIN)) {
-      return true
+      return true;
     }
     return false;
-  }
+  };
 
   onMounted(async () => {
     loadPageData();