优化用户

This commit is contained in:
zjl 2024-12-18 09:19:19 +08:00
parent 323de1b4ea
commit 65cc264915

View File

@ -24,7 +24,7 @@ export const columns = [
{ {
label: '头像', label: '头像',
prop: 'avatar', prop: 'avatar',
minWidth: 100, minWidth: 80,
render(record) { render(record) {
return h(ElAvatar, { return h(ElAvatar, {
size: 48, size: 48,
@ -37,7 +37,7 @@ export const columns = [
{ {
label: '性别', label: '性别',
prop: 'gender', prop: 'gender',
minWidth: 100, minWidth: 80,
render(record) { render(record) {
let typeText = ''; let typeText = '';
let color = ''; let color = '';
@ -71,18 +71,27 @@ export const columns = [
{ {
label: '手机号', label: '手机号',
prop: 'mobile', prop: 'mobile',
minWidth: 160, minWidth: 120,
}, },
{ {
label: '用户角色', label: '用户角色',
prop: 'role', prop: 'role',
minWidth: 100, minWidth: 250,
render(record) { render(record) {
let roleNames = ''; let roleNames = '';
if (record.row.roles.length > 0) { if (record.row.roles.length > 0) {
roleNames = record.row.roles.map((role) => role.name).join(','); roleNames = record.row.roles.map((role) => role.name).join(',');
} }
return h('span', roleNames || '-'); // return h('span', roleNames || '-');
return h(
ElTag,
{
type: 'primary',
},
{
default: () => roleNames,
},
);
}, },
}, },
{ {
@ -98,7 +107,7 @@ export const columns = [
{ {
label: '部门', label: '部门',
prop: 'deptName', prop: 'deptName',
minWidth: 160, minWidth: 100,
}, },
{ {
label: '状态', label: '状态',