fix: 画像页补充英文key/value翻译,版本历史限制3个
CI / 后端测试 (push) Has been cancelled
CI / 前端构建 (push) Has been cancelled

- 补充 key_facts 的 key 映射(evidence/time_range/region_policy等)
- 补充 key_facts 的 value 映射(contract review/employer等)
- 版本历史只显示最近3个版本

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
selfrelease
2026-08-31 15:07:00 +08:00
co-authored by Devin
parent f9d2d0687e
commit ddf0fa57ee
2 changed files with 71 additions and 4 deletions
+9 -2
View File
@@ -42,6 +42,13 @@ export function Experts() {
useEffect(load, [filter]) useEffect(load, [filter])
// 已联系的排前面
const sortedExperts = [...experts].sort((a, b) => {
if (a.connected && !b.connected) return -1
if (!a.connected && b.connected) return 1
return 0
})
/** 建立服务联系 */ /** 建立服务联系 */
const handleConnect = async (ex: Expert) => { const handleConnect = async (ex: Expert) => {
setConnecting(ex.id) setConnecting(ex.id)
@@ -79,7 +86,7 @@ export function Experts() {
))} ))}
</div> </div>
{experts.length === 0 ? ( {sortedExperts.length === 0 ? (
<EmptyState <EmptyState
title="暂无专家" title="暂无专家"
description="该分类下还没有可用专家" description="该分类下还没有可用专家"
@@ -87,7 +94,7 @@ export function Experts() {
/> />
) : ( ) : (
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3"> <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
{experts.map((ex) => { {sortedExperts.map((ex) => {
const stars = (ex.rate / 100).toFixed(1) const stars = (ex.rate / 100).toFixed(1)
const isConnected = !!ex.connected const isConnected = !!ex.connected
return ( return (
+62 -2
View File
@@ -240,6 +240,39 @@ const KEY_FACT_LABELS: Record<string, string> = {
judicial_interpretation: '司法解释', judicial_interpretation: '司法解释',
precedent_case: '先例案例', precedent_case: '先例案例',
legislation_reference: '法律依据', legislation_reference: '法律依据',
// 补充:AI 分析维度生成的 key
evidence: '证据',
amount: '涉及金额',
party: '对方当事人',
timeline: '时间线',
contract: '合同',
scale: '决策规模',
cashflow: '现金流',
alternatives: '备选方案',
market: '市场状况',
team: '团队',
risk_tolerance: '风险承受',
profitability: '盈利能力',
situation: '情境',
people: '涉及人员',
duration: '持续时间',
attempt: '已尝试方式',
goal: '期望结果',
feeling: '情绪状态',
trigger: '触发事件',
time_range: '时间范围',
region_policy: '地区政策',
employer_status: '雇主身份',
has_written_contract_agreement: '是否有书面合同',
event_occurrence_and_current_status: '事件发生及现状',
notification_negotiation: '通知与协商',
labor_contract: '劳动合同',
performance_evaluation: '绩效评估',
salary_basis: '薪资计算依据',
legal_provisions: '法律条款',
alternative_plan: '备选方案',
replacement_plan: '替代方案',
financial_situation: '财务状况',
} }
/** key_facts 的值中文映射 */ /** key_facts 的值中文映射 */
@@ -265,6 +298,33 @@ const KEY_FACT_VALUE_LABELS: Record<string, string> = {
...RISK_LABELS, ...RISK_LABELS,
...ROLE_LABELS, ...ROLE_LABELS,
...INDUSTRY_LABELS, ...INDUSTRY_LABELS,
// 补充值翻译
employer: '雇主',
employee: '员工',
'contract review': '合同审查',
'work-life balance': '工作生活平衡',
'has growth potential': '有增长潜力',
'separate financing': '单独融资',
'change product line': '改变产品线',
'compulsory payment': '强制缴纳',
'can terminate if unqualified': '不合格可以辞退',
'can dismiss if unqualified': '不合格可以解除合同',
'in negotiation': '在协商',
'loss 1 million': '亏损100万',
'has written contract': '有书面合同',
'no written contract': '无书面合同',
'limited company': '有限公司',
'not capable': '不具备',
'can terminate': '可以解除',
'yes, recognized': '是,已认定',
'incompetent': '不胜任',
'communicated': '沟通了',
'not communicated': '未沟通',
'clear standards': '有明确评估标准和记录',
'6 months ago': '6个月前',
'last year': '去年',
'has ended': '已结束',
'yes, mandatory': '是,强制',
} }
/** 场景中文映射 */ /** 场景中文映射 */
@@ -488,7 +548,7 @@ export function MyProfile() {
<div className="mb-2 flex items-center gap-2 px-1"> <div className="mb-2 flex items-center gap-2 px-1">
<History className="h-4 w-4 text-muted-foreground" aria-hidden /> <History className="h-4 w-4 text-muted-foreground" aria-hidden />
<h3 className="text-sm font-semibold">版本历史</h3> <h3 className="text-sm font-semibold">版本历史</h3>
<span className="text-xs text-muted-foreground">{history.length} 个版本</span> <span className="text-xs text-muted-foreground">最近 3 个版本</span>
</div> </div>
{history.length === 0 ? ( {history.length === 0 ? (
<EmptyState <EmptyState
@@ -498,7 +558,7 @@ export function MyProfile() {
/> />
) : ( ) : (
<div className="space-y-2"> <div className="space-y-2">
{history.map((h) => ( {history.slice(0, 3).map((h) => (
<Card <Card
key={h.id} key={h.id}
className="cursor-pointer transition-colors hover:bg-accent/50" className="cursor-pointer transition-colors hover:bg-accent/50"