StatisticCard 统计卡片

用于看板、总览页等场景展示单个统计卡片。组件支持两种布局:默认卡片(default)与结构化卡片(structured)。

基础用法

通过 item 传入卡片数据。默认使用 default 布局,可通过 card-variant="structured" 切换到结构化布局。

消息流入速率:
8条/秒
消息流出速率:
2条/秒
客户端总数:
63
当前在线数:
1
订阅主题总数:
176

结构化卡片(card-variant="structured"

Accumulated Number of Institutions
6
New Institutions:3
Active Institutions:6
Accumulated Number of Merchants
600
New Merchants:300
Active Merchants:298
Accumulated Number of Terminals
600
New Terminals:300
Active Merchants:298
Accumulated Number of Receipts
300,000
New Receipts:300

布局与字段说明

默认卡片(default)

  • 主标题:item.label
  • 主数值:item.value + item.unit(可选)
  • 可选明细:item.subLabel + item.subValue + item.subUnit

结构化卡片(structured)

  • 标题行:item.label + 可选提示(labelSuffixIconTooltip
  • 数值行:item.value + item.unit
  • 明细行 1:subLabel / subValue / subUnit,可通过 subTrendup | down | flat)展示趋势
  • 明细行 2:subLabel2 / subValue2 / subUnit2,可通过 subTrend2up | down | flat)展示趋势

StatisticCard API

StatisticCard 属性

名称说明类型默认值
item单张卡片数据(必填)object
cardVariant卡片布局类型enum'default'
cardMinWidth卡片最小宽度(数字按 pxstring / numbercardVariant='default'时为372px;cardVariant='structured'时为275px
cardHeight卡片高度(默认 100%string / number100%
cardRadius卡片圆角(数字按 pxstring / number10
cardShadow是否显示阴影booleanfalse
cardPadding卡片内边距(数字按 pxstring / number20
iconSize图标大小(组件图标)string / number
iconWrapSize图标容器大小string / number

StatisticCardItem

名称说明类型
key唯一 key(不传时会基于 label 和索引生成)string / number
label主标题文案string
value主数值string / number
unit主数值单位string
labelSuffixIconTooltip标题后缀提示文案(结构化卡片生效)string
icon右侧图标组件(与 iconSrc 二选一,优先 iconComponent
iconSrc右侧图片图标地址string
iconAlt图片图标 alt 文案string
gradientFrom卡片渐变起始色(顶部)string
gradientTo卡片渐变结束色(底部)string
labelColorlabel / subLabel 文本颜色string
valueColorvalue 文本颜色string
unitColorunit / subUnit 文本颜色(默认跟随 labelColorstring
iconColor图标颜色(仅组件图标生效)string
iconBgColor图标容器背景色string
textFontSizelabel 字号string / number
valueFontSizevaluesubValue 字号string / number
unitFontSize单位字号string / number
subLabel明细标签(默认卡片底部区域;结构化卡片第 1 行)string
subValue明细数值(默认/结构化卡片)string / number
subUnit明细单位string
subTrend第 1 行趋势标记(仅结构化卡片)enum
subLabelFontSizesubLabel 字号(结构化卡片)string / number
subLabelColorsubLabel 文本颜色(默认跟随 labelColorstring
subValueColorsubValue 文本颜色(默认跟随 valueColorstring
subValueFontSizesubValue 字号string / number
subTrendIconUp趋势图标组件(upComponent
subTrendIconDown趋势图标组件(downComponent
subTrendIconFlat趋势图标组件(flatComponent
subTrendIconUpSrc趋势图标图片(upstring
subTrendIconDownSrc趋势图标图片(downstring
subTrendIconFlatSrc趋势图标图片(flatstring
subLabel2明细标签 2(结构化卡片第 2 行)string
subValue2明细数值 2(结构化卡片第 2 行)string / number
subUnit2明细单位 2(结构化卡片第 2 行)string
subTrend2第 2 行趋势标记(仅结构化卡片)enum
subTrend2IconUp趋势图标组件(upComponent
subTrend2IconDown趋势图标组件(downComponent
subTrend2IconFlat趋势图标组件(flatComponent
subTrend2IconUpSrc趋势图标图片(upstring
subTrend2IconDownSrc趋势图标图片(downstring
subTrend2IconFlatSrc趋势图标图片(flatstring

趋势图标渲染优先级:

  • subTrendIcon*(组件)存在,优先渲染组件;
  • 否则若 subTrendIcon*Src(图片)存在,渲染图片;
  • 否则使用组件内置默认趋势图标。