Simplify mobile treasury report metric cards for clearer comparison UX.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -114,19 +114,11 @@ const previousRangeLabel = computed(() =>
|
|||||||
: '—',
|
: '—',
|
||||||
);
|
);
|
||||||
|
|
||||||
const metricColumns = computed<TableColumnsType<MetricRow>>(() => [
|
const metricColumns: TableColumnsType<MetricRow> = [
|
||||||
{ title: 'شاخص', dataIndex: 'label', key: 'label' },
|
{ title: 'شاخص', dataIndex: 'label', key: 'label' },
|
||||||
{
|
{ title: 'این دوره', dataIndex: 'current', key: 'current' },
|
||||||
title: `این دوره (${currentRangeLabel.value})`,
|
{ title: 'دوره قبل', dataIndex: 'previous', key: 'previous' },
|
||||||
dataIndex: 'current',
|
];
|
||||||
key: 'current',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: `دوره قبل (${previousRangeLabel.value})`,
|
|
||||||
dataIndex: 'previous',
|
|
||||||
key: 'previous',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const metricRows = computed<MetricRow[]>(() => {
|
const metricRows = computed<MetricRow[]>(() => {
|
||||||
if (!current.value || !previous.value) return [];
|
if (!current.value || !previous.value) return [];
|
||||||
@@ -375,22 +367,29 @@ onMounted(() => {
|
|||||||
<a-descriptions-item label="دوره قبل">{{ previousRangeLabel }}</a-descriptions-item>
|
<a-descriptions-item label="دوره قبل">{{ previousRangeLabel }}</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
|
|
||||||
<a-list v-if="isMobile && metricRows.length" :data-source="metricRows">
|
<a-flex v-if="isMobile && metricRows.length" vertical :gap="12">
|
||||||
<template #renderItem="{ item }">
|
<a-card
|
||||||
<a-list-item>
|
v-for="item in metricRows"
|
||||||
<a-card :title="item.label" style="width: 100%">
|
:key="item.key"
|
||||||
<a-descriptions :column="1" bordered>
|
:title="item.label"
|
||||||
<a-descriptions-item :label="`این دوره (${currentRangeLabel})`">
|
:bordered="false"
|
||||||
{{ item.current }}
|
>
|
||||||
</a-descriptions-item>
|
<a-flex vertical :gap="8">
|
||||||
<a-descriptions-item :label="`دوره قبل (${previousRangeLabel})`">
|
<a-flex justify="space-between" align="center" :gap="8">
|
||||||
{{ item.previous }}
|
<a-typography-text type="secondary">این دوره</a-typography-text>
|
||||||
</a-descriptions-item>
|
<a-typography-text strong style="text-align: end">
|
||||||
</a-descriptions>
|
{{ item.current }}
|
||||||
</a-card>
|
</a-typography-text>
|
||||||
</a-list-item>
|
</a-flex>
|
||||||
</template>
|
<a-flex justify="space-between" align="center" :gap="8">
|
||||||
</a-list>
|
<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
|
<a-table
|
||||||
v-else-if="metricRows.length"
|
v-else-if="metricRows.length"
|
||||||
:columns="metricColumns"
|
:columns="metricColumns"
|
||||||
|
|||||||
Reference in New Issue
Block a user