Improve deal board activity cues with relative dates and a quick activity list popup.
EOF Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,11 +15,13 @@ import {
|
||||
Space as ASpace,
|
||||
Table as ATable,
|
||||
Tag as ATag,
|
||||
Tooltip as ATooltip,
|
||||
Typography,
|
||||
theme,
|
||||
} from 'ant-design-vue';
|
||||
import type { TableColumnsType } from 'ant-design-vue';
|
||||
import TableColumnsMenu from '@/components/TableColumnsMenu.vue';
|
||||
import { formatJalaliNumeric } from '@/lib/jalali';
|
||||
import type {
|
||||
PipelineAccent,
|
||||
PipelineDeal,
|
||||
@@ -82,6 +84,13 @@ function money(deal: PipelineDeal) {
|
||||
return formatCurrencyParts(deal.amount ?? 0, deal.currencyUnit ?? 'ریال');
|
||||
}
|
||||
|
||||
function dateHint(deal: PipelineDeal) {
|
||||
if (!deal.dateIso) return deal.date;
|
||||
const d = new Date(deal.dateIso);
|
||||
if (Number.isNaN(d.getTime())) return deal.date;
|
||||
return formatJalaliNumeric(d);
|
||||
}
|
||||
|
||||
const hideAmount = computed(() => Boolean(props.copy.hideAmount));
|
||||
const tableKey = computed(() => (hideAmount.value ? 'pipeline.leads' : 'pipeline.deals'));
|
||||
|
||||
@@ -213,10 +222,12 @@ onUnmounted(() => {
|
||||
</span>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'date'">
|
||||
<a-space :size="6">
|
||||
<CalendarOutlined />
|
||||
<span>{{ record.deal.date }}</span>
|
||||
</a-space>
|
||||
<a-tooltip :title="dateHint(record.deal)">
|
||||
<a-space :size="6">
|
||||
<CalendarOutlined />
|
||||
<span>{{ record.deal.date }}</span>
|
||||
</a-space>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'actions'">
|
||||
<span :data-card-id="record.deal.id">
|
||||
@@ -334,10 +345,12 @@ onUnmounted(() => {
|
||||
{{ row.stageTitle }}
|
||||
</a-tag>
|
||||
<a-flex justify="space-between" align="center">
|
||||
<a-space :size="6">
|
||||
<CalendarOutlined />
|
||||
<a-typography-text type="secondary">{{ row.deal.date }}</a-typography-text>
|
||||
</a-space>
|
||||
<a-tooltip :title="dateHint(row.deal)">
|
||||
<a-space :size="6">
|
||||
<CalendarOutlined />
|
||||
<a-typography-text type="secondary">{{ row.deal.date }}</a-typography-text>
|
||||
</a-space>
|
||||
</a-tooltip>
|
||||
<span v-if="!hideAmount" dir="ltr">
|
||||
<a-typography-text strong>{{ money(row.deal).number }}</a-typography-text>
|
||||
<a-typography-text type="secondary" :style="{ marginInlineStart: '6px' }">
|
||||
|
||||
Reference in New Issue
Block a user