fix: 修复审批后消息卡片更新和多行程显示问题

1. 审批人审批后,自己的消息卡片也更新为显示查看详情按钮
   - 新增 updateActorMessageCard() 方法更新操作人自己的卡片
   - 审批通过/拒绝时同时更新操作人和其他审批人的卡片

2. 多行程路线在审批详情中正确显示
   - 特殊处理 itineraries 字段,展示每个行程的详细信息
   - 添加行程列表样式,包括目的地、日期、费用等

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-01 12:46:41 +08:00
parent b90f901fd9
commit f8524d333c
4 changed files with 236 additions and 0 deletions
@@ -115,6 +115,56 @@
word-break: break-all;
}
.formSection {
display: flex;
flex-direction: column;
gap: 12px;
}
.itineraryList {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 8px;
}
.itineraryItem {
background: #fafafa;
border-radius: 8px;
padding: 12px;
border: 1px solid #f0f0f0;
}
.itineraryHeader {
margin-bottom: 8px;
padding-bottom: 8px;
border-bottom: 1px dashed #e8e8e8;
}
.itineraryIndex {
font-size: 14px;
font-weight: 600;
color: #1890ff;
}
.itineraryRow {
display: flex;
font-size: 14px;
line-height: 1.6;
margin-bottom: 4px;
}
.itineraryLabel {
color: #666;
width: 80px;
flex-shrink: 0;
}
.itineraryValue {
color: #333;
flex: 1;
}
.flowNodes {
display: flex;
flex-direction: column;
+41
View File
@@ -600,6 +600,47 @@ export default function ApprovalDetail() {
.map(([key, value]) => {
// 获取字段标签,优先使用映射表,没有则使用原始key
const label = formFieldLabelMap[key] || key
// 特殊处理行程安排(itineraries)
if (key === 'itineraries' && Array.isArray(value) && value.length > 0) {
return (
<div key={key} className={styles.formSection}>
<div className={styles.formLabel}>{label}:</div>
<div className={styles.itineraryList}>
{value.map((itinerary: any, index: number) => (
<div key={index} className={styles.itineraryItem}>
<div className={styles.itineraryHeader}>
<span className={styles.itineraryIndex}>行程 {index + 1}</span>
</div>
{Object.entries(itinerary).map(([ikey, ivalue]) => {
if (ikey === 'id') return null
const itineraryLabelMap: Record<string, string> = {
destination: '目的地',
start_date: '开始日期',
end_date: '结束日期',
estimated_cost: '预计费用',
}
const itineraryLabel = itineraryLabelMap[ikey] || ikey
let displayValue = ivalue as string
if (ikey.includes('date') && ivalue) {
displayValue = dayjs(String(ivalue)).format('YYYY-MM-DD')
} else if (ikey === 'estimated_cost' && ivalue) {
displayValue = `¥${Number(ivalue).toFixed(2)}`
}
return (
<div key={ikey} className={styles.itineraryRow}>
<span className={styles.itineraryLabel}>{itineraryLabel}:</span>
<span className={styles.itineraryValue}>{displayValue}</span>
</div>
)
})}
</div>
))}
</div>
</div>
)
}
return (
<div key={key} className={styles.formRow}>
<span className={styles.formLabel}>{label}:</span>