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 { import {
Alert, Button, Card, Descriptions, Empty, Input, Modal, Popconfirm, Space, Spin, Tag, message, Alert, Button, Card, Descriptions, Empty, Input, Modal, Popconfirm, Space, Spin, Tag, message,
} from 'antd' } 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 { intelligentEvalsApi, type IntelligentEval, type IntelligentEvalSession } from '../../api'
import { colors } from '../../tokens' import { colors } from '../../tokens'
import { formatDateTime, shortDateTime } from '../../utils/date' import { formatDateTime, shortDateTime } from '../../utils/date'
@ -63,12 +63,11 @@ function PlanView({ ev }: { ev: IntelligentEval }) {
interface EvalDetailProps { interface EvalDetailProps {
ev: IntelligentEval ev: IntelligentEval
targetName: string targetName: string
onBack: () => void
onOpenReport: () => void onOpenReport: () => void
onChanged: () => 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 [busy, setBusy] = useState(false)
const [rejectOpen, setRejectOpen] = useState(false) const [rejectOpen, setRejectOpen] = useState(false)
const [feedback, setFeedback] = useState('') const [feedback, setFeedback] = useState('')
@ -110,10 +109,11 @@ export default function EvalDetail({ ev, targetName, onBack, onOpenReport, onCha
return ( return (
<div style={{ height: '100%', overflowY: 'auto', padding: '0 16px 16px' }}> <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> <span style={{ fontSize: 16, fontWeight: 600, color: colors.text }}>{ev.name}</span>
<Tag color={meta.color}>{meta.label}</Tag> <Tag color={meta.color}>{meta.label}</Tag>
<div style={{ flex: 1 }} />
<Space>
{ev.status === 'completed' && ( {ev.status === 'completed' && (
<Button type="primary" icon={<FileTextOutlined />} onClick={onOpenReport}></Button> <Button type="primary" icon={<FileTextOutlined />} onClick={onOpenReport}></Button>
)} )}
@ -123,6 +123,7 @@ export default function EvalDetail({ ev, targetName, onBack, onOpenReport, onCha
</Popconfirm> </Popconfirm>
)} )}
</Space> </Space>
</div>
<Card size="small" title="基本信息" style={sectionCard}> <Card size="small" title="基本信息" style={sectionCard}>
<Descriptions column={3} size="small"> <Descriptions column={3} size="small">

View File

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

View File

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