33 <h2 class =" mb-16" >{{ $t('views.userManage.title') }}</h2 >
44 <el-card >
55 <div class =" flex-between mb-16" >
6- <el-button type =" primary" @click =" createUser" >{{
6+ <el-button type =" primary" @click =" createUser"
7+ v-hasPermission =" [
8+ RoleConst.ADMIN,
9+ PermissionConst.USER_CREATE
10+ ]"
11+ >{{
712 $t('views.userManage.createUser')
813 }}
914 </el-button >
124129 size =" small"
125130 v-model =" row.is_active"
126131 :before-change =" () => changeState(row)"
132+ v-if =" hasPermission([RoleConst.ADMIN,PermissionConst.USER_EDIT],'OR')"
127133 />
128134 </span >
129135 <el-divider direction =" vertical" />
130136 <span class =" mr-8" >
131- <el-button type =" primary" text @click.stop =" editUser(row)" :title =" $t('common.edit')" >
137+ <el-button type =" primary" text @click.stop =" editUser(row)" :title =" $t('common.edit')"
138+ v-if =" hasPermission([RoleConst.ADMIN,PermissionConst.USER_EDIT],'OR')" >
132139 <el-icon ><EditPen /></el-icon >
133140 </el-button >
134141 </span >
139146 text
140147 @click.stop =" editPwdUser(row)"
141148 :title =" $t('views.userManage.setting.updatePwd')"
149+ v-if =" hasPermission([RoleConst.ADMIN,PermissionConst.USER_EDIT],'OR')"
142150 >
143151 <el-icon ><Lock /></el-icon >
144152 </el-button >
150158 text
151159 @click.stop =" deleteUserManage(row)"
152160 :title =" $t('common.delete')"
161+ v-if =" hasPermission([RoleConst.ADMIN,PermissionConst.USER_DELETE],'OR')"
153162 >
154163 <el-icon ><Delete /></el-icon >
155164 </el-button >
@@ -173,6 +182,8 @@ import {MsgSuccess, MsgConfirm} from '@/utils/message'
173182import {t } from ' @/locales'
174183import {ValidCount , ValidType } from " @/enums/common.ts" ;
175184import useStore from " @/stores" ;
185+ import { PermissionConst , RoleConst } from ' @/utils/permission/data'
186+ import {hasPermission } from ' @/utils/permission/index'
176187
177188const {user, common} = useStore ()
178189const search_type = ref (' username' )
0 commit comments