fix: 链式写法优化
This commit is contained in:
@@ -72,9 +72,9 @@ function renderBodyCell({
|
||||
if (column.key === 'action') {
|
||||
const status = record.status;
|
||||
|
||||
// 待审核:查看 + 审核
|
||||
if (status === 'pending') {
|
||||
return (
|
||||
// 待审核:查看 + 审核
|
||||
(status === 'pending' && (
|
||||
<Space>
|
||||
<Button type="link" size="small" onClick={() => onView(record)}>
|
||||
查看
|
||||
@@ -83,12 +83,9 @@ function renderBodyCell({
|
||||
审核
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
)) ||
|
||||
// 报名中:查看 + 下架
|
||||
if (status === 'enrolling') {
|
||||
return (
|
||||
(status === 'enrolling' && (
|
||||
<Space>
|
||||
<Button type="link" size="small" onClick={() => onView(record)}>
|
||||
查看
|
||||
@@ -97,12 +94,9 @@ function renderBodyCell({
|
||||
下架
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
)) ||
|
||||
// 已下架:查看 + 上架
|
||||
if (status === 'removed') {
|
||||
return (
|
||||
(status === 'removed' && (
|
||||
<Space>
|
||||
<Button type="link" size="small" onClick={() => onView(record)}>
|
||||
查看
|
||||
@@ -116,14 +110,12 @@ function renderBodyCell({
|
||||
上架
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
)) || (
|
||||
// 审核不通过 / 已删除:仅查看
|
||||
return (
|
||||
<Button type="link" size="small" onClick={() => onView(record)}>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user