PolicyConfirmHeader.tsx
1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { InfoCircleFilled } from '@ant-design/icons';
import { UText } from '@uj/ui';
export interface PolicyConfirmHeaderProps {
storeName?: string;
/** 总解析行数(兜底用) */
totalRows?: number;
/** 校验通过行数(failRows>0 时优先显示这个) */
passRows?: number;
/** 校验失败行数(> 0 时,红框数量改用 passRows 显示) */
failRows?: number;
}
export function PolicyConfirmHeader({
storeName = '巴州强冠东风汽车销售服务有限公司',
totalRows = 12,
passRows,
failRows,
}: PolicyConfirmHeaderProps) {
/**
* 显示数量规则(与 Step4 SubmitConfirmCard 两处红框保持一致):
* - 有失败行(failRows > 0)→ 只显示通过数量 passRows
* - 全通过 → 显示 totalRows(= 总解析行数 productCategoryRowCount)
*/
const displayRows =
typeof failRows === 'number' && failRows > 0 && typeof passRows === 'number'
? passRows
: totalRows;
return (
<div
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 12,
padding: '0 2px',
}}
>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<InfoCircleFilled style={{ color: '#2B5CE6', fontSize: 14 }} />
<span style={{ fontSize: 15, fontWeight: 600, color: '#1A202C' }}>
商务政策确认 · {storeName} / 共 {displayRows} 行
</span>
</div>
<UText type="secondary" style={{ fontSize: 12 }}>
唯一项 = 门店 + 业务场景 + 产品分类 · 列按三组横向分块
</UText>
</div>
);
}