style(orchestration): 优化事件页面布局和表格样式

master
钟良源 1 month ago
parent 3df2e62c0a
commit c1c11d0d0d

@ -157,35 +157,44 @@ const EventContainer = () => {
{ {
title: '序号', title: '序号',
dataIndex: 'index', dataIndex: 'index',
width: 70,
render: (_, record, index) => ( render: (_, record, index) => (
<div>{index + 1}</div> <div>{index + 1}</div>
) )
}, },
{ {
title: '事件名称', title: '事件名称',
dataIndex: 'name' dataIndex: 'name',
width: 120
}, },
{ {
title: '事件标识', title: '事件标识',
dataIndex: 'topic', dataIndex: 'topic',
width: 150,
render: (_, record) => ( render: (_, record) => (
<div>{record.topic.includes('/') ? record.topic.split('/')[0] : record.topic}</div> <div>{record.topic.includes('/') ? record.topic.split('/')[0] : record.topic}</div>
) )
}, },
{ {
title: '事件描述', title: '事件描述',
dataIndex: 'desc' dataIndex: 'desc',
width: 200
}, },
{ {
title: '订阅者', title: '订阅者',
dataIndex: 'subscribers', dataIndex: 'subscribers',
width: 180,
render: (_, record) => { render: (_, record) => {
if (record?.subscribers && record?.subscribers.length > 0) { if (record?.subscribers && record?.subscribers.length > 0) {
return (<div> return (
<div className={styles['cell-content']}>
{record?.subscribers.map((item, index) => ( {record?.subscribers.map((item, index) => (
<div key={index}>{item.appName}</div> <div key={index} className={styles['cell-item']} title={item.appName}>
{item.appName}
</div>
))} ))}
</div>); </div>
);
} }
else { else {
return <div>-</div>; return <div>-</div>;
@ -195,13 +204,18 @@ const EventContainer = () => {
{ {
title: '发布者', title: '发布者',
dataIndex: 'publisher', dataIndex: 'publisher',
width: 180,
render: (_, record) => { render: (_, record) => {
if (record?.publisher && record?.publisher.length > 0) { if (record?.publisher && record?.publisher.length > 0) {
return (<div> return (
<div className={styles['cell-content']}>
{record?.publisher.map((item, index) => ( {record?.publisher.map((item, index) => (
<div key={index}>{item.appName}</div> <div key={index} className={styles['cell-item']} title={item.appName}>
{item.appName}
</div>
))} ))}
</div>); </div>
);
} }
else { else {
return <div>-</div>; return <div>-</div>;
@ -211,6 +225,7 @@ const EventContainer = () => {
{ {
title: '操作', title: '操作',
dataIndex: 'actions', dataIndex: 'actions',
width: 80,
render: (_, record) => ( render: (_, record) => (
<Popconfirm <Popconfirm
focusLock focusLock
@ -289,7 +304,12 @@ const EventContainer = () => {
</div> </div>
{/*数据列表*/} {/*数据列表*/}
<div className={styles['event-list']}> <div className={styles['event-list']}>
<Table columns={columns} data={filteredEventData} pagination={false} /> <Table
columns={columns}
data={filteredEventData}
pagination={false}
scroll={{ y: 'calc(100vh - 220px)' }}
/>
</div> </div>
{visible && {visible &&

@ -2,11 +2,15 @@
background-color: #ffffff; background-color: #ffffff;
padding: 17px 19px 0 24px; padding: 17px 19px 0 24px;
height: 98%; height: 98%;
display: flex;
flex-direction: column;
overflow: hidden;
.event-header { .event-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 15px; margin-bottom: 15px;
flex-shrink: 0;
.event-title { .event-title {
font-size: 18px; font-size: 18px;
@ -17,6 +21,21 @@
} }
.event-list { .event-list {
flex: 1;
overflow: hidden;
}
// 单元格内容样式
.cell-content {
max-height: 100px;
overflow-y: auto;
}
.cell-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 160px;
line-height: 1.6;
} }
} }
Loading…
Cancel
Save