2 天以前 10dd6590cea8f20eff21025ee71c8a614a48cdb7
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
import type { MesTraceConsumerScanApi } from '#/api/mes/trace-consumer-scan';
 
/** 消费者扫码访问汇总默认值 */
export const defaultSummary: MesTraceConsumerScanApi.Summary = {
  total: 0,
  success: 0,
  failed: 0,
  uniqueBatchCount: 0,
};
 
/** 分布分组维度选项 */
export const GROUP_BY_OPTIONS: Array<{ label: string; value: string }> = [
  { label: '扫码类型', value: 'sourceType' },
  { label: '查询结果', value: 'success' },
  { label: '扫码渠道', value: 'channel' },
  { label: '省份', value: 'province' },
  { label: '城市', value: 'city' },
  { label: '生产批次', value: 'batchId' },
];
 
/** 扫码类型名称映射(后端存储原始码,展示时转换) */
export const SOURCE_TYPE_LABEL_MAP: Record<string, string> = {
  BAG: '袋码',
  PALLET: '托盘码',
  BATCH: '批次码',
};
 
/** 分布图表颜色集合 */
export const DISTRIBUTION_COLORS = [
  '#409EFF',
  '#67C23A',
  '#E6A23C',
  '#F56C6C',
  '#909399',
  '#7C3AED',
  '#00BCD4',
  '#FF9800',
  '#4CAF50',
  '#E91E63',
];