diff --git a/frontend/src/components/charts/tooltip.ts b/frontend/src/components/charts/tooltip.ts new file mode 100644 index 000000000..2fc1c6c4d --- /dev/null +++ b/frontend/src/components/charts/tooltip.ts @@ -0,0 +1,14 @@ +// ECharts tooltip 回调参数的通用安全取值:参数形状不受控(数组/对象混合), +// 统一在此收敛类型判断。 +export function tooltipRows(params: unknown): Record[] { + const values = Array.isArray(params) ? params : [params] + return values.filter( + (value): value is Record => typeof value === 'object' && value !== null, + ) +} + +export function tooltipIndex(source: unknown) { + if (typeof source !== 'object' || source === null || !('dataIndex' in source)) + return -1 + return typeof source.dataIndex === 'number' ? source.dataIndex : -1 +} diff --git a/frontend/src/views/accounts/components/AccountIdentityCell.vue b/frontend/src/views/accounts/components/AccountIdentityCell.vue index a5787f95e..08e05a2e9 100644 --- a/frontend/src/views/accounts/components/AccountIdentityCell.vue +++ b/frontend/src/views/accounts/components/AccountIdentityCell.vue @@ -14,14 +14,12 @@ const props = withDefaults( account: AccountIdentity size?: 'md' | 'lg' showPlan?: boolean - showAvatar?: boolean titleMode?: 'local-part' | 'email' metaPosition?: 'title' | 'secondary' }>(), { size: 'md', showPlan: false, - showAvatar: true, titleMode: 'local-part', metaPosition: 'title', }, @@ -72,7 +70,6 @@ const avatarClass = computed(() => {