修改
This commit is contained in:
1 parent
866cb60801
commit
7fca37e2a6
3 files changed
+35
-24
No files matched your search
@@ -28,14 +28,14 @@
|
||||
<el-input clearable placeholder="请输入手机号" v-model="dataForm.phone"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN') && !roleCodes.includes('ROLE_ADMIN')" class="mb20">
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN')" class="mb20">
|
||||
<el-form-item :label="$t('sysuser.role')" prop="role">
|
||||
<el-select clearable multiple placeholder="请选择角色" v-model="dataForm.role">
|
||||
<el-option :key="item.roleId" :label="item.roleName" :value="item.roleId" v-for="item in roleData" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN') && !roleCodes.includes('ROLE_ADMIN')" class="mb20">
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN')" class="mb20">
|
||||
<el-form-item :label="$t('sysuser.post')" prop="post">
|
||||
<el-select clearable multiple placeholder="请选择岗位" v-model="dataForm.post">
|
||||
<el-option :key="item.postId" :label="item.postName" :value="item.postId" v-for="item in postData" />
|
||||
@@ -171,10 +171,7 @@ const dataRules = ref({
|
||||
{ validator: rule.chinese, trigger: "blur" },
|
||||
],
|
||||
deptId: [{ required: true, message: "部门不能为空", trigger: "blur" }],
|
||||
role:
|
||||
roleCodes.includes("DEPT_ADMIN") || roleCodes.includes("ROLE_ADMIN")
|
||||
? []
|
||||
: [{ required: true, message: "角色不能为空", trigger: "blur" }],
|
||||
role: roleCodes.includes("DEPT_ADMIN") ? [] : [{ required: true, message: "角色不能为空", trigger: "blur" }],
|
||||
// post: [{ required: true, message: '岗位不能为空', trigger: 'blur' }],
|
||||
// 手机号校验,不能为空、新增的时不能重复校验
|
||||
phone: [
|
||||
@@ -288,7 +285,7 @@ const getPostData = () => {
|
||||
postList().then((res) => {
|
||||
postData.value = res.data
|
||||
// 默认选择第一个
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !roleCodes.includes("ROLE_ADMIN") && !dataForm.userId) {
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !dataForm.userId) {
|
||||
dataForm.post = [res.data[0].postId]
|
||||
}
|
||||
})
|
||||
@@ -298,7 +295,7 @@ const getRoleData = () => {
|
||||
roleList().then((res) => {
|
||||
roleData.value = res.data
|
||||
// 默认选择第一个
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !roleCodes.includes("ROLE_ADMIN") && !dataForm.userId) {
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !dataForm.userId) {
|
||||
dataForm.role = [res.data[0].roleId]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -75,16 +75,16 @@
|
||||
>
|
||||
<el-table-column :selectable="handleSelectable" type="selection" width="40" />
|
||||
<el-table-column label="#" type="index" width="60" fixed="left" />
|
||||
<el-table-column label="用户名" prop="username" fixed="left" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="姓名" prop="name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="手机号" prop="phone" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="部门" prop="deptName" show-overflow-tooltip />
|
||||
<el-table-column label="角色" show-overflow-tooltip>
|
||||
<el-table-column label="用户名" prop="username" fixed="left" show-overflow-tooltip min-width="150" />
|
||||
<el-table-column label="姓名" prop="name" show-overflow-tooltip min-width="150" />
|
||||
<el-table-column label="手机号" prop="phone" show-overflow-tooltip min-width="150" />
|
||||
<el-table-column label="部门" prop="deptName" show-overflow-tooltip min-width="150" />
|
||||
<el-table-column label="角色" show-overflow-tooltip min-width="150">
|
||||
<template #default="scope">
|
||||
<el-tag v-for="(item, index) in scope.row.roleList" :key="index">{{ item.roleName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="启用" show-overflow-tooltip>
|
||||
<el-table-column label="启用" show-overflow-tooltip min-width="150">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
:disabled="!auth('sys_user_edit')"
|
||||
@@ -115,11 +115,12 @@
|
||||
<el-table-column
|
||||
v-auths="['sys_user_edit', 'userFace_sysUserFace_view', 'sys_user_del']"
|
||||
label="操作"
|
||||
min-width="370"
|
||||
width="380"
|
||||
fixed="right"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="scope">
|
||||
<div style="display: flex">
|
||||
<div style="display: flex; justify-content: center">
|
||||
<!-- 重置密码 -->
|
||||
<popover-input v-model="inputPassword" @confirm="changePassword(scope.row)">
|
||||
<template #default>
|
||||
|
||||
@@ -28,11 +28,10 @@
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
|
||||
<el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
|
||||
</el-tabs>
|
||||
</el-row>
|
||||
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
|
||||
<el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
|
||||
</el-tabs>
|
||||
<el-table
|
||||
v-loading="state.loading"
|
||||
:data="state.dataList"
|
||||
@@ -42,8 +41,8 @@
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="60" fixed="left" />
|
||||
<el-table-column label="姓名" prop="username" fixed="left" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="手机号" prop="userMobile" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="姓名" prop="username" fixed="left" show-overflow-tooltip />
|
||||
<el-table-column label="手机号" prop="userMobile" show-overflow-tooltip />
|
||||
<el-table-column label="部门" prop="deptName" show-overflow-tooltip />
|
||||
<el-table-column label="人脸">
|
||||
<template #default="{ row }">
|
||||
@@ -60,7 +59,7 @@
|
||||
<el-table-column label="操作" min-width="160" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" link icon="VideoPlay" @click="deal(scope.row)">开始处理</el-button>
|
||||
<el-button v-auth="'userFace_sysUserFace_del'" link type="danger" @click="delFace(scope.row)">删除</el-button>
|
||||
<el-button v-auth="'userFace_sysUserFace_del'" link type="danger" icon="Delete" @click="delFace(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -82,6 +81,7 @@ import { useMessage } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { getDicts } from "/@/api/admin/dict"
|
||||
import * as userFaceApi from "/@/api/admin/userFace"
|
||||
import { ElLoading } from "element-plus"
|
||||
|
||||
const { check_status } = useDict("check_status")
|
||||
const queryRef = ref()
|
||||
@@ -90,6 +90,7 @@ const draggableDepTreeRef = ref() // 树组件ref引用
|
||||
const activeName = ref(null)
|
||||
const tabItems = ref<any>([{}])
|
||||
const processDrawerRef = ref()
|
||||
const loading = ref()
|
||||
|
||||
// 定义表格查询、后台调用的API
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
@@ -143,15 +144,27 @@ const taskSubmitEvent = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 全屏loading
|
||||
const loadingStart = () => {
|
||||
loading.value = ElLoading.service({
|
||||
lock: true,
|
||||
text: "删除中...",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
})
|
||||
}
|
||||
|
||||
// 删除人脸
|
||||
const delFace = async (row: any) => {
|
||||
try {
|
||||
await useMessage().delConfirm("是否删除人脸?")
|
||||
await userFaceApi.delObjs([row.id])
|
||||
loadingStart()
|
||||
await userFaceApi.delObjs([row.id]).finally(() => loading.value.close())
|
||||
useMessage().success("删除成功")
|
||||
getDataList()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
} finally {
|
||||
loading.value.close()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user