[Optimize] 健康检查项时间和结果显示(didi#930)

This commit is contained in:
erge
2023-02-20 16:24:45 +08:00
committed by lucasun
parent ae8cc3092b
commit 18e3fbf41d
2 changed files with 31 additions and 23 deletions

View File

@@ -215,7 +215,7 @@ export const getDetailColumn = (clusterId: number) => [
width: 190,
dataIndex: 'updateTime',
render: (text: string) => {
return moment(text).format(timeFormat);
return text ? moment(text).format(timeFormat) : '-';
},
},
{
@@ -224,21 +224,25 @@ export const getDetailColumn = (clusterId: number) => [
width: 280,
// eslint-disable-next-line react/display-name
render: (passed: boolean, record: any) => {
if (passed) {
if (record?.updateTime) {
if (passed) {
return (
<>
<IconFont type="icon-zhengchang" />
<span style={{ marginLeft: 4 }}></span>
</>
);
}
return (
<>
<IconFont type="icon-zhengchang" />
<span style={{ marginLeft: 4 }}></span>
</>
<div style={{ display: 'flex', alignItems: 'center', width: '240px' }}>
<IconFont type="icon-yichang" />
<div style={{ marginLeft: 4, marginRight: 6, flexShrink: 0 }}></div>
<TagsWithHide list={record.notPassedResNameList || []} expandTagContent="更多" />
</div>
);
} else {
return '-';
}
return (
<div style={{ display: 'flex', alignItems: 'center', width: '240px' }}>
<IconFont type="icon-yichang" />
<div style={{ marginLeft: 4, marginRight: 6, flexShrink: 0 }}></div>
<TagsWithHide list={record.notPassedResNameList || []} expandTagContent="更多" />
</div>
);
},
},
];