feat: 新增用户角色展示

This commit is contained in:
leiqiaochu 2023-09-27 16:31:31 +08:00
parent c46122d08a
commit 3afcac7c71
3 changed files with 32 additions and 5 deletions

View File

@ -36,4 +36,6 @@ export const updatePassword_api = (data: { id: string, password: string }) => se
// 修改用户状态
export const changeUserStatus_api = (data: object) => server.patch(`/user`,data);
// 删除用户
export const deleteUser_api = (id: string) => server.remove(`/user/${id}`);
export const deleteUser_api = (id: string) => server.remove(`/user/${id}`);
// 查询角色不分页
export const queryRole_api = (data: any): Promise<any> => server.post(`/role/_query/no-paging`, data)

View File

@ -12,7 +12,7 @@
}}</span></div>
</div>
<div class="contain">
<pro-search :columns="columns" @search="handleSearch" target="system_dictionary"/>
<pro-search :columns="columns" @search="handleSearch" target="system_dictionary" />
<JProTable :columns="columns" model="TABLE" :request="queryItem" :params="params" ref="tableRef">
<template #headerTitle>
<PermissionButton type="primary" @click="add" hasPermission="system/Dictionary:add">
@ -65,8 +65,13 @@ const columns = [
title: '序号',
dataIndex: 'ordinal',
key: 'ordinal',
},
{
title: '检索码',
dataIndex: '',
hideInTable: true,
search: {
type: 'number'
type: 'string'
}
},
{
@ -209,7 +214,6 @@ watch(() => props?.data?.id, () => {
})
</script>
<style lang="less" scoped>
.des_head {
padding: 10px 20px;
background-color: rgb(242, 242, 242);

View File

@ -134,6 +134,7 @@ import {
getUserList_api,
changeUserStatus_api,
deleteUser_api,
queryRole_api
} from '@/api/system/user';
import { onlyMessage } from '@/utils/comm';
@ -184,7 +185,27 @@ const columns = [
dataIndex: 'roleList',
key: 'roleList',
search:{
type:'string'
type:'select',
rename:'id$in-dimension$role',
options:() =>
new Promise((resolve)=>{
queryRole_api(
{
paging:false,
sorts: [
{ name: 'createTime', order: 'desc' },
{ name: 'id', order: 'desc' },
]
}
).then((resp:any)=>{
resolve(
resp.result.map((item: dictType) => ({
label: item.name,
value: item.id,
})),
);
})
})
},
scopedSlots: true,
},