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 {
|
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">
|
||||||
|
|||||||
@ -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 />}
|
||||||
|
|
||||||
|
|||||||
@ -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)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user