Simplify mobile treasury report metric cards for clearer comparison UX.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-25 15:55:08 +03:30
co-authored by Cursor
parent 6c0995e355
commit c5ff3597db
@@ -114,19 +114,11 @@ const previousRangeLabel = computed(() =>
: '—',
);
const metricColumns = computed<TableColumnsType<MetricRow>>(() => [
const metricColumns: TableColumnsType<MetricRow> = [
{ title: 'شاخص', dataIndex: 'label', key: 'label' },
{
title: `این دوره (${currentRangeLabel.value})`,
dataIndex: 'current',
key: 'current',
},
{
title: `دوره قبل (${previousRangeLabel.value})`,
dataIndex: 'previous',
key: 'previous',
},
]);
{ title: 'این دوره', dataIndex: 'current', key: 'current' },
{ title: 'دوره قبل', dataIndex: 'previous', key: 'previous' },
];
const metricRows = computed<MetricRow[]>(() => {
if (!current.value || !previous.value) return [];
@@ -375,22 +367,29 @@ onMounted(() => {
<a-descriptions-item label="دوره قبل">{{ previousRangeLabel }}</a-descriptions-item>
</a-descriptions>
<a-list v-if="isMobile && metricRows.length" :data-source="metricRows">
<template #renderItem="{ item }">
<a-list-item>
<a-card :title="item.label" style="width: 100%">
<a-descriptions :column="1" bordered>
<a-descriptions-item :label="`این دوره (${currentRangeLabel})`">
{{ item.current }}
</a-descriptions-item>
<a-descriptions-item :label="`دوره قبل (${previousRangeLabel})`">
{{ item.previous }}
</a-descriptions-item>
</a-descriptions>
</a-card>
</a-list-item>
</template>
</a-list>
<a-flex v-if="isMobile && metricRows.length" vertical :gap="12">
<a-card
v-for="item in metricRows"
:key="item.key"
:title="item.label"
:bordered="false"
>
<a-flex vertical :gap="8">
<a-flex justify="space-between" align="center" :gap="8">
<a-typography-text type="secondary">این دوره</a-typography-text>
<a-typography-text strong style="text-align: end">
{{ item.current }}
</a-typography-text>
</a-flex>
<a-flex justify="space-between" align="center" :gap="8">
<a-typography-text type="secondary">دوره قبل</a-typography-text>
<a-typography-text style="text-align: end">
{{ item.previous }}
</a-typography-text>
</a-flex>
</a-flex>
</a-card>
</a-flex>
<a-table
v-else-if="metricRows.length"
:columns="metricColumns"