提交 93c83954 作者: 郁骅焌

发布

上级 8bccdd5c
......@@ -43,6 +43,19 @@ export function getRole(roleId: any) {
})
}
// 角色状态修改
export function changeRoleStatus(roleId: any, status: any) {
const data = {
roleId,
status,
}
return request({
url: '/system/role/changeStatus',
method: 'put',
data,
})
}
// 根据角色ID查询部门树结构
export function deptTreeSelect(roleId: any) {
return request({
......
......@@ -120,7 +120,7 @@
<script lang="ts" setup>
import type { TableInstance } from 'element-plus'
import { doDelete, getList } from '/@/api/roleManagement'
import { changeRoleStatus, doDelete, getList } from '/@/api/roleManagement'
defineOptions({
name: 'RoleManagement',
......@@ -230,6 +230,22 @@ const setSelectRows = (value: string) => {
selectRows.value = value
}
/** 用户状态修改 */
function handleStatusChange(row: any) {
const text = row.status === '0' ? '启用' : '停用'
$baseConfirm(
`确认要"${text}" "${row.userName}"用户吗?`,
null,
async () => {
await changeRoleStatus(row.roleId, row.status)
$baseMessage(`${text}成功`, 'success', 'hey')
},
() => {
row.status = row.status === '0' ? '1' : '0'
}
)
}
/** 新增按钮操作 */
const handleAdd = () => {
editRef.value.showEdit()
......@@ -279,7 +295,8 @@ function handleDataScope(row: any) {
}
/** 分配用户 */
function handleAuthUser(row) {
function handleAuthUser(row: any) {
console.log(row)
// router.push("/system/role-auth/user/" + row.roleId);
}
</script>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论