feat(intelligent-eval): adjust drawer top-bar layout
详情页移除返回列表按钮(抽屉自带关闭),操作按钮右对齐; 报告页保留返回详情,导出 Markdown 按钮右对齐。
This commit is contained in:
parent
1d2c37277c
commit
22cc437e2d
@ -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,10 +109,11 @@ 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>
|
||||
<div style={{ flex: 1 }} />
|
||||
<Space>
|
||||
{ev.status === 'completed' && (
|
||||
<Button type="primary" icon={<FileTextOutlined />} onClick={onOpenReport}>查看报告</Button>
|
||||
)}
|
||||
@ -123,6 +123,7 @@ export default function EvalDetail({ ev, targetName, onBack, onOpenReport, onCha
|
||||
</Popconfirm>
|
||||
)}
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
<Card size="small" title="基本信息" style={sectionCard}>
|
||||
<Descriptions column={3} size="small">
|
||||
|
||||
@ -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 />}
|
||||
|
||||
|
||||
@ -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)}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user