report.ts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. import { t } from '@/utils/i18n'
  2. import { isAfterJuly28 } from '@/utils/dateUtils'
  3. import { useFilters } from '../../../composables/useFilters'
  4. const { numberFormat } = useFilters()
  5. export const platformOptions = [
  6. { text: 'MT4', value: 'MT4' },
  7. { text: 'MT5', value: 'MT5' },
  8. ]
  9. export const customTypeList = [
  10. { text: t('AccountType.ClassicAccount'), value: 1 },
  11. { text: t('AccountType.ClassicAccount'), value: 2 },
  12. !isAfterJuly28 ? { text: t('AccountType.ClassicAccount'), value: 3 } : '',
  13. { text: t('AccountType.ClassicAccount'), value: 7 },
  14. { text: t('AccountType.ClassicAccount'), value: 8 },
  15. ].filter((v) => !!v)
  16. export const columnList = {
  17. '1': [
  18. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  19. { prop: 'login', label: t('Label.TradingAccount') },
  20. { prop: 'name', label: t('Label.Name') },
  21. {
  22. prop: 'deposit', label: t('Label.Deposit'),
  23. formatter: ({ row }) => {
  24. return `${groupCurrency1(row.currency)}${numberFormat(row.deposit ?? '0')}`
  25. },
  26. },
  27. {
  28. prop: 'withdrawal', label: t('Label.Withdrawals'),
  29. formatter: ({ row }) => {
  30. return `${groupCurrency1(row.currency)}${numberFormat(row.withdrawal ?? '0')}`
  31. },
  32. },
  33. {
  34. prop: 'credit', label: t('Label.Credit'),
  35. formatter: ({ row }) => {
  36. return `${groupCurrency1(row.currency)}${numberFormat(row.credit ?? '0')}`
  37. },
  38. },
  39. { prop: 'closeTime', label: t('Label.CloseTime') },
  40. ],
  41. '2': [
  42. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  43. { prop: 'login', label: t('Label.TradingAccount') },
  44. {
  45. prop: 'groupType', label: t('Label.Type'),
  46. type: 'tag',
  47. tagMap: {
  48. 1: t('AccountType.ClassicAccount'),
  49. 2: t('AccountType.SeniorAccount'),
  50. 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
  51. 4: t('AccountType.ProfessionalAccount'),
  52. 5: t('AccountType.SpeedAccount'),
  53. 6: t('AccountType.SpeedAccount'),
  54. 7: t('AccountType.StandardAccount'),
  55. 8: t('AccountType.CentAccount'),
  56. },
  57. },
  58. { prop: 'symbol', label: t('Label.Varieties') },
  59. {
  60. prop: 'volume', label: t('Label.Volume'),
  61. formatter: ({ row }) => {
  62. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  63. },
  64. },
  65. {
  66. prop: 'rebateAmount', label: t('Label.rebateAmount'),
  67. formatter: ({ row }) => {
  68. return `${groupCurrency1(row.currency)}${numberFormat(row.rebateAmount ?? '0')}`
  69. },
  70. },
  71. {
  72. prop: 'rebatePoint', label: t('Label.rebatePoint'),
  73. formatter: ({ row }) => {
  74. return `${groupCurrency1(row.currency)}${numberFormat(row.rebatePoint ?? '0')}/${t('Label.Lot')}`
  75. },
  76. },
  77. {
  78. prop: 'commissionAmount', label: t('Label.commissionAmount'),
  79. formatter: ({ row }) => {
  80. return `${groupCurrency1(row.currency)}${numberFormat(row.commissionAmount ?? '0')}`
  81. },
  82. },
  83. {
  84. prop: 'commissionPoint', label: t('Label.commissionPoint'),
  85. formatter: ({ row }) => {
  86. return `${groupCurrency1(row.currency)}${numberFormat(row.commissionPoint ?? '0')}/${t('Label.Lot')}`
  87. },
  88. },
  89. { prop: 'openTime', label: t('Label.OpenTime') },
  90. { prop: 'closeTime', label: t('Label.CloseTime') },
  91. ],
  92. '3_1': [
  93. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  94. { prop: 'login', label: t('Label.TradingAccount') },
  95. { prop: 'order', label: t('Label.OrderNumber') },
  96. { prop: 'platform', label: t('Label.Platform') },
  97. { prop: 'cmdName', label: t('Label.Type') },
  98. { prop: 'symbol', label: t('Label.Varieties') },
  99. {
  100. prop: 'openPrice', label: t('Label.OpenPrice'),
  101. formatter: ({ row }) => {
  102. return `${numberFormat(row.openPrice ?? '0')}`
  103. },
  104. },
  105. { prop: 'openTime', label: t('Label.OpenTime') },
  106. {
  107. prop: 'closePrice', label: t('Label.ClosePrice'),
  108. formatter: ({ row }) => {
  109. return `${numberFormat(row.closePrice ?? '0')}`
  110. },
  111. },
  112. { prop: 'closeTime', label: t('Label.CloseTime') },
  113. { prop: 'tp', label: t('Label.EP') },
  114. { prop: 'sl', label: t('Label.EL') },
  115. {
  116. prop: 'commission', label: t('Label.OutsideCommission'),
  117. formatter: ({ row }) => {
  118. return `${numberFormat(row.commission ?? '0')}`
  119. },
  120. },
  121. {
  122. prop: 'volume', label: t('Label.Volume'),
  123. formatter: ({ row }) => {
  124. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  125. },
  126. },
  127. {
  128. prop: 'storage', label: t('Label.StorageFee'),
  129. formatter: ({ row }) => {
  130. return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
  131. },
  132. },
  133. {
  134. prop: 'profit', label: t('Label.ProfitLoss'),
  135. formatter: ({ row }) => {
  136. return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
  137. },
  138. },
  139. {
  140. prop: 'totalProfit', label: t('Label.TotalProfitLoss'),
  141. formatter: ({ row }) => {
  142. return `${groupCurrency1(row.currency)}${numberFormat(row.totalProfit ?? '0')}`
  143. },
  144. },
  145. ],
  146. '3_2': [
  147. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  148. { prop: 'login', label: t('Label.TradingAccount') },
  149. { prop: 'order', label: t('Label.OrderNumber') },
  150. { prop: 'platform', label: t('Label.Platform') },
  151. { prop: 'cmdName', label: t('Label.Type') },
  152. { prop: 'symbol', label: t('Label.Varieties') },
  153. {
  154. prop: 'openPrice', label: t('Label.OpenPrice'),
  155. formatter: ({ row }) => {
  156. return `${numberFormat(row.openPrice ?? '0')}`
  157. },
  158. },
  159. { prop: 'openTime', label: t('Label.OpenTime') },
  160. {
  161. prop: 'closePrice', label: t('Label.ClosePrice'),
  162. formatter: ({ row }) => {
  163. return `${numberFormat(row.closePrice ?? '0')}`
  164. },
  165. },
  166. { prop: 'closeTime', label: t('Label.CloseTime') },
  167. { prop: 'tp', label: t('Label.EP') },
  168. { prop: 'sl', label: t('Label.EL') },
  169. {
  170. prop: 'commission', label: t('Label.OutsideCommission'),
  171. formatter: ({ row }) => {
  172. return `${numberFormat(row.commission ?? '0')}`
  173. },
  174. },
  175. {
  176. prop: 'volume', label: t('Label.Volume'),
  177. formatter: ({ row }) => {
  178. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  179. },
  180. },
  181. {
  182. prop: 'storage', label: t('Label.StorageFee'),
  183. formatter: ({ row }) => {
  184. return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
  185. },
  186. },
  187. {
  188. prop: 'profit', label: t('Label.ProfitLoss'),
  189. formatter: ({ row }) => {
  190. return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
  191. },
  192. },
  193. {
  194. prop: 'totalProfit', label: t('Label.TotalProfitLoss'),
  195. formatter: ({ row }) => {
  196. return `${groupCurrency1(row.currency)}${numberFormat(row.totalProfit ?? '0')}`
  197. },
  198. },
  199. ],
  200. '3_3': [
  201. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  202. { prop: 'login', label: t('Label.TradingAccount') },
  203. { prop: 'order', label: t('Label.OrderNumber') },
  204. { prop: 'platform', label: t('Label.Platform') },
  205. { prop: 'cmdName', label: t('Label.Type') },
  206. { prop: 'symbol', label: t('Label.Varieties') },
  207. {
  208. prop: 'openPrice', label: t('Label.OpenPrice'),
  209. formatter: ({ row }) => {
  210. return `${numberFormat(row.openPrice ?? '0')}`
  211. },
  212. },
  213. { prop: 'openTime', label: t('Label.OpenTime') },
  214. {
  215. prop: 'closePrice', label: t('Label.ClosePrice'),
  216. formatter: ({ row }) => {
  217. return `${numberFormat(row.closePrice ?? '0')}`
  218. },
  219. },
  220. { prop: 'closeTime', label: t('Label.CloseTime') },
  221. { prop: 'tp', label: t('Label.EP') },
  222. { prop: 'sl', label: t('Label.EL') },
  223. {
  224. prop: 'commission', label: t('Label.OutsideCommission'),
  225. formatter: ({ row }) => {
  226. return `${numberFormat(row.commission ?? '0')}`
  227. },
  228. },
  229. {
  230. prop: 'volume', label: t('Label.Volume'),
  231. formatter: ({ row }) => {
  232. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  233. },
  234. },
  235. {
  236. prop: 'storage', label: t('Label.StorageFee'),
  237. formatter: ({ row }) => {
  238. return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
  239. },
  240. },
  241. {
  242. prop: 'profit', label: t('Label.ProfitLoss'),
  243. formatter: ({ row }) => {
  244. return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
  245. },
  246. },
  247. {
  248. prop: 'totalProfit', label: t('Label.TotalProfitLoss'),
  249. formatter: ({ row }) => {
  250. return `${groupCurrency1(row.currency)}${numberFormat(row.totalProfit ?? '0')}`
  251. },
  252. },
  253. ],
  254. '3_4': [
  255. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  256. { prop: 'login', label: t('Label.TradingAccount') },
  257. { prop: 'order', label: t('Label.OrderNumber') },
  258. { prop: 'platform', label: t('Label.Platform') },
  259. { prop: 'cmdName', label: t('Label.Type') },
  260. { prop: 'symbol', label: t('Label.Varieties') },
  261. {
  262. prop: 'openPrice', label: t('Label.OpenPrice'),
  263. formatter: ({ row }) => {
  264. return `${numberFormat(row.openPrice ?? '0')}`
  265. },
  266. },
  267. { prop: 'openTime', label: t('Label.OpenTime') },
  268. { prop: 'tp', label: t('Label.EP') },
  269. { prop: 'sl', label: t('Label.EL') },
  270. {
  271. prop: 'volume', label: t('Label.Volume'),
  272. formatter: ({ row }) => {
  273. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  274. },
  275. },
  276. {
  277. prop: 'storage', label: t('Label.StorageFee'),
  278. formatter: ({ row }) => {
  279. return `${groupCurrency1(row.currency)}${numberFormat(row.storage ?? '0')}`
  280. },
  281. },
  282. {
  283. prop: 'profit', label: t('Label.ProfitLoss'),
  284. formatter: ({ row }) => {
  285. return `${groupCurrency1(row.currency)}${numberFormat(row.profit ?? '0')}`
  286. },
  287. },
  288. ],
  289. '4': [
  290. { prop: 'cId', label: t('Label.CidAccount') },
  291. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  292. { prop: 'login', label: t('Label.TradingAccount') },
  293. {
  294. prop: 'groupType', label: t('Label.AccountType'),
  295. formatter: ({ row }) => {
  296. return groupTypeName(row.groupType)
  297. },
  298. },
  299. { prop: 'name', label: t('Label.Name') },
  300. { prop: 'platform', label: t('Label.Platform') },
  301. { prop: 'leverage', label: t('Label.Leverage') },
  302. { prop: 'margin', label: t('Label.margin') },
  303. {
  304. prop: 'commission', label: t('Label.OutsideCommission'),
  305. formatter: ({ row }) => {
  306. return `$${row.commission ?? '0'}`
  307. },
  308. },
  309. {
  310. prop: 'credit', label: t('Label.Credit'),
  311. formatter: ({ row }) => {
  312. return `$${row.credit ?? '0'}`
  313. },
  314. },
  315. {
  316. prop: 'balance', label: t('Label.Amount'),
  317. formatter: ({ row }) => {
  318. return `$${row.balance ?? '0'}`
  319. },
  320. },
  321. {
  322. prop: 'equity', label: t('Label.equity'),
  323. formatter: ({ row }) => {
  324. return `$${row.equity ?? '0'}`
  325. },
  326. },
  327. { prop: 'floating', label: t('Label.FloatingPL') },
  328. { prop: 'registration', label: t('Label.RegistrationTime') },
  329. ],
  330. '5': [
  331. { prop: 'ibNo', label: t('Label.IBAccount') },
  332. { prop: 'pIbNo', label: t('Label.AttributionNumber') },
  333. { prop: 'name', label: t('Label.Name') },
  334. { prop: 'addTime', label: t('Label.RegistrationTime') },
  335. ],
  336. '6': [
  337. { prop: 'ibNo', label: t('Label.IBAccount') },
  338. { prop: 'typeName', label: t('Label.OperatingMode') },
  339. { prop: 'balanceTypeName', label: t('Label.CommissionType') },
  340. {
  341. prop: 'amount', label: t('Label.AmountMoney'),
  342. formatter: ({ row }) => {
  343. return numberFormat(row.amount ?? '0')
  344. },
  345. },
  346. { prop: 'addTime', label: t('Label.ProcessingDate') },
  347. ],
  348. '7': [
  349. { prop: 'cId', label: 'CID' },
  350. { prop: 'ibNo', label: t('Label.IBAccount') },
  351. { prop: 'name', label: t('Label.Name') },
  352. { prop: 'login', label: t('Label.TradingAccount') },
  353. { prop: 'platform', label: t('Label.Platform') },
  354. { prop: 'fxVolume', label: t('Label.fxVolume') },
  355. { prop: 'cfdVolume', label: t('Label.cfdVolume') },
  356. { prop: 'indexVolume', label: t('Label.indexVolume') },
  357. { prop: 'metalVolume', label: t('Label.metalVolume') },
  358. ],
  359. '24': [
  360. { prop: 'cId', label: t('Label.CidAccount') },
  361. { prop: 'ticket', label: t('Label.OrderNumber') },
  362. { prop: 'login', label: t('Label.TradingAccount') },
  363. { prop: 'symbol', label: t('Label.Varieties') },
  364. { prop: 'openTime', label: t('Label.OpenTime') },
  365. { prop: 'closeTime', label: t('Label.CloseTime') },
  366. { prop: 'customType', label: t('Label.Type'),
  367. type: 'tag',
  368. tagMap: {
  369. 1: t('AccountType.ClassicAccount'),
  370. 2: t('AccountType.SeniorAccount'),
  371. 5: t('AccountType.SpeedAccount'),
  372. 6: t('AccountType.NewSpeedAccount'),
  373. 7: t('AccountType.StandardAccount'),
  374. 8: t('AccountType.CentAccount'),
  375. },
  376. },
  377. { prop: 'point', label: t('Label.Rebates') },
  378. { prop: 'pointValue', label: t('Ib.Report.Title9') },
  379. { prop: 'volume', label: t('Label.Volume'),
  380. formatter: ({ row }) => {
  381. return `${numberFormat(row.volume ?? '0')}/${t('Label.Lot')}`
  382. },
  383. },
  384. { prop: 'rebate', label: t('Label.Commission'),
  385. formatter: ({ row }) => {
  386. return `$${row.rebate ?? '0'}`
  387. },
  388. },
  389. { prop: 'ibNo', label: t('Label.AgentNumber') },
  390. { prop: 'platform', label: t('Label.Platform') },
  391. ],
  392. }
  393. const groupCurrency1 = (type: string) => {
  394. if (type == 'GBP') return '£'
  395. if (type == 'USD') return '$'
  396. if (type == 'EUR') return '€'
  397. if (type == 'USC') return '¢'
  398. return '$'
  399. }
  400. const groupTypeName = (type: string | number) => {
  401. if (type == '1') return t('AccountType.ClassicAccount')
  402. if (type == '2') return t('AccountType.SeniorAccount')
  403. if (type == '3') return isAfterJuly28() ? '--' : t('AccountType.AgencyAccount')
  404. if (type == '5') return t('AccountType.SpeedAccount')
  405. if (type == '6') return t('AccountType.SpeedAccount')
  406. if (type == '7') return t('AccountType.StandardAccount')
  407. if (type == '8') return t('AccountType.CentAccount')
  408. return '--'
  409. }
  410. export const mobileList = {
  411. '1': [
  412. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  413. { prop: 'login', label: t('Label.TradingAccount') },
  414. { prop: 'name', label: t('Label.Name') },
  415. ],
  416. '2': [
  417. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  418. { prop: 'login', label: t('Label.TradingAccount') },
  419. {
  420. prop: 'groupType', label: t('Label.Type'),
  421. type: 'tag',
  422. tagMap: {
  423. 1: t('AccountType.ClassicAccount'),
  424. 2: t('AccountType.SeniorAccount'),
  425. 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
  426. 4: t('AccountType.ProfessionalAccount'),
  427. 5: t('AccountType.SpeedAccount'),
  428. 6: t('AccountType.SpeedAccount'),
  429. 7: t('AccountType.StandardAccount'),
  430. 8: t('AccountType.CentAccount'),
  431. },
  432. },
  433. ],
  434. '3_1': [
  435. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  436. { prop: 'login', label: t('Label.TradingAccount') },
  437. { prop: 'order', label: t('Label.OrderNumber') },
  438. ],
  439. '3_2': [
  440. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  441. { prop: 'login', label: t('Label.TradingAccount') },
  442. { prop: 'order', label: t('Label.OrderNumber') },
  443. ],
  444. '3_3': [
  445. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  446. { prop: 'login', label: t('Label.TradingAccount') },
  447. { prop: 'order', label: t('Label.OrderNumber') },
  448. ],
  449. '3_4': [
  450. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  451. { prop: 'login', label: t('Label.TradingAccount') },
  452. { prop: 'order', label: t('Label.OrderNumber') },
  453. ],
  454. '4': [
  455. { prop: 'cId', label: t('Label.CidAccount') },
  456. { prop: 'ibNo', label: t('Label.AttributionNumber') },
  457. { prop: 'login', label: t('Label.TradingAccount') },
  458. ],
  459. '5': [
  460. { prop: 'ibNo', label: t('Label.IBAccount') },
  461. { prop: 'pIbNo', label: t('Label.AttributionNumber') },
  462. { prop: 'name', label: t('Label.Name') },
  463. ],
  464. '6': [
  465. { prop: 'ibNo', label: t('Label.IBAccount') },
  466. { prop: 'typeName', label: t('Label.OperatingMode') },
  467. { prop: 'balanceTypeName', label: t('Label.CommissionType') },
  468. ],
  469. '7': [
  470. { prop: 'cId', label: 'CID' },
  471. { prop: 'ibNo', label: t('Label.IBAccount') },
  472. { prop: 'name', label: t('Label.Name') },
  473. ],
  474. '24': [
  475. { prop: 'cId', label: t('Label.CidAccount') },
  476. { prop: 'ticket', label: t('Label.OrderNumber') },
  477. { prop: 'login', label: t('Label.TradingAccount') },
  478. ],
  479. }