This commit is contained in:
2026-06-13 12:42:10 +03:30
parent 164dbbfe53
commit 7050d041c4
7 changed files with 348 additions and 233 deletions
@@ -0,0 +1,63 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
const SOURCE_LABELS: Record<string, string> = {
zaarbox: 'تابلو Zaarbox',
legacy: 'فید قدیمی'
}
export const storePriceColumns: BaseTableColumn[] = [
{
title: 'ردیف',
dataIndex: 'id',
key: 'row',
filterable: false,
sortable: false,
customRender: (record: any) => record.index + 1
},
{
title: 'منبع قیمت',
dataIndex: 'source',
key: 'source',
type: 'Text',
customRender: ({ record }) => SOURCE_LABELS[record.source] ?? record.source
},
{
title: 'قیمت مرجع آبشده (ریال)',
dataIndex: 'liquid_gold_price',
key: 'liquid_gold_price',
type: 'Text',
customRender: ({ record }) =>
record.liquid_gold_price > 0 ? usePrice(record.liquid_gold_price, true, '') : '—'
},
{
title: 'محصولات به‌روز شده',
dataIndex: 'products_updated',
key: 'products_updated',
type: 'Number'
},
{
title: 'تاریخ',
dataIndex: 'created_at',
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => toJalaliNoTime(record.record.created_at)
},
{
title: 'زمان',
dataIndex: 'created_at',
key: 'time_at',
type: 'DateTime',
customRender: (record: any) => toTime(record.record.created_at)
},
{
title: 'عملیات',
dataIndex: 'action',
key: 'action',
slot: 'action',
fixed: 'right',
filterable: false,
sortable: false
}
]