trading-center-single.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. <template>
  2. <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
  3. <cwg-header :title="t('Custom.Settings.Title')">
  4. <template #right>
  5. <view class="time-header">
  6. <text>{{ t('Documentary.console.item2') }}:</text>
  7. <text class="time-value" @click="toReload">{{ time }}</text>
  8. <cwg-icon name="crm-refresh" @click="toReload" style="margin-left: 6px; cursor: pointer;" />
  9. </view>
  10. </template>
  11. </cwg-header>
  12. <view class="info-card">
  13. <cwg-asset-tabs :tabs="tabs" v-model="activeTab" />
  14. <!-- Tab 1: 个人指标 -->
  15. <view v-if="activeTab === '1'" class="tab-content">
  16. <!-- 个人名片和品种摘要 -->
  17. <view class="section-row">
  18. <view class="section-col">
  19. <view class="fllow-title">
  20. <view class="title">
  21. <text>{{ t('TradingCenter.item12') }}</text>
  22. </view>
  23. </view>
  24. <view class="fllow-info-list">
  25. <cwg-label-line-value :label="t('TradingCenter.item13')" :value="DailyIndex1.nickname || '--'" />
  26. <cwg-label-line-value :label="t('TradingCenter.item14')" :value="DailyIndex1.personalSignature || '--'" />
  27. <cwg-label-line-value :label="t('TradingCenter.item11')"
  28. :value="getAccountTypeText(DailyIndex.groupType)" />
  29. <cwg-label-line-value :label="t('TradingCenter.item15')" :value="DailyIndex1.addTime || '--'" />
  30. </view>
  31. </view>
  32. <view class="section-col">
  33. <view class="fllow-title">
  34. <view class="title">
  35. <text>{{ t('TradingCenter.item16') }}</text>
  36. </view>
  37. </view>
  38. <view class="chart-container">
  39. <cwg-match-media :max-width="991">
  40. <cwg-charts type="pie" :chartData="symbolSummaryData" :opts="pieOpts" ontouch />
  41. </cwg-match-media>
  42. <cwg-match-media :min-width="991">
  43. <cwg-charts type="pie" :chartData="symbolSummaryData" :opts="pieOpts" />
  44. </cwg-match-media>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 数据指标部分 -->
  49. <view class="section-row">
  50. <!-- 历史表现 -->
  51. <view class="section-col">
  52. <view class="fllow-title">
  53. <view class="title">
  54. <text>{{ t('TradingCenter.item17') }}</text>
  55. </view>
  56. </view>
  57. <view class="fllow-info-grid">
  58. <cwg-label-line-value :label="t('TradingCenter.item18')"
  59. :value="formatCurrency(DailyIndex.pl, DailyIndex.currency, DailyIndex.groupType)" />
  60. <cwg-label-line-value :label="t('TradingCenter.item21')"
  61. :value="formatCurrency(DailyIndex.loss, DailyIndex.currency, DailyIndex.groupType)" />
  62. <cwg-label-line-value :label="t('TradingCenter.item19')" :value="DailyIndex.plRate || '0'" />
  63. <cwg-label-line-value :label="t('TradingCenter.item7')" :value="DailyIndex.maxDdRate || '0'" />
  64. <cwg-label-line-value :label="t('TradingCenter.item20')"
  65. :value="formatCurrency(DailyIndex.profit, DailyIndex.currency, DailyIndex.groupType)" />
  66. </view>
  67. </view>
  68. <!-- 交易规模与效率 -->
  69. <view class="section-col">
  70. <view class="fllow-title">
  71. <view class="title">
  72. <text>{{ t('TradingCenter.item22') }}</text>
  73. </view>
  74. </view>
  75. <view class="fllow-info-grid">
  76. <cwg-label-line-value :label="t('TradingCenter.item23')" :value="DailyIndex.trades || '0'" />
  77. <cwg-label-line-value :label="t('TradingCenter.item29')" :value="DailyIndex.avgHoldVolume || '0'" />
  78. <cwg-label-line-value :label="t('TradingCenter.item24')" :value="DailyIndex.volume || '0'" />
  79. <cwg-label-line-value :label="t('TradingCenter.item39')" :value="DailyIndex.maxHoldVolume || '0'" />
  80. <cwg-label-line-value :label="t('TradingCenter.item25')" :value="DailyIndex.tradesWin || '0'" />
  81. <cwg-label-line-value :label="t('TradingCenter.item30')" :value="DailyIndex.avgDailyTrades || '0'" />
  82. <cwg-label-line-value :label="t('TradingCenter.item26')" :value="DailyIndex.tradesLoss || '0'" />
  83. <cwg-label-line-value :label="t('TradingCenter.item31')" :value="DailyIndex.tradesSl || '0'" />
  84. <cwg-label-line-value :label="t('TradingCenter.item27')" :value="DailyIndex.avgHoldVolume || '0'" />
  85. <cwg-label-line-value :label="t('TradingCenter.item32')" :value="DailyIndex.slRate || '0'" />
  86. <cwg-label-line-value :label="t('TradingCenter.item28')" :value="DailyIndex.avgHoldTime || '--'" />
  87. <cwg-label-line-value :label="t('TradingCenter.item6')" :value="DailyIndex.winRate || '0'" />
  88. </view>
  89. </view>
  90. </view>
  91. <view class="section-row">
  92. <!-- 资金流向 -->
  93. <view class="section-col">
  94. <view class="fllow-title">
  95. <view class="title">
  96. <text>{{ t('TradingCenter.item33') }}</text>
  97. </view>
  98. </view>
  99. <view class="fllow-info-grid">
  100. <cwg-label-line-value :label="t('TradingCenter.item34')"
  101. :value="formatCurrency(DailyIndex.deposit, DailyIndex.currency, DailyIndex.groupType)" />
  102. <cwg-label-line-value :label="t('TradingCenter.item36')"
  103. :value="formatCurrency(DailyIndex.credit, DailyIndex.currency, DailyIndex.groupType)" />
  104. <cwg-label-line-value :label="t('TradingCenter.item35')"
  105. :value="formatCurrency(DailyIndex.withdraw, DailyIndex.currency, DailyIndex.groupType)" />
  106. </view>
  107. </view>
  108. <!-- 订阅与跟单 -->
  109. <view class="section-col">
  110. <view class="fllow-title">
  111. <view class="title">
  112. <text>{{ t('TradingCenter.item40') }}</text>
  113. </view>
  114. </view>
  115. <view class="fllow-info-grid">
  116. <cwg-label-line-value :label="t('TradingCenter.item37')" :value="DailyIndex.follows || '0'" />
  117. <cwg-label-line-value :label="t('TradingCenter.item38')"
  118. :value="formatCurrency(DailyIndex.followsPl, DailyIndex.currency, DailyIndex.groupType)" />
  119. </view>
  120. </view>
  121. </view>
  122. <!-- 排名曲线和净值曲线 -->
  123. <view class="section-row">
  124. <!-- 排名曲线 -->
  125. <view class="section-col">
  126. <view class="fllow-title">
  127. <view class="title">
  128. <text>{{ t('TradingCenter.item41') }}</text>
  129. </view>
  130. </view>
  131. <view class="chart-container">
  132. <cwg-match-media :max-width="991">
  133. <cwg-charts type="line" :chartData="rankingChartData" :opts="rankingChartOpts" ontouch />
  134. </cwg-match-media>
  135. <cwg-match-media :min-width="991">
  136. <cwg-charts type="line" :chartData="rankingChartData" :opts="rankingChartOpts" />
  137. </cwg-match-media>
  138. </view>
  139. </view>
  140. <!-- 净值曲线 -->
  141. <view class="section-col">
  142. <view class="fllow-title">
  143. <view class="title">
  144. <text>{{ t('Documentary.tradingCenter.item140') }}</text>
  145. </view>
  146. </view>
  147. <view class="chart-container">
  148. <cwg-charts type="line" :chartData="equityChartData" :opts="equityChartOpts"/>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. <!-- Tab 2: 交易订单 -->
  154. <view v-if="activeTab === '2'" class="tab-content">
  155. <cwg-complex-search :fields="tab2FilterFields" v-model="tab2SearchParams" @search="handleTab2Search"
  156. @reset="handleTab2Reset" />
  157. <cwg-tabel ref="table2Ref" :columns="tab2Columns" :immediate="true" :queryParams="tab2QueryParams"
  158. :api="tab2Api" :show-operation="false" :showSummary="true" :summaryMethod="getSummaries1">
  159. <template #openClosePrice="{ row }">
  160. <view class="sp-div-tab">{{ formatNumber(row.openPrice) }}</view>
  161. <view class="sp-div-tab-b">{{ formatNumber(row.closePrice) }}</view>
  162. </template>
  163. <template #openCloseTime="{ row }">
  164. <view class="sp-div-tab">{{ row.openTime || '--' }}</view>
  165. <view class="sp-div-tab-b">{{ row.closeTime || '--' }}</view>
  166. </template>
  167. <template #tpSl="{ row }">
  168. <view class="sp-div-tab">{{ formatNumber(row.tp) }}</view>
  169. <view class="sp-div-tab-b">{{ formatNumber(row.sl) }}</view>
  170. </template>
  171. </cwg-tabel>
  172. </view>
  173. <!-- Tab 3: 订阅总览 -->
  174. <view v-if="activeTab === '3'" class="tab-content">
  175. <view class="summary-top">
  176. <view class="search-operation-l">
  177. <text>{{ t('Documentary.tradingCenter.item123') }}</text>
  178. : {{ tableSumData.profit || '0' }}
  179. </view>
  180. <view class="search-operation-r">
  181. <text>{{ t('Documentary.tradingCenter.item124') }}</text>
  182. : {{ tableSumData.volume || '0' }}
  183. </view>
  184. </view>
  185. <cwg-complex-search :fields="tab3FilterFields" v-model="tab3SearchParams" @search="handleTab3Search"
  186. @reset="handleTab3Reset" />
  187. <cwg-tabel ref="table3Ref" :columns="tab3Columns" :immediate="true" :queryParams="tab3QueryParams"
  188. :api="tab3Api" :show-operation="false" />
  189. </view>
  190. </view>
  191. </cwg-page-wrapper>
  192. </template>
  193. <script setup lang="ts">
  194. import { computed, ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
  195. import { useI18n } from 'vue-i18n'
  196. import { documentaryApi } from '@/service/documentary'
  197. import { onLoad, onShow } from '@dcloudio/uni-app'
  198. import { useWindowWidth } from '@/composables/useWindowWidth'
  199. const windowWidth = useWindowWidth(300)
  200. const isMobile = computed(() => windowWidth.value <= 991)
  201. const { t } = useI18n()
  202. // --- Params ---
  203. const myLogin = ref('')
  204. const myRanking = ref('')
  205. const myId = ref('')
  206. onLoad((options: any) => {
  207. myLogin.value = options.dealLogin || options.login || ''
  208. myRanking.value = options.ranking || ''
  209. myId.value = options.id || ''
  210. activeTab.value = '1'
  211. getDate()
  212. getPersonalIndicators()
  213. })
  214. // --- Time fetching ---
  215. const time = ref('')
  216. const getLocalTime = () => {
  217. let timezone = 2
  218. let offset_GMT = new Date().getTimezoneOffset()
  219. let nowDate = new Date().getTime()
  220. let now = new Date(nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000)
  221. let year = now.getFullYear()
  222. let month = String(now.getMonth() + 1).padStart(2, '0')
  223. let day = String(now.getDate()).padStart(2, '0')
  224. let hh = String(now.getHours()).padStart(2, '0')
  225. let mm = String(now.getMinutes()).padStart(2, '0')
  226. time.value = `${year}/${month}/${day} ${hh}:${mm}`
  227. }
  228. const getDate = async () => {
  229. try {
  230. let res = await documentaryApi.followDealSignalRefreshDate()
  231. if (res.code === 200 && res.data) {
  232. time.value = res.data
  233. } else {
  234. getLocalTime()
  235. }
  236. } catch (error) {
  237. getLocalTime()
  238. }
  239. }
  240. const toReload = () => {
  241. getDate()
  242. if (activeTab.value === '1') {
  243. getPersonalIndicators()
  244. } else if (activeTab.value === '2') {
  245. table2Ref.value?.refreshTable()
  246. } else if (activeTab.value === '3') {
  247. table3Ref.value?.refreshTable()
  248. }
  249. }
  250. onMounted(() => {
  251. })
  252. onUnmounted(() => {
  253. })
  254. // --- Tabs ---
  255. const activeTab = ref('1')
  256. const tabs = computed(() => [
  257. { text: t('Documentary.tradingCenter.item60'), value: '1' },
  258. { text: t('Documentary.tradingCenter.item58'), value: '2' },
  259. { text: t('Documentary.tradingCenter.item59'), value: '3' },
  260. ])
  261. // --- Tab 1 Data ---
  262. const DailyIndex = ref<any>({})
  263. const DailyIndex1 = ref<any>({})
  264. const symbolSummaryData = ref<any>({ series: [] })
  265. const pieOpts = computed(()=>({
  266. color: ['#5470C6', '#91CC75', '#EE6666', '#FAC858', '#73C0DE', '#3BA272'],
  267. padding: [5, 5, 5, 5],
  268. enableScroll: true,
  269. legend: {
  270. show: true,
  271. position: 'left',
  272. },
  273. xAxis: {
  274. // disableGrid: true,
  275. scrollShow: true,
  276. itemCount: isMobile.value?3:4,
  277. },
  278. }))
  279. const rankingChartData = ref<any>({ categories: [], series: [] })
  280. const rankingChartOpts = computed(()=>({
  281. enableScroll: true,
  282. yAxis: {
  283. data: [{
  284. axisLine: false,
  285. inverse: false,
  286. }],
  287. },
  288. xAxis: {
  289. // disableGrid: true,
  290. scrollShow: true,
  291. itemCount: isMobile.value?3:4,
  292. },
  293. }))
  294. const equityChartData = ref<any>({ categories: [], series: [] })
  295. const equityChartOpts = computed(()=>({
  296. enableScroll: true,
  297. xAxis: {
  298. // disableGrid: true,
  299. scrollShow: true,
  300. itemCount: isMobile.value?3:4,
  301. },
  302. }))
  303. const getAccountTypeText = (type: number) => {
  304. const map: Record<number, string> = {
  305. 1: 'AccountType.ClassicAccount',
  306. 2: 'AccountType.SeniorAccount',
  307. 5: 'AccountType.SpeedAccount',
  308. 6: 'AccountType.SpeedAccount',
  309. 7: 'AccountType.StandardAccount',
  310. 8: 'AccountType.CentAccount',
  311. }
  312. return type && map[type] ? t(map[type]) : '--'
  313. }
  314. const formatCurrency = (val: any, currency?: string, groupType?: number) => {
  315. if (!val) return '0'
  316. let symbol = '$'
  317. if (currency === 'GBP') symbol = '£'
  318. else if (currency === 'EUR') symbol = '€'
  319. else if (currency === 'USC' || groupType == 8) symbol = '¢'
  320. return `${symbol}${val}`
  321. }
  322. const getPersonalIndicators = async () => {
  323. if (myId.value) {
  324. let res = await documentaryApi.followDealSignalSearchSingle({ id: myId.value })
  325. if (res.code === 200 && res.data) {
  326. DailyIndex.value = res.data
  327. DailyIndex1.value = res.data
  328. if (res.data.login) {
  329. myLogin.value = res.data.login
  330. }
  331. if (res.data.symbolSummary) {
  332. drawSymbolSummary(res.data.symbolSummary)
  333. }
  334. getChart4()
  335. getChart5()
  336. }
  337. } else {
  338. // Fallback
  339. documentaryApi.followDailyIndex({ login: myLogin.value }).then(res => {
  340. if (res.code === 200) DailyIndex.value = res.data || {}
  341. })
  342. documentaryApi.followDealCard({ login: myLogin.value }).then(res => {
  343. if (res.code === 200) DailyIndex1.value = res.data || {}
  344. })
  345. documentaryApi.followDailyChartSymbol({ login: myLogin.value }).then(res => {
  346. if (res.code === 200 && res.data && res.data[0] && res.data[0].volumes) {
  347. drawSymbolSummary(res.data[0].volumes)
  348. }
  349. })
  350. getChart4()
  351. getChart5()
  352. }
  353. }
  354. const drawSymbolSummary = (data: any[]) => {
  355. let pieData = data.map(item => {
  356. let name = item.symbol || item.name || ''
  357. if (!name && item.symbolType) {
  358. const types = ['', t('Documentary.Report.item11'), t('Documentary.Report.item12'), t('Documentary.Report.item13'), t('Documentary.Report.item14'), t('Documentary.Report.item15'), t('Documentary.Report.item16')]
  359. name = types[item.symbolType] || ''
  360. }
  361. let value = item.volume !== undefined ? item.volume : (item.value !== undefined ? item.value : (item.amount || 0))
  362. return { name, value }
  363. })
  364. symbolSummaryData.value = {
  365. series: [{ data: pieData }],
  366. }
  367. }
  368. const getChart4 = async () => {
  369. let res = await documentaryApi.getEquityChart({ login: myLogin.value })
  370. if (res.code === 200 && res.data) {
  371. let categories = []
  372. let seriesData = []
  373. res.data.forEach((item: any) => {
  374. categories.push(item.date.split(' ')[0])
  375. seriesData.push(item.amount !== null ? item.amount : item.doubleAmount)
  376. })
  377. equityChartData.value = {
  378. categories,
  379. series: [{ name: t('Documentary.tradingCenter.item140'), data: seriesData }],
  380. }
  381. }
  382. }
  383. const getChart5 = async () => {
  384. let res = await documentaryApi.getRankingChart({ login: myLogin.value })
  385. if (res.code === 200 && res.data) {
  386. let categories = []
  387. let seriesData = []
  388. res.data.forEach((item: any) => {
  389. categories.push(item.date.split(' ')[0])
  390. seriesData.push(item.amount !== null ? item.amount : item.doubleAmount)
  391. })
  392. rankingChartData.value = {
  393. categories,
  394. series: [{ name: t('TradingCenter.item41'), data: seriesData }],
  395. }
  396. }
  397. }
  398. // --- Formatters ---
  399. const formatNumber = (value: any) => {
  400. if (value == '***') return '***'
  401. if (isNaN(value)) return '0'
  402. let valStr = String(value)
  403. const parts = valStr.split('.')
  404. parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
  405. return parts.join('.')
  406. }
  407. // --- Tab 2 ---
  408. const table2Ref = ref(null)
  409. const combined = ref<any>({})
  410. const tab2SearchParams = ref({
  411. tab4Type: 1,
  412. date: [],
  413. })
  414. const tab2FilterFields = computed(() => [
  415. {
  416. key: 'tab4Type', type: 'select', label: t('Documentary.tradingCenter.item114'), options: [
  417. { value: 1, text: t('Documentary.tradingCenter.item114') },
  418. // { value: 2, text: t('Documentary.tradingCenter.item115') }
  419. ],
  420. },
  421. { key: 'date', type: 'daterange', label: t('placeholder.choose') },
  422. ])
  423. const tab2QueryParams = computed(() => {
  424. return { ...tab2SearchParams.value, login: myLogin.value }
  425. })
  426. const tab2Columns = computed(() => [
  427. { prop: 'order', label: t('Label.OrderNumber'), align: 'center' },
  428. { prop: 'platform', label: t('Label.Platform'), align: 'center' },
  429. { prop: 'cmd', label: t('Label.Type'), align: 'center' },
  430. { prop: 'symbol', label: t('Label.Varieties'), align: 'center' },
  431. {
  432. prop: 'openClosePrice',
  433. label: t('Label.OpenPrice') + '/' + t('Label.ClosePrice'),
  434. align: 'center',
  435. slot: 'openClosePrice',
  436. },
  437. {
  438. prop: 'openCloseTime',
  439. label: t('Label.OpenTime') + '/' + t('Label.CloseTime'),
  440. align: 'center',
  441. slot: 'openCloseTime',
  442. },
  443. { prop: 'tpSl', label: t('Label.EP') + '/' + t('Label.EL'), align: 'center', slot: 'tpSl' },
  444. {
  445. prop: 'volume',
  446. label: t('Documentary.tradingCenter.item99'),
  447. align: 'center',
  448. formatter: ({ row }: any) => formatNumber(row.volume || '0'),
  449. },
  450. {
  451. prop: 'storage',
  452. label: t('Label.StorageFee'),
  453. align: 'center',
  454. formatter: ({ row }: any) => formatNumber(row.storage || '0'),
  455. },
  456. {
  457. prop: 'profit',
  458. label: t('Label.ProfitLoss'),
  459. align: 'center',
  460. formatter: ({ row }: any) => formatNumber(row.profit || '0'),
  461. },
  462. {
  463. prop: 'totalProfit',
  464. label: t('Label.TotalProfitLoss'),
  465. align: 'center',
  466. formatter: ({ row }: any) => formatNumber(row.totalProfit || '0'),
  467. },
  468. ])
  469. const tab2Api = async (params: any) => {
  470. let res = await documentaryApi.followOrderRecordList(params)
  471. if (res.code === 200 || res.code === 0 || res.code === 10000) {
  472. combined.value = res.sum || {}
  473. }
  474. return res
  475. }
  476. const getSummaries1 = ({ columns }: any) => {
  477. let sums = Array(columns.length).fill('')
  478. if (Object.keys(combined.value).length > 0) {
  479. sums[0] = t('Label.Total')
  480. const volIdx = columns.findIndex((c: any) => c.prop === 'volume')
  481. const proIdx = columns.findIndex((c: any) => c.prop === 'profit')
  482. const totIdx = columns.findIndex((c: any) => c.prop === 'totalProfit')
  483. if (volIdx > -1) sums[volIdx] = combined.value.volume ? formatNumber(combined.value.volume) : 0
  484. if (proIdx > -1) sums[proIdx] = combined.value.profit ? formatNumber(combined.value.profit) : 0
  485. if (totIdx > -1) sums[totIdx] = combined.value.totalProfit ? formatNumber(combined.value.totalProfit) : 0
  486. }
  487. return sums
  488. }
  489. const handleTab2Search = (params: any) => {
  490. tab2SearchParams.value = params
  491. nextTick(() => {
  492. table2Ref.value?.refreshTable()
  493. })
  494. }
  495. const handleTab2Reset = (params: any) => {
  496. tab2SearchParams.value = params
  497. nextTick(() => {
  498. table2Ref.value?.refreshTable()
  499. })
  500. }
  501. // --- Tab 3 ---
  502. const table3Ref = ref(null)
  503. const tableSumData = ref<any>({})
  504. const tab3SearchParams = ref({
  505. platform: 'MT4',
  506. date: [],
  507. })
  508. const tab3FilterFields = computed(() => [
  509. {
  510. key: 'platform', type: 'select', label: t('Label.Platform'), options: [
  511. { value: 'MT4', text: 'MT4' },
  512. { value: 'MT5', text: 'MT5' },
  513. ],
  514. },
  515. { key: 'date', type: 'daterange', label: t('placeholder.choose') },
  516. ])
  517. const tab3QueryParams = computed(() => {
  518. return { ...tab3SearchParams.value, login: myLogin.value }
  519. })
  520. const tab3Columns = computed(() => [
  521. { prop: 'followLogin', label: t('Documentary.tradingCenter.item102'), align: 'center' },
  522. { prop: 'platform', label: t('Label.Platform'), align: 'center' },
  523. { prop: 'startTime', label: t('Documentary.tradingCenter.item103'), align: 'center' },
  524. { prop: 'endTime', label: t('Documentary.tradingCenter.item104'), align: 'center' },
  525. {
  526. prop: 'profit',
  527. label: t('Documentary.tradingCenter.item105'),
  528. align: 'center',
  529. formatter: ({ row }: any) => formatNumber(row.profit || '0'),
  530. },
  531. {
  532. prop: 'volume',
  533. label: t('Documentary.tradingCenter.item99'),
  534. align: 'center',
  535. formatter: ({ row }: any) => formatNumber(row.volume || '0'),
  536. },
  537. ])
  538. const tab3Api = async (params: any) => {
  539. let res = await documentaryApi.followDealSubscribeSummary(params)
  540. if (res.code === 200 || res.code === 0 || res.code === 10000) {
  541. tableSumData.value = res.sum || {}
  542. }
  543. return res
  544. }
  545. const handleTab3Search = (params: any) => {
  546. tab3SearchParams.value = params
  547. nextTick(() => {
  548. table3Ref.value?.refreshTable()
  549. })
  550. }
  551. const handleTab3Reset = (params: any) => {
  552. tab3SearchParams.value = params
  553. nextTick(() => {
  554. table3Ref.value?.refreshTable()
  555. })
  556. }
  557. </script>
  558. <style scoped lang="scss">
  559. @import "@/uni.scss";
  560. .time-header {
  561. display: flex;
  562. align-items: center;
  563. font-size: 14px;
  564. font-weight: 500;
  565. color: var(--bs-heading-color);
  566. .time-value {
  567. margin-left: 6px;
  568. color: var(--bs-heading-color);
  569. }
  570. }
  571. .info-card {
  572. padding: 16px;
  573. background: var(--bs-body-bg);
  574. border-radius: 8px;
  575. }
  576. .tab-content {
  577. margin-top: 16px;
  578. }
  579. .section-row {
  580. display: flex;
  581. flex-wrap: wrap;
  582. gap: 20px;
  583. margin-bottom: 20px;
  584. }
  585. .section-col {
  586. flex: 1;
  587. min-width: 300px;
  588. border: 1px solid #f0f0f0;
  589. border-radius: 8px;
  590. padding: 16px;
  591. box-sizing: border-box;
  592. }
  593. .fllow-title {
  594. display: flex;
  595. justify-content: space-between;
  596. border-bottom: 1px solid #eee;
  597. padding-bottom: 10px;
  598. margin-bottom: 10px;
  599. .title {
  600. font-weight: bold;
  601. color: var(--bs-heading-color);
  602. padding-left: 8px;
  603. border-left: 4px solid #eb3f57;
  604. font-size: 16px;
  605. }
  606. }
  607. .fllow-info-list {
  608. display: flex;
  609. flex-direction: column;
  610. gap: 8px;
  611. }
  612. .fllow-info-grid {
  613. display: grid;
  614. grid-template-columns: 1fr 1fr;
  615. gap: 8px 20px;
  616. @media screen and (max-width: 750px) {
  617. grid-template-columns: none;
  618. }
  619. }
  620. .chart-container {
  621. width: 100%;
  622. height: 250px;
  623. }
  624. .sp-div-tab {
  625. border-bottom: 1px dashed #eee;
  626. padding-bottom: 4px;
  627. margin-bottom: 4px;
  628. }
  629. .sp-div-tab-b {
  630. padding-top: 4px;
  631. }
  632. .summary-top {
  633. display: flex;
  634. gap: 20px;
  635. margin-bottom: 16px;
  636. font-size: 14px;
  637. font-weight: bold;
  638. color: var(--bs-heading-color);
  639. }
  640. </style>