用户审核管理

This commit is contained in:
仲么了
2024-01-22 15:20:30 +08:00
parent 0bf750e5ae
commit e13c9080e6
7 changed files with 273 additions and 96 deletions

View File

@@ -0,0 +1,136 @@
<template>
<div class="default-main">
<div class="custom-table-header">
<div style="flex: 1; font-weight: 700">待审核用户</div>
<el-button :icon="Check" type="primary" @click="addRole" class="ml10">审核通过</el-button>
</div>
<Table ref="tableRef" @checkbox-all="" @checkbox-change="" />
</div>
</template>
<script setup lang="ts">
import { Check } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { ElMessage } from 'element-plus'
import { checkUser } from '@/api/user-boot/user'
defineOptions({
name: 'auth/audit'
})
const tableStore = new TableStore({
showPage: false,
method: 'POST',
url: '/user-boot/user/checkUserList',
column: [
{ width: '60', type: 'checkbox' },
{ title: '名称', field: 'name' },
{ title: '登录名', field: 'loginName' },
{ title: '角色', field: 'roleName' },
{ title: '部门', field: 'deptId' },
{ title: '电话', field: 'phoneShow' },
{ title: '注册时间', field: 'registerTime' },
{ title: '类型', field: 'casualUserName' },
{ title: '状态', field: 'stateName' },
{
title: '操作',
width: '130',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核通过',
type: 'primary',
icon: 'el-icon-Check',
render: 'tipButton',
click: row => {
checkUser([row.id]).then(res => {
tableStore.index()
ElMessage.success('操作成功')
})
}
},
{
name: 'del',
title: '审核不通过',
type: 'danger',
icon: 'el-icon-Close',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定不通过该角色吗?'
},
click: row => {
ElMessage.warning('功能尚未实现')
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptId = item.deptId || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
switch (item.state) {
case 0:
item.stateName = '注销'
break
case 1:
item.stateName = '正常'
break
case 2:
item.stateName = '锁定'
break
case 3:
item.stateName = '待审核'
break
case 4:
item.stateName = '休眠'
break
case 5:
item.stateName = '密码过期'
break
default:
item.stateName = '/'
break
}
})
}
})
tableStore.table.params.casualUser = 0
tableStore.table.params.searchState = 0
tableStore.table.params.searchValue = ''
tableStore.table.params.searchBeginTime = ''
tableStore.table.params.searchEndTime = ''
tableStore.table.params.sortBy = ''
tableStore.table.params.orderBy = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const addRole = () => {
if (!tableStore.table.selection.length) {
ElMessage.warning('请选择用户')
return
}
checkUser(tableStore.table.selection.map((item: any) => item.id)).then(res => {
tableStore.index()
ElMessage.success('操作成功')
})
}
</script>