fix(ui): move eval delete to drawer header to stop row click opening detail
All checks were successful
CI / test (push) Successful in 3m23s
All checks were successful
CI / test (push) Successful in 3m23s
This commit is contained in:
parent
8021eab65e
commit
5f116700d7
@ -146,6 +146,7 @@ export default function IntelligentEvalsPage() {
|
|||||||
const handleDelete = async (id: string) => {
|
const handleDelete = async (id: string) => {
|
||||||
await intelligentEvalsApi.remove(id)
|
await intelligentEvalsApi.remove(id)
|
||||||
message.success('已删除')
|
message.success('已删除')
|
||||||
|
closeDrawer()
|
||||||
void reloadList()
|
void reloadList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,22 +191,9 @@ export default function IntelligentEvalsPage() {
|
|||||||
render: (v: string | null) => (v ? formatDateTime(v) : '—'),
|
render: (v: string | null) => (v ? formatDateTime(v) : '—'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作', key: 'action', width: 130, fixed: 'right' as const,
|
title: '操作', key: 'action', width: 88, fixed: 'right' as const,
|
||||||
render: (_, ev) => (
|
render: (_, ev) => (
|
||||||
<Space size={4}>
|
<Button size="small" onClick={() => openDetail(ev.id)}>查看</Button>
|
||||||
<Button size="small" onClick={() => openDetail(ev.id)}>查看</Button>
|
|
||||||
{TERMINAL_STATUSES.has(ev.status) && (
|
|
||||||
<Popconfirm
|
|
||||||
title="确认删除"
|
|
||||||
description="删除后不可恢复,确定要删除该评估吗?"
|
|
||||||
onConfirm={() => handleDelete(ev.id)}
|
|
||||||
okText="删除"
|
|
||||||
cancelText="取消"
|
|
||||||
>
|
|
||||||
<Button size="small" danger icon={<DeleteOutlined />} onClick={(e) => e.stopPropagation()} />
|
|
||||||
</Popconfirm>
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@ -314,6 +302,17 @@ export default function IntelligentEvalsPage() {
|
|||||||
<Button danger icon={<StopOutlined />}>取消</Button>
|
<Button danger icon={<StopOutlined />}>取消</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
)}
|
)}
|
||||||
|
{TERMINAL_STATUSES.has(selected.status) && (
|
||||||
|
<Popconfirm
|
||||||
|
title="确认删除"
|
||||||
|
description="删除后不可恢复,确定要删除该评估吗?"
|
||||||
|
onConfirm={() => void handleDelete(selected.id)}
|
||||||
|
okText="删除"
|
||||||
|
cancelText="取消"
|
||||||
|
>
|
||||||
|
<Button danger icon={<DeleteOutlined />}>删除</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user