| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- import { t } from '@/utils/i18n'
- import { isAfterJuly28 } from '@/utils/dateUtils'
- import { useFilters } from '../../../composables/useFilters'
- const { numberFormat } = useFilters()
- export const platformOptions = [
- { text: 'MT4', value: 'MT4' },
- { text: 'MT5', value: 'MT5' },
- ]
- export const customTypeList = [
- { text: t('AccountType.ClassicAccount'), value: 1 },
- { text: t('AccountType.ClassicAccount'), value: 2 },
- !isAfterJuly28 ? { text: t('AccountType.ClassicAccount'), value: 3 } : '',
- { text: t('AccountType.ClassicAccount'), value: 7 },
- { text: t('AccountType.ClassicAccount'), value: 8 },
- ].filter((v) => !!v)
- export const columnList = {
- '1': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'name', label: t('Label.Name') },
- {
- prop: 'deposit', label: t('Label.Deposit'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.deposit ?? '0')}`
- },
- },
- {
- prop: 'withdrawal', label: t('Label.Withdrawals'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.withdrawal ?? '0')}`
- },
- },
- {
- prop: 'credit', label: t('Label.Credit'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.credit ?? '0')}`
- },
- },
- { prop: 'closeTime', label: t('Label.CloseTime') },
- ],
- '2': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- {
- prop: 'groupType', label: t('Label.Type'),
- type: 'tag',
- tagMap: {
- 1: t('AccountType.ClassicAccount'),
- 2: t('AccountType.SeniorAccount'),
- 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
- 4: t('AccountType.ProfessionalAccount'),
- 5: t('AccountType.SpeedAccount'),
- 6: t('AccountType.SpeedAccount'),
- 7: t('AccountType.StandardAccount'),
- 8: t('AccountType.CentAccount'),
- },
- },
- { prop: 'symbol', label: t('Label.Varieties') },
- {
- prop: 'volume', label: t('Label.Volume'),
- formatter: ({ row }) => {
- return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
- },
- },
- {
- prop: 'rebateAmount', label: t('Label.rebateAmount'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.rebateAmount ?? '0')}`
- },
- },
- {
- prop: 'rebatePoint', label: t('Label.rebatePoint'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.rebatePoint ?? '0')}/${t('Label.Lot')}`
- },
- },
- {
- prop: 'commissionAmount', label: t('Label.commissionAmount'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.commissionAmount ?? '0')}`
- },
- },
- {
- prop: 'commissionPoint', label: t('Label.commissionPoint'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.commissionPoint ?? '0')}/${t('Label.Lot')}`
- },
- },
- { prop: 'openTime', label: t('Label.OpenTime') },
- { prop: 'closeTime', label: t('Label.CloseTime') },
- ],
- '3_1': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- { prop: 'platform', label: t('Label.Platform') },
- { prop: 'cmdName', label: t('Label.Type') },
- { prop: 'symbol', label: t('Label.Varieties') },
- {
- prop: 'openPrice', label: t('Label.OpenPrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.openPrice ?? '0')}`
- },
- },
- { prop: 'openTime', label: t('Label.OpenTime') },
- {
- prop: 'closePrice', label: t('Label.ClosePrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.closePrice ?? '0')}`
- },
- },
- { prop: 'closeTime', label: t('Label.CloseTime') },
- { prop: 'tp', label: t('Label.EP') },
- { prop: 'sl', label: t('Label.EL') },
- {
- prop: 'commission', label: t('Label.OutsideCommission'),
- formatter: ({ row }) => {
- return `${numberFormat(row.commission ?? '0')}`
- },
- },
- {
- prop: 'volume', label: t('Label.Volume'),
- formatter: ({ row }) => {
- return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
- },
- },
- {
- prop: 'storage', label: t('Label.StorageFee'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
- },
- },
- {
- prop: 'profit', label: t('Label.ProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
- },
- },
- {
- prop: 'totalProfit', label: t('Label.TotalProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.totalProfit ?? '0')}`
- },
- },
- ],
- '3_2': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- { prop: 'platform', label: t('Label.Platform') },
- { prop: 'cmdName', label: t('Label.Type') },
- { prop: 'symbol', label: t('Label.Varieties') },
- {
- prop: 'openPrice', label: t('Label.OpenPrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.openPrice ?? '0')}`
- },
- },
- { prop: 'openTime', label: t('Label.OpenTime') },
- {
- prop: 'closePrice', label: t('Label.ClosePrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.closePrice ?? '0')}`
- },
- },
- { prop: 'closeTime', label: t('Label.CloseTime') },
- { prop: 'tp', label: t('Label.EP') },
- { prop: 'sl', label: t('Label.EL') },
- {
- prop: 'commission', label: t('Label.OutsideCommission'),
- formatter: ({ row }) => {
- return `${numberFormat(row.commission ?? '0')}`
- },
- },
- {
- prop: 'volume', label: t('Label.Volume'),
- formatter: ({ row }) => {
- return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
- },
- },
- {
- prop: 'storage', label: t('Label.StorageFee'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
- },
- },
- {
- prop: 'profit', label: t('Label.ProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
- },
- },
- {
- prop: 'totalProfit', label: t('Label.TotalProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.totalProfit ?? '0')}`
- },
- },
- ],
- '3_3': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- { prop: 'platform', label: t('Label.Platform') },
- { prop: 'cmdName', label: t('Label.Type') },
- { prop: 'symbol', label: t('Label.Varieties') },
- {
- prop: 'openPrice', label: t('Label.OpenPrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.openPrice ?? '0')}`
- },
- },
- { prop: 'openTime', label: t('Label.OpenTime') },
- {
- prop: 'closePrice', label: t('Label.ClosePrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.closePrice ?? '0')}`
- },
- },
- { prop: 'closeTime', label: t('Label.CloseTime') },
- { prop: 'tp', label: t('Label.EP') },
- { prop: 'sl', label: t('Label.EL') },
- {
- prop: 'commission', label: t('Label.OutsideCommission'),
- formatter: ({ row }) => {
- return `${numberFormat(row.commission ?? '0')}`
- },
- },
- {
- prop: 'volume', label: t('Label.Volume'),
- formatter: ({ row }) => {
- return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
- },
- },
- {
- prop: 'storage', label: t('Label.StorageFee'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
- },
- },
- {
- prop: 'profit', label: t('Label.ProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
- },
- },
- {
- prop: 'totalProfit', label: t('Label.TotalProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.totalProfit ?? '0')}`
- },
- },
- ],
- '3_4': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- { prop: 'platform', label: t('Label.Platform') },
- { prop: 'cmdName', label: t('Label.Type') },
- { prop: 'symbol', label: t('Label.Varieties') },
- {
- prop: 'openPrice', label: t('Label.OpenPrice'),
- formatter: ({ row }) => {
- return `${numberFormat(row.openPrice ?? '0')}`
- },
- },
- { prop: 'openTime', label: t('Label.OpenTime') },
- { prop: 'tp', label: t('Label.EP') },
- { prop: 'sl', label: t('Label.EL') },
- {
- prop: 'volume', label: t('Label.Volume'),
- formatter: ({ row }) => {
- return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
- },
- },
- {
- prop: 'storage', label: t('Label.StorageFee'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
- },
- },
- {
- prop: 'profit', label: t('Label.ProfitLoss'),
- formatter: ({ row }) => {
- return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
- },
- },
- ],
- '4': [
- { prop: 'cId', label: t('Label.CidAccount') },
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- {
- prop: 'groupType', label: t('Label.AccountType'),
- formatter: ({ row }) => {
- return groupTypeName(row.groupType)
- },
- },
- { prop: 'name', label: t('Label.Name') },
- { prop: 'platform', label: t('Label.Platform') },
- { prop: 'leverage', label: t('Label.Leverage') },
- { prop: 'margin', label: t('Label.margin') },
- {
- prop: 'commission', label: t('Label.OutsideCommission'),
- formatter: ({ row }) => {
- return `$${row.commission ?? '0'}`
- },
- },
- {
- prop: 'credit', label: t('Label.Credit'),
- formatter: ({ row }) => {
- return `$${row.credit ?? '0'}`
- },
- },
- {
- prop: 'balance', label: t('Label.Amount'),
- formatter: ({ row }) => {
- return `$${row.balance ?? '0'}`
- },
- },
- {
- prop: 'equity', label: t('Label.equity'),
- formatter: ({ row }) => {
- return `$${row.equity ?? '0'}`
- },
- },
- { prop: 'floating', label: t('Label.FloatingPL') },
- { prop: 'registration', label: t('Label.RegistrationTime') },
- ],
- '5': [
- { prop: 'ibNo', label: t('Label.IBAccount') },
- { prop: 'pIbNo', label: t('Label.AttributionNumber') },
- { prop: 'name', label: t('Label.Name') },
- { prop: 'addTime', label: t('Label.RegistrationTime') },
- ],
- '6': [
- { prop: 'ibNo', label: t('Label.IBAccount') },
- { prop: 'typeName', label: t('Label.OperatingMode') },
- { prop: 'balanceTypeName', label: t('Label.CommissionType') },
- {
- prop: 'amount', label: t('Label.AmountMoney'),
- formatter: ({ row }) => {
- return numberFormat(row.amount ?? '0')
- },
- },
- { prop: 'addTime', label: t('Label.ProcessingDate') },
- ],
- '7': [
- { prop: 'cId', label: 'CID' },
- { prop: 'ibNo', label: t('Label.IBAccount') },
- { prop: 'name', label: t('Label.Name') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'platform', label: t('Label.Platform') },
- { prop: 'fxVolume', label: t('Label.fxVolume') },
- { prop: 'cfdVolume', label: t('Label.cfdVolume') },
- { prop: 'indexVolume', label: t('Label.indexVolume') },
- { prop: 'metalVolume', label: t('Label.metalVolume') },
- ],
- '24': [
- { prop: 'cId', label: t('Label.CidAccount') },
- { prop: 'ticket', label: t('Label.OrderNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'symbol', label: t('Label.Varieties') },
- { prop: 'openTime', label: t('Label.OpenTime') },
- { prop: 'closeTime', label: t('Label.CloseTime') },
- { prop: 'customType', label: t('Label.Type'),
- type: 'tag',
- tagMap: {
- 1: t('AccountType.ClassicAccount'),
- 2: t('AccountType.SeniorAccount'),
- 5: t('AccountType.SpeedAccount'),
- 6: t('AccountType.NewSpeedAccount'),
- 7: t('AccountType.StandardAccount'),
- 8: t('AccountType.CentAccount'),
- },
- },
- { prop: 'point', label: t('Label.Rebates') },
- { prop: 'pointValue', label: t('Ib.Report.Title9') },
- { prop: 'volume', label: t('Label.Volume'),
- formatter: ({ row }) => {
- return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
- },
- },
- { prop: 'rebate', label: t('Label.Commission'),
- formatter: ({ row }) => {
- return `$${row.rebate ?? '0'}`
- },
- },
- { prop: 'ibNo', label: t('Label.AgentNumber') },
- { prop: 'platform', label: t('Label.Platform') },
- ],
- }
- const groupCurrency1 = (type: string) => {
- if (type == 'GBP') return '£'
- if (type == 'USD') return '$'
- if (type == 'EUR') return '€'
- if (type == 'USC') return '¢'
- return '$'
- }
- const groupTypeName = (type: string | number) => {
- if (type == '1') return t('AccountType.ClassicAccount')
- if (type == '2') return t('AccountType.SeniorAccount')
- if (type == '3') return isAfterJuly28() ? '--' : t('AccountType.AgencyAccount')
- if (type == '5') return t('AccountType.SpeedAccount')
- if (type == '6') return t('AccountType.SpeedAccount')
- if (type == '7') return t('AccountType.StandardAccount')
- if (type == '8') return t('AccountType.CentAccount')
- return '--'
- }
- export const mobileList = {
- '1': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'name', label: t('Label.Name') },
- ],
- '2': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- {
- prop: 'groupType', label: t('Label.Type'),
- type: 'tag',
- tagMap: {
- 1: t('AccountType.ClassicAccount'),
- 2: t('AccountType.SeniorAccount'),
- 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
- 4: t('AccountType.ProfessionalAccount'),
- 5: t('AccountType.SpeedAccount'),
- 6: t('AccountType.SpeedAccount'),
- 7: t('AccountType.StandardAccount'),
- 8: t('AccountType.CentAccount'),
- },
- },
- ],
- '3_1': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- ],
- '3_2': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- ],
- '3_3': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- ],
- '3_4': [
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- { prop: 'order', label: t('Label.OrderNumber') },
- ],
- '4': [
- { prop: 'cId', label: t('Label.CidAccount') },
- { prop: 'ibNo', label: t('Label.AttributionNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- ],
- '5': [
- { prop: 'ibNo', label: t('Label.IBAccount') },
- { prop: 'pIbNo', label: t('Label.AttributionNumber') },
- { prop: 'name', label: t('Label.Name') },
- ],
- '6': [
- { prop: 'ibNo', label: t('Label.IBAccount') },
- { prop: 'typeName', label: t('Label.OperatingMode') },
- { prop: 'balanceTypeName', label: t('Label.CommissionType') },
- ],
- '7': [
- { prop: 'cId', label: 'CID' },
- { prop: 'ibNo', label: t('Label.IBAccount') },
- { prop: 'name', label: t('Label.Name') },
- ],
- '24': [
- { prop: 'cId', label: t('Label.CidAccount') },
- { prop: 'ticket', label: t('Label.OrderNumber') },
- { prop: 'login', label: t('Label.TradingAccount') },
- ],
- }
|