fix: remove nested button patterns across all pages, remove Dashboard gantt

This commit is contained in:
2026-07-05 21:35:03 +08:00
parent 1b49d971ae
commit 940b587df9
11 changed files with 214 additions and 288 deletions

View File

@@ -215,22 +215,20 @@ const OccupanciesPage: React.FC = () => {
) : (
<Space>
<Tag>退宿</Tag>
<PermissionButton permission="occupancy:delete">
<Popconfirm
title="确定删除此记录?"
onConfirm={async () => {
try {
await api.delete(`/occupancies/${record.id}`);
message.success('删除成功');
fetchData();
} catch (e: any) {
message.error(e?.message || '删除失败');
}
}}
>
<Button size="small" danger icon={<DeleteOutlined />} />
</Popconfirm>
</PermissionButton>
<Popconfirm
title="确定删除此记录?"
onConfirm={async () => {
try {
await api.delete(`/occupancies/${record.id}`);
message.success('删除成功');
fetchData();
} catch (e: any) {
message.error(e?.message || '删除失败');
}
}}
>
<PermissionButton permission="occupancy:delete" size="small" danger icon={<DeleteOutlined />} />
</Popconfirm>
</Space>
),
},
@@ -419,23 +417,22 @@ const OccupanciesPage: React.FC = () => {
退宿
</PermissionButton>
) : (
<PermissionButton permission="occupancy:delete">
<Popconfirm
title={`确定删除选中的 ${selectedRowKeys.length} 条入住记录?在住记录会自动跳过`}
onConfirm={handleBatchDelete}
okText="删除"
cancelText="取消"
<Popconfirm
title={`确定删除选中的 ${selectedRowKeys.length} 条入住记录?在住记录会自动跳过`}
onConfirm={handleBatchDelete}
okText="删除"
cancelText="取消"
>
<PermissionButton
permission="occupancy:delete"
danger
size="small"
icon={<DeleteOutlined />}
style={{ marginLeft: 12 }}
>
<Button
danger
size="small"
icon={<DeleteOutlined />}
style={{ marginLeft: 12 }}
>
</Button>
</Popconfirm>
</PermissionButton>
</PermissionButton>
</Popconfirm>
)}
<Button size="small" onClick={() => setSelectedRowKeys([])} style={{ marginLeft: 8 }}>