import { useI18n } from 'vue-i18n' import { useFilters } from '../../../composables/useFilters' import { computed } from 'vue' export const useRecordingConst = () => { const { t } = useI18n() const { numberFormat } = useFilters() const columnList = computed(() => ({ 1: [ { prop: 'platform', label: t('Ib.Recording.Platform') }, { prop: 'accountType', label: t('Ib.Recording.AccountType'), type: 'tag', tagMap: { 1: t('AccountType.ClassicAccount'), 2: t('AccountType.SeniorAccount'), 7: t('AccountType.StandardAccount'), 8: t('AccountType.CentAccount'), }, }, { prop: 'currency', label: t('Ib.Recording.CurrencyType') }, { prop: 'leverage', label: t('Ib.Recording.Lever'), formatter: ({ row }) => row.leverage ? `1:${row.leverage}` : '--', }, { prop: 'commission', label: t('Ib.Recording.Commission') }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'status', label: t('Ib.Recording.Status'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Ib.Recording.Note'), type: 'note' }, ], 2: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'oldLeverage', label: t('Ib.Recording.OldLever'), formatter: ({ row }) => row.oldLeverage ? `1:${row.oldLeverage}` : '--', }, { prop: 'newLeverage', label: t('Ib.Recording.NewLever'), formatter: ({ row }) => row.newLeverage ? `1:${row.newLeverage}` : '--', }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'status', label: t('Ib.Recording.Status'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Ib.Recording.Note'), type: 'note' }, ], 3: [ { prop: 'ibNo', label: t('Ib.Recording.TransferAccounts') }, { prop: 'to', label: t('Ib.Recording.IntoAccount') }, { prop: 'currency', label: t('Ib.Recording.CurrencyType') }, { prop: 'amount', label: t('Ib.Recording.Amount'), formatter: ({ row }) => numberFormat(row.amount ?? 0), }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'status', label: t('Ib.Recording.Status'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Ib.Recording.Note'), type: 'note' }, ], 4: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'loginType', label: t('Ib.Recording.AccountType'), type: 'tag', tagMap: { 1: t('AccountType.ClassicAccount'), 2: t('AccountType.SeniorAccount'), 7: t('AccountType.StandardAccount'), 8: t('AccountType.CentAccount'), }, }, { prop: 'title', label: t('Label.Describe') }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'status', label: t('Ib.Recording.Status'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Ib.Recording.Note'), type: 'note' }, ], 5: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'oldPoint', label: t('Ib.Recording.OldPoint'), formatter: ({ row }) => row.oldPoint || '0', }, { prop: 'newPoint', label: t('Ib.Recording.NewPoint'), formatter: ({ row }) => row.newPoint || '0', }, { prop: 'oldHide', label: t('Drawer.Label.OldHide'), formatter: ({ row }) => row.oldHide || '0', }, { prop: 'newHide', label: t('Drawer.Label.NewHide'), formatter: ({ row }) => row.newHide || '0', }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'status', label: t('Ib.Recording.Status'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Ib.Recording.Note'), type: 'note' }, ], 6: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'oldAgentIbNo', label: t('Ib.Recording.OldBelong') }, { prop: 'newAgentIbNo', label: t('Ib.Recording.NewBelong') }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'status', label: t('Ib.Recording.Status'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Ib.Recording.Note') }, ], 7: [ { prop: 'typeName', label: t('Label.Type') }, { prop: 'newPercent', label: t('Label.NewPercentage') }, { prop: 'newClassicFx', label: t('Label.NewClassicForex') }, { prop: 'newVipFx', label: t('Label.NewAdvancedForex') }, { prop: 'newClassicCfd', label: t('Label.NewClassicCFD') }, { prop: 'newVipCfd', label: t('Label.NewAdvancedCFD') }, { prop: 'newComPointOne', label: t('Label.NewCommission10') }, { prop: 'newComPointTwo', label: t('Label.NewCommission20') }, { prop: 'newComPointThree', label: t('Label.NewCommission30') }, { prop: 'newInstantFx', label: t('Label.NewSpeedForex') }, { prop: 'newInstantMetal', label: t('Label.NewSpeedMetal') }, ], 8: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'ibNo', label: t('Label.IBAccount') }, { prop: 'amount', label: t('Label.AmountMoney'), formatter: ({ row }) => numberFormat(row.amount ?? '--'), }, { prop: 'currency', label: t('Label.Currency') }, { prop: 'serial', label: t('Label.SerialNumber') }, { prop: 'remitChannelName', label: t('Label.WithdrawalWay'), slot: 'remitChannelName', }, { prop: 'addTime', label: t('Label.ApplyTime') }, { prop: 'status', label: t('Label.State'), slot: 'status', }, { prop: 'approveDesc', label: t('Label.Note'), type: 'note' }, ], 9: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'mam', label: 'MAM' }, { prop: 'platform', label: t('Label.Platform') }, { prop: 'sub', label: t('Ib.Settings.HangUndo') }, { prop: 'type', label: t('Label.Type'), type: 'tag', tagMap: { 1: t('Ib.Settings.Hang'), 2: t('Ib.Settings.Undo'), }, }, { prop: 'addTime', label: t('Label.ApplyTime') }, { prop: 'status', label: t('Label.State'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Label.Note'), slot: 'approveDesc' }, ], 10: [ { prop: 'withdrawLogin', label: t('Custom.Recording.TransferAccounts') }, { prop: 'depositLogin', label: t('Custom.Recording.IntoAccount') }, { prop: 'withdrawCurrency', label: t('Custom.Recording.CurrencyType') }, { prop: 'withdrawAmount', label: t('Custom.Recording.Amount'), formatter: ({ row }) => numberFormat(row.withdrawAmount ?? '--'), }, { prop: 'addTime', label: t('Custom.Recording.ApplicationDate') }, { prop: 'status', label: t('Custom.Recording.Status'), formatter: ({ row }) => { if (row.status == 1) { return t('State.ToBeProcessed') } if (row.status == 2 && row.withdrawStatus == 2 && row.depositStatus == 2) { return t('State.Completed') } if (row.status == 2 && (row.withdrawStatus == 1 || row.depositStatus == 1)) { return t('State.InTheProcessing') } if (row.status == 3 || row.withdrawStatus == 3 || row.depositStatus == 3) { return t('State.Refused') } }, }, { prop: 'approveDesc', label: t('Custom.Recording.Note'), type: 'note' }, ], 11: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'pIbNo', label: t('Label.AttributionNumber') }, { prop: 'email', label: t('Label.Email') }, { prop: 'addTime', label: t('Label.ApplyTime') }, { prop: 'ownerId', label: t('Ib.PammManager.ownerId') }, { prop: 'accountId', label: t('Ib.PammManager.accountId') }, { prop: 'percent', label: t('Ib.PammManager.percent') }, { prop: 'status', label: t('Label.State'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Label.Descr'), type: 'note' }, ], 12: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'pIbNo', label: t('Label.AttributionNumber') }, { prop: 'ownerId', label: t('Ib.PammManager.ownerId') }, { prop: 'accountId', label: t('Ib.PammManager.accountId') }, { prop: 'percent', label: t('Ib.PammManager.percent') }, { prop: 'platform', label: t('Label.Platform') }, { prop: 'addTime', label: t('Label.ApplyTime') }, { prop: 'sub', label: t('Label.ApplicationAccount') }, { prop: 'type', label: t('Label.Type'), type: 'tag', tagMap: { 1: t('Ib.Settings.Hang'), 2: t('Ib.Settings.Undo'), }, }, { prop: 'status', label: t('Label.State'), type: 'tag', tagMap: { 1: t('State.ToBeProcessed'), 2: t('State.Completed'), 3: t('State.Refused'), }, }, { prop: 'approveDesc', label: t('Label.Descr'), type: 'note' }, { prop: 'approveTime', label: t('Label.ProcessingDate') }, ], 13: [ { prop: 'withdrawIbNo', label: t('AmountLabel.item4') }, { prop: 'depositIbNo', label: t('AmountLabel.item5') }, { prop: 'amount', label: t('Ib.Recording.Amount'), formatter: ({ row }) => numberFormat(row.amount ?? '--'), }, { prop: 'currency', label: t('Ib.Recording.CurrencyType') }, { prop: 'addTime', label: t('Ib.Recording.ApplicationDate') }, { prop: 'approveDesc', label: t('Ib.Recording.Note'), type: 'note' }, ], })) const mobileList = computed(() => ({ 1: [ { prop: 'platform', label: t('Ib.Recording.Platform') }, { prop: 'accountType', label: t('Ib.Recording.AccountType'), type: 'tag', tagMap: { 1: t('AccountType.ClassicAccount'), 2: t('AccountType.SeniorAccount'), 7: t('AccountType.StandardAccount'), 8: t('AccountType.CentAccount'), }, }, { prop: 'currency', label: t('Ib.Recording.CurrencyType') }, ], 2: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'oldLeverage', label: t('Ib.Recording.OldLever'), formatter: ({ row }) => row.oldLeverage ? `1:${row.oldLeverage}` : '--', }, { prop: 'newLeverage', label: t('Ib.Recording.NewLever'), formatter: ({ row }) => row.newLeverage ? `1:${row.newLeverage}` : '--', }, ], 3: [ { prop: 'ibNo', label: t('Ib.Recording.TransferAccounts') }, { prop: 'to', label: t('Ib.Recording.IntoAccount') }, { prop: 'currency', label: t('Ib.Recording.CurrencyType') }, ], 4: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'loginType', label: t('Ib.Recording.AccountType'), type: 'tag', tagMap: { 1: t('AccountType.ClassicAccount'), 2: t('AccountType.SeniorAccount'), 7: t('AccountType.StandardAccount'), 8: t('AccountType.CentAccount'), }, }, { prop: 'title', label: t('Label.Describe') }, ], 5: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'oldPoint', label: t('Ib.Recording.OldPoint'), formatter: ({ row }) => row.oldPoint || '0', }, { prop: 'newPoint', label: t('Ib.Recording.NewPoint'), formatter: ({ row }) => row.newPoint || '0', }, ], 6: [ { prop: 'login', label: t('Ib.Recording.TradingAccount') }, { prop: 'oldAgentIbNo', label: t('Ib.Recording.OldBelong') }, { prop: 'newAgentIbNo', label: t('Ib.Recording.NewBelong') }, ], 7: [ { prop: 'typeName', label: t('Label.Type') }, { prop: 'newPercent', label: t('Label.NewPercentage') }, { prop: 'newClassicFx', label: t('Label.NewClassicForex') }, ], 8: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'ibNo', label: t('Label.IBAccount') }, { prop: 'amount', label: t('Label.AmountMoney'), formatter: ({ row }) => numberFormat(row.amount ?? '--'), }, ], 9: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'mam', label: 'MAM' }, { prop: 'platform', label: t('Label.Platform') }, ], 10: [ { prop: 'withdrawLogin', label: t('Custom.Recording.TransferAccounts') }, { prop: 'depositLogin', label: t('Custom.Recording.IntoAccount') }, { prop: 'withdrawCurrency', label: t('Custom.Recording.CurrencyType') }, ], 11: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'pIbNo', label: t('Label.AttributionNumber') }, { prop: 'email', label: t('Label.Email') }, ], 12: [ { prop: 'cId', label: t('Label.CidAccount') }, { prop: 'pIbNo', label: t('Label.AttributionNumber') }, { prop: 'ownerId', label: t('Ib.PammManager.ownerId') }, ], 13: [ { prop: 'withdrawIbNo', label: t('AmountLabel.item4') }, { prop: 'depositIbNo', label: t('AmountLabel.item5') }, { prop: 'amount', label: t('Ib.Recording.Amount'), formatter: ({ row }) => numberFormat(row.amount ?? '--'), }, ], })) // api 列表 const apiList = computed(() => ({ 1: 'mamApplyList', 2: 'mamLeverageApplyList', 3: 'agentBalanceTransferList', 4: 'CustomRecordAccount', 5: 'customCommissionApplyList', 6: 'agentBelongChangeList', 7: 'agentPointChangeList', 8: 'agentWithdrawList', 9: 'mamSubsApplyRecording', 10: 'agentTransferList', 11: 'mamApplyList', 12: 'mamSubsApplyRecording', 13: 'agentBalanceCommissionSearchList', })) return { columnList, mobileList, apiList } }