store 4
This commit is contained in:
@@ -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
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user