Skip to content

Commit 8790d49

Browse files
committed
feat: System usermanage permission
1 parent ac7e39f commit 8790d49

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ui/src/views/system/user-manage/index.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
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>
@@ -124,11 +129,13 @@
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>
@@ -139,6 +146,7 @@
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>
@@ -150,6 +158,7 @@
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'
173182
import {t} from '@/locales'
174183
import {ValidCount, ValidType} from "@/enums/common.ts";
175184
import useStore from "@/stores";
185+
import { PermissionConst, RoleConst } from '@/utils/permission/data'
186+
import {hasPermission} from '@/utils/permission/index'
176187
177188
const {user, common} = useStore()
178189
const search_type = ref('username')

0 commit comments

Comments
 (0)