feat: 新增用户角色展示
This commit is contained in:
parent
c46122d08a
commit
3afcac7c71
|
@ -37,3 +37,5 @@ export const updatePassword_api = (data: { id: string, password: string }) => se
|
||||||
export const changeUserStatus_api = (data: object) => server.patch(`/user`,data);
|
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)
|
|
@ -12,7 +12,7 @@
|
||||||
}}</span></div>
|
}}</span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contain">
|
<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">
|
<JProTable :columns="columns" model="TABLE" :request="queryItem" :params="params" ref="tableRef">
|
||||||
<template #headerTitle>
|
<template #headerTitle>
|
||||||
<PermissionButton type="primary" @click="add" hasPermission="system/Dictionary:add">
|
<PermissionButton type="primary" @click="add" hasPermission="system/Dictionary:add">
|
||||||
|
@ -65,8 +65,13 @@ const columns = [
|
||||||
title: '序号',
|
title: '序号',
|
||||||
dataIndex: 'ordinal',
|
dataIndex: 'ordinal',
|
||||||
key: 'ordinal',
|
key: 'ordinal',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '检索码',
|
||||||
|
dataIndex: '',
|
||||||
|
hideInTable: true,
|
||||||
search: {
|
search: {
|
||||||
type: 'number'
|
type: 'string'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -209,7 +214,6 @@ watch(() => props?.data?.id, () => {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
||||||
.des_head {
|
.des_head {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
background-color: rgb(242, 242, 242);
|
background-color: rgb(242, 242, 242);
|
||||||
|
|
|
@ -134,6 +134,7 @@ import {
|
||||||
getUserList_api,
|
getUserList_api,
|
||||||
changeUserStatus_api,
|
changeUserStatus_api,
|
||||||
deleteUser_api,
|
deleteUser_api,
|
||||||
|
queryRole_api
|
||||||
} from '@/api/system/user';
|
} from '@/api/system/user';
|
||||||
import { onlyMessage } from '@/utils/comm';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
|
@ -184,7 +185,27 @@ const columns = [
|
||||||
dataIndex: 'roleList',
|
dataIndex: 'roleList',
|
||||||
key: 'roleList',
|
key: 'roleList',
|
||||||
search:{
|
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,
|
scopedSlots: true,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue