feat:分配权限

This commit is contained in:
dzc committed 2025-01-21 17:27:27 +08:00
1 parent 573d25adcc
commit ea781de349
7 files changed
+285 -216

No files matched your search

+13 -4
View File
@@ -1,7 +1,9 @@
<template>
<div class="system-user-dialog-container">
<el-dialog :close-on-click-modal="false" title="人脸管理" draggable v-model="dialogVisible">
<el-button icon="folder-add" type="primary" @click="addFace"> 新增 </el-button>
<el-button v-auth="'userFace_sysUserFace_add'" icon="folder-add" type="primary" @click="addFace">
新增
</el-button>
<div class="h-4" />
<el-table
v-loading="state.loading"
@@ -17,10 +19,17 @@
<preview-image :src="row.faceImg" />
</template>
</el-table-column>
<el-table-column prop="address" align="center" label="操作">
<el-table-column
v-auths="['userFace_sysUserFace_edit', 'userFace_sysUserFace_del']"
prop="address"
align="center"
label="操作"
>
<template #default="{ row }">
<el-button link type="primary" @click="editFace(row)"> <Icon icon="ep:edit" />修改 </el-button>
<el-button link type="danger" @click="delFace(row)"> 删除 </el-button>
<el-button v-auth="'userFace_sysUserFace_edit'" link type="primary" @click="editFace(row)">
<Icon icon="ep:edit" />修改
</el-button>
<el-button v-auth="'userFace_sysUserFace_del'" link type="danger" @click="delFace(row)"> 删除 </el-button>
</template>
</el-table-column>
</el-table>
+16 -2
View File
@@ -131,6 +131,7 @@
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip>
<template #default="scope">
<el-switch
:disabled="!auth('sys_user_edit')"
v-model="scope.row.lockFlag"
@change="changeSwitch(scope.row)"
active-value="0"
@@ -146,6 +147,7 @@
<el-table-column label="全局人脸" show-overflow-tooltip>
<template #default="{ row }">
<el-switch
:disabled="!auth('userFace_sysUserFace_global_face')"
v-if="row.isGlobalFace"
v-model="row.isGlobalFace"
@change="changeGlobalFaceSwitch(row)"
@@ -154,7 +156,12 @@
/>
</template>
</el-table-column>
<el-table-column :label="$t('common.action')" width="300" fixed="right">
<el-table-column
v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']"
:label="$t('common.action')"
width="300"
fixed="right"
>
<template #default="scope">
<div style="display: flex">
<!-- 重置密码 -->
@@ -176,7 +183,13 @@
{{ $t("common.editBtn") }}
</el-button>
<!-- 人脸管理 -->
<el-button icon="User" text type="primary" @click="faceManageRef.openDialog(scope.row.userId)">
<el-button
v-auth="'userFace_sysUserFace_view'"
icon="User"
text
type="primary"
@click="faceManageRef.openDialog(scope.row.userId)"
>
人脸管理
</el-button>
<!-- 删除用户 -->
@@ -225,6 +238,7 @@ import { deptTree } from "/@/api/admin/dept"
import { BasicTableProps, useTable } from "/@/hooks/table"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useI18n } from "vue-i18n"
import { auth } from "/@/utils/authFunction"
// 动态引入组件
const UserForm = defineAsyncComponent(() => import("./form.vue"))