feat(intelligent-eval): adjust drawer top-bar layout

详情页移除返回列表按钮(抽屉自带关闭),操作按钮右对齐;
报告页保留返回详情,导出 Markdown 按钮右对齐。
This commit is contained in:
sinohqb 2026-08-06 00:37:02 +08:00
parent 1d2c37277c
commit 22cc437e2d
3 changed files with 18 additions and 17 deletions

View File

@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react'
import {
Alert, Button, Card, Descriptions, Empty, Input, Modal, Popconfirm, Space, Spin, Tag, message,
} from 'antd'
import { ArrowLeftOutlined, FileTextOutlined, StopOutlined } from '@ant-design/icons'
import { FileTextOutlined, StopOutlined } from '@ant-design/icons'
import { intelligentEvalsApi, type IntelligentEval, type IntelligentEvalSession } from '../../api'
import { colors } from '../../tokens'
import { formatDateTime, shortDateTime } from '../../utils/date'
@ -63,12 +63,11 @@ function PlanView({ ev }: { ev: IntelligentEval }) {
interface EvalDetailProps {
ev: IntelligentEval
targetName: string
onBack: () => void
onOpenReport: () => void
onChanged: () => void
}
export default function EvalDetail({ ev, targetName, onBack, onOpenReport, onChanged }: EvalDetailProps) {
export default function EvalDetail({ ev, targetName, onOpenReport, onChanged }: EvalDetailProps) {
const [busy, setBusy] = useState(false)
const [rejectOpen, setRejectOpen] = useState(false)
const [feedback, setFeedback] = useState('')
@ -110,19 +109,21 @@ export default function EvalDetail({ ev, targetName, onBack, onOpenReport, onCha
return (
<div style={{ height: '100%', overflowY: 'auto', padding: '0 16px 16px' }}>
<Space style={{ marginBottom: 12 }}>
<Button icon={<ArrowLeftOutlined />} onClick={onBack}></Button>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 12 }}>
<span style={{ fontSize: 16, fontWeight: 600, color: colors.text }}>{ev.name}</span>
<Tag color={meta.color}>{meta.label}</Tag>
{ev.status === 'completed' && (
<Button type="primary" icon={<FileTextOutlined />} onClick={onOpenReport}></Button>
)}
{(ev.status === 'pending_approval' || ev.status === 'executing') && (
<Popconfirm title="取消该智能评估?" onConfirm={cancel}>
<Button danger icon={<StopOutlined />} loading={busy}></Button>
</Popconfirm>
)}
</Space>
<div style={{ flex: 1 }} />
<Space>
{ev.status === 'completed' && (
<Button type="primary" icon={<FileTextOutlined />} onClick={onOpenReport}></Button>
)}
{(ev.status === 'pending_approval' || ev.status === 'executing') && (
<Popconfirm title="取消该智能评估?" onConfirm={cancel}>
<Button danger icon={<StopOutlined />} loading={busy}></Button>
</Popconfirm>
)}
</Space>
</div>
<Card size="small" title="基本信息" style={sectionCard}>
<Descriptions column={3} size="small">

View File

@ -146,17 +146,18 @@ export default function EvalReport({ ev, onBack }: EvalReportProps) {
return (
<div style={{ height: '100%', overflowY: 'auto', padding: '0 16px 16px' }}>
<Space style={{ marginBottom: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 12 }}>
<Button icon={<ArrowLeftOutlined />} onClick={onBack}></Button>
<span style={{ fontSize: 16, fontWeight: 600, color: colors.text }}>
{ev.name} ·
</span>
<div style={{ flex: 1 }} />
{report && (
<Button icon={<DownloadOutlined />} loading={exporting} onClick={exportMarkdown}>
Markdown
</Button>
)}
</Space>
</div>
{reportLoading && <Spin />}

View File

@ -197,7 +197,6 @@ export default function IntelligentEvalsPage() {
<EvalDetail
ev={selected}
targetName={targetName(selected.target_id)}
onBack={closeDrawer}
onOpenReport={() => setDrawerView('report')}
onChanged={() => setDetailTick((t) => t + 1)}
/>