feat(assets): 优化移动端分析体验并记录 AI 提问日志
This commit is contained in:
@@ -26,7 +26,12 @@ import {
|
||||
compactAnalysisPath,
|
||||
} from "./result-presentation";
|
||||
|
||||
import { useMobileLayout } from '../useMobileLayout';
|
||||
import { mobileResultSummary } from './mobile-presentation';
|
||||
import { ResultActions } from './ResultActions';
|
||||
|
||||
function Records({ rows, flow }: { rows: AssistantRow[]; flow: boolean }) {
|
||||
const mobile = useMobileLayout();
|
||||
const [page, setPage] = useState(0),
|
||||
[search, setSearch] = useState("");
|
||||
const filtered = rows.filter((r) =>
|
||||
@@ -52,7 +57,7 @@ function Records({ rows, flow }: { rows: AssistantRow[]; flow: boolean }) {
|
||||
</label>
|
||||
<span>{filtered.length}条</span>
|
||||
</div>
|
||||
<div className="aq-table-scroll">
|
||||
{mobile ? <div className="aq-mobile-data-list" aria-label="车辆明细">{filtered.slice(current * 8, current * 8 + 8).map(r => <article className="aq-mobile-data-row" key={r.id}><div className="aq-mobile-record-heading"><strong>{r.plate || '未登记车牌'}</strong><span>{flow ? r.event : r.status}</span></div><p>{r.type} · {r.city || '未标注城市'}</p><details><summary>更多资料</summary><dl>{[['型号', r.model], ['部门', r.department], ...(flow ? [['日期', r.date]] : [['库存子集', r.abnormal ? '异动' : r.pending ? '待交车' : '—'], ['异动类型', r.abnormalType], ['预计完成时间', r.targetCompletionTime]])].map(([label,value]) => <div key={label}><dt>{label}</dt><dd>{value || '—'}</dd></div>)}</dl></details></article>)}</div> : <div className="aq-table-scroll">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -90,7 +95,7 @@ function Records({ rows, flow }: { rows: AssistantRow[]; flow: boolean }) {
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>}
|
||||
{!filtered.length && <p className="aq-no-data">没有符合条件的明细</p>}
|
||||
<div className="aq-pagination">
|
||||
<span>
|
||||
@@ -148,6 +153,7 @@ function ResultViewContent({
|
||||
showCorrection,
|
||||
display: preferredDisplay,
|
||||
}: ResultViewProps) {
|
||||
const mobile = useMobileLayout();
|
||||
const [expandedGroupResult, setExpandedGroupResult] = useState<string | null>(
|
||||
null,
|
||||
),
|
||||
@@ -360,7 +366,7 @@ function ResultViewContent({
|
||||
className="aq-answer"
|
||||
id={result.resultId ? `aq-answer-${result.resultId}` : undefined}
|
||||
>
|
||||
{result.summary}
|
||||
{mobile ? mobileResultSummary(result) : result.summary}
|
||||
</p>
|
||||
{!result.conciseCount && !!visibleMetrics.length && (
|
||||
<div className="aq-metrics aq-primary-metrics">
|
||||
@@ -790,6 +796,8 @@ function ResultViewContent({
|
||||
点击分组继续下钻 · 筛选条件自动用于下一次追问
|
||||
</p>
|
||||
</div>
|
||||
) : mobile ? (
|
||||
<div className="aq-mobile-data-list" aria-label="分组明细">{result.groups.map(g => <article className="aq-mobile-data-row" key={JSON.stringify(g.keys)}><div className="aq-mobile-data-values"><div><span>分组</span><strong>{g.name}</strong></div><div><span>车辆数</span><strong>{g.count}</strong></div><div><span>占比</span><strong>{g.share == null ? '—' : `${g.share}%`}</strong></div></div><div className="aq-mobile-data-footer">{plan.category !== 'operating' && <details><summary>更多指标</summary><p>运营率 {g.rate}% · 异动 {g.abnormal ?? '—'} · 待交车 {g.pending ?? '—'}</p></details>}<button disabled={disabled || !Object.keys(g.keys || {}).length} aria-label={`下钻${g.name}`} onClick={() => run({ type: 'drill', keys: g.keys || {} }, `下钻${g.name}`)}>继续分析<ArrowUpRight size={15} /></button></div></article>)}</div>
|
||||
) : (
|
||||
<div className="aq-table-scroll">
|
||||
<table>
|
||||
@@ -859,6 +867,7 @@ function ResultViewContent({
|
||||
<summary>
|
||||
统计口径、权限与数据时间{result.warning ? " · 有补充说明" : ""}
|
||||
</summary>
|
||||
{mobile && <p>{result.summary}</p>}
|
||||
<p>
|
||||
公司:{scope.company} · 权限:{scope.permission}
|
||||
</p>
|
||||
@@ -877,7 +886,14 @@ function ResultViewContent({
|
||||
))}
|
||||
<p>来源:{result.source}</p>
|
||||
</details>
|
||||
<div className="aq-answer-actions">
|
||||
<ResultActions primary={plan.kind !== "clarify" && (
|
||||
<button
|
||||
disabled={disabled || active || !!correctionMessage}
|
||||
onClick={activate}
|
||||
>
|
||||
{mobile ? (active ? "当前追问范围" : "继续追问") : (active ? "正在基于此结果追问" : "基于此结果追问")}
|
||||
</button>
|
||||
)}>
|
||||
{plan.kind !== "clarify" && (!result.conciseCount || result.metrics[0]?.value > 0) && (
|
||||
<button
|
||||
disabled={disabled || saving}
|
||||
@@ -888,14 +904,7 @@ function ResultViewContent({
|
||||
导出明细
|
||||
</button>
|
||||
)}
|
||||
{plan.kind !== "clarify" && (
|
||||
<button
|
||||
disabled={disabled || active || !!correctionMessage}
|
||||
onClick={activate}
|
||||
>
|
||||
{active ? "正在基于此结果追问" : "基于此结果追问"}
|
||||
</button>
|
||||
)}
|
||||
|
||||
<button disabled={saving || flagged} onClick={() => void flag()}>
|
||||
{flagged ? "已记录" : "未解决我的问题"}
|
||||
</button>
|
||||
@@ -910,7 +919,7 @@ function ResultViewContent({
|
||||
<Copy size={14} />
|
||||
复制完整结果
|
||||
</button>
|
||||
</div>
|
||||
</ResultActions>
|
||||
{notice && (
|
||||
<p className="aq-notice" role="status">
|
||||
{notice}
|
||||
|
||||
Reference in New Issue
Block a user