mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	优化:优化表格操作列功能权限处理,即当所有操作按钮均没有权限时,移除操作列
This commit is contained in:
		| @@ -66,7 +66,7 @@ | ||||
|           <a-table-column title="登录地点" data-index="location" /> | ||||
|           <a-table-column title="浏览器" data-index="browser" /> | ||||
|           <a-table-column title="登录时间" data-index="loginTime" /> | ||||
|           <a-table-column title="操作" align="center"> | ||||
|           <a-table-column v-if="checkPermission(['monitor:online:user:delete'])" title="操作" align="center"> | ||||
|             <template #cell="{ record }"> | ||||
|               <a-popconfirm content="确定要强退该用户吗?" type="warning" @ok="handleKickout(record.token)"> | ||||
|                 <a-button | ||||
| @@ -93,9 +93,10 @@ | ||||
|     OnlineUserParam, | ||||
|     OnlineUserRecord, | ||||
|     listOnlineUser, | ||||
|     kickout | ||||
|     kickout, | ||||
|   } from '@/api/monitor/online'; | ||||
|   import { getToken } from '@/utils/auth'; | ||||
|   import checkPermission from '@/utils/permission'; | ||||
|  | ||||
|   const { proxy } = getCurrentInstance() as any; | ||||
|  | ||||
|   | ||||
| @@ -137,7 +137,11 @@ | ||||
|           <a-table-column title="描述" data-index="description" /> | ||||
|           <a-table-column title="创建人" data-index="createUserString" /> | ||||
|           <a-table-column title="创建时间" data-index="createTime" /> | ||||
|           <a-table-column title="操作" align="center"> | ||||
|           <a-table-column | ||||
|             v-if="checkPermission(['system:dept:update', 'system:dept:delete'])" | ||||
|             title="操作" | ||||
|             align="center" | ||||
|           > | ||||
|             <template #cell="{ record }"> | ||||
|               <a-button | ||||
|                 v-permission="['system:dept:update']" | ||||
|   | ||||
| @@ -153,7 +153,11 @@ | ||||
|             </template> | ||||
|           </a-table-column> | ||||
|           <a-table-column title="创建时间" data-index="createTime" /> | ||||
|           <a-table-column title="操作" align="center"> | ||||
|           <a-table-column | ||||
|             v-if="checkPermission(['system:menu:update', 'system:menu:delete'])" | ||||
|             title="操作" | ||||
|             align="center" | ||||
|           > | ||||
|             <template #cell="{ record }"> | ||||
|               <a-button | ||||
|                 v-permission="['system:menu:update']" | ||||
|   | ||||
| @@ -152,7 +152,11 @@ | ||||
|           <a-table-column title="描述" data-index="description" /> | ||||
|           <a-table-column title="创建人" data-index="createUserString" /> | ||||
|           <a-table-column title="创建时间" data-index="createTime" /> | ||||
|           <a-table-column title="操作" align="center"> | ||||
|           <a-table-column | ||||
|             v-if="checkPermission(['system:role:update', 'system:role:delete'])" | ||||
|             title="操作" | ||||
|             align="center" | ||||
|           > | ||||
|             <template #cell="{ record }"> | ||||
|               <a-button | ||||
|                 v-permission="['system:role:update']" | ||||
|   | ||||
| @@ -186,6 +186,14 @@ | ||||
|                 </template> | ||||
|               </a-table-column> | ||||
|               <a-table-column | ||||
|                 v-if=" | ||||
|                   checkPermission([ | ||||
|                     'system:user:update', | ||||
|                     'system:user:delete', | ||||
|                     'system:user:password:reset', | ||||
|                     'system:user:role:update', | ||||
|                   ]) | ||||
|                 " | ||||
|                 title="操作" | ||||
|                 align="center" | ||||
|                 fixed="right" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user