优化代码

pull/65/head
awenes 1 year ago
parent 1027af1d53
commit 8c003b9d1d

@ -39,7 +39,6 @@ import {
Table, Table,
Tooltip, Tooltip,
Typography, Typography,
Tag,
Popover, Popover,
} from 'antd'; } from 'antd';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
@ -185,46 +184,34 @@ export default (props: UserListProps) => {
search: false, search: false,
ellipsis: true, ellipsis: true,
render: (_, record) => { render: (_, record) => {
console.log(record.primaryOrgDisplayPath);
return ( return (
<Popover <Popover
key="pop" key="pop"
title={ title={intl.formatMessage({
record.primaryOrgDisplayPath && ( id: 'pages.account.user_list.user.columns.org_display_path',
<Tag color={'geekblue'} key={record.orgDisplayPath}> })}
{record.primaryOrgDisplayPath}
</Tag>
)
}
content={ content={
<Space direction="vertical" size="small" style={{ display: 'flex' }}> <>
{record.orgDisplayPath?.split(',')?.map((p: string) => { {record.primaryOrgDisplayPath && (
return ( <Space key="primary_path">{record.primaryOrgDisplayPath}</Space>
<Tag color={'green'} key={p}> )}
{p} {record.orgDisplayPath && (
</Tag> <Space key="path" direction="vertical" size="small" style={{ display: 'flex' }}>
); {record.orgDisplayPath?.split(',')?.map((p: string) => {
})} return p;
</Space> })}
</Space>
)}
</>
} }
> >
{record.primaryOrgDisplayPath && ( {record.primaryOrgDisplayPath && (
<Space key="primary_path"> <Space key="primary_path">{record.primaryOrgDisplayPath}</Space>
{
<Tag color={'geekblue'} key={record.primaryOrgDisplayPath}>
{record.primaryOrgDisplayPath}
</Tag>
}
</Space>
)} )}
{record.orgDisplayPath && ( {record.orgDisplayPath && (
<Space key="path" direction="vertical" size="small" style={{ display: 'flex' }}> <Space key="path" direction="vertical" size="small" style={{ display: 'flex' }}>
{record.orgDisplayPath?.split(',')?.map((p: string) => { {record.orgDisplayPath?.split(',')?.map((p: string) => {
return ( return p;
<Tag color={'green'} key={p}>
{p}
</Tag>
);
})} })}
</Space> </Space>
)} )}

Loading…
Cancel
Save