2024-01-22 15:20:30 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="default-main">
|
|
|
|
|
<div class="custom-table-header">
|
2024-02-01 16:19:28 +08:00
|
|
|
<div class="title">待审核用户</div>
|
2024-01-22 15:20:30 +08:00
|
|
|
<el-button :icon="Check" type="primary" @click="addRole" class="ml10">审核通过</el-button>
|
|
|
|
|
</div>
|
2024-01-31 14:14:51 +08:00
|
|
|
<Table ref="tableRef" />
|
2024-01-22 15:20:30 +08:00
|
|
|
</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: [
|
2024-01-31 14:14:51 +08:00
|
|
|
// { width: '60', type: 'checkbox' },
|
2024-01-22 15:20:30 +08:00
|
|
|
{ title: '名称', field: 'name' },
|
|
|
|
|
{ title: '登录名', field: 'loginName' },
|
|
|
|
|
{ title: '角色', field: 'roleName' },
|
2025-04-28 09:14:56 +08:00
|
|
|
// { title: '部门', field: 'deptId' },
|
2024-01-22 15:20:30 +08:00
|
|
|
{ title: '电话', field: 'phoneShow' },
|
2025-07-15 16:31:06 +08:00
|
|
|
{ title: '注册时间', field: 'registerTime', sortable: true },
|
2024-01-22 15:20:30 +08:00
|
|
|
{ title: '类型', field: 'casualUserName' },
|
|
|
|
|
{ title: '状态', field: 'stateName' },
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
2024-01-31 14:14:51 +08:00
|
|
|
width: '180',
|
2024-01-22 15:20:30 +08:00
|
|
|
render: 'buttons',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
name: 'edit',
|
|
|
|
|
title: '审核通过',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-Check',
|
2024-01-30 14:11:29 +08:00
|
|
|
render: 'basicButton',
|
2024-01-22 15:20:30 +08:00
|
|
|
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>
|