| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <template>
- <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
- <cwg-header :title="t('Home.page_ib.item10')" />
- <view class="account-content">
- <view class="search-content">
- <view class="search-bar">
- <cwg-combox v-model:value="search.platform" :options="platformOptions"
- :placeholder="t('placeholder.choose')" />
- <uni-easyinput v-model="search.login" :placeholder="t('Label.Login')" />
- <uni-easyinput v-model="search.cId" placeholder="CID" />
- <uni-datetime-picker type="daterange" v-model="search.date"
- :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')" @change="handleDateChange"/>
- </view>
- <view />
- </view>
- <cwg-tabel
- ref="tableRef"
- :columns="columns"
- :mobilePrimaryFields="mobilePrimaryFields"
- :queryParams="search"
- :api="listApi"
- :show-operation="true"
- :showPagination="true"
- >
- <template #action="{ row }">
- <cwg-dropdown :menu-list="menuList(row)" @menuClick="handleMenuClick">
- <view class="pc-header-btn">
- <cwg-icon name="crm-ellipsis" :size="24" />
- </view>
- </cwg-dropdown>
- </template>
- </cwg-tabel>
- </view>
- </cwg-page-wrapper>
- </template>
- <script setup lang="ts">
- // 账户管理
- import { ref, reactive, computed, onMounted, onUnmounted } from 'vue'
- import { onLoad } from '@dcloudio/uni-app'
- import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
- import { customApi } from '@/service/custom'
- import { financialApi } from '@/service/financial'
- import Config from '@/config/index'
- import { lang } from '@/composables/config'
- import { ibApi } from '@/service/ib'
- import { useFilters } from '@/composables/useFilters'
- const { numberFormat, numberDecimal } = useFilters()
- const search = ref({
- cId: '',
- login: '',
- date: '',
- platform: 'MT4',
- startDate: '',
- endDate: '',
- })
- const platformOptions = [
- { text: 'MT4', value: 'MT4' },
- { text: 'MT5', value: 'MT5' },
- ]
- const { t, locale } = useI18n()
- // 表格列配置
- const columns = ref([
- {
- prop: 'login',
- label: t('Label.Login'),
- align: 'center',
- },
- {
- prop: 'name',
- label: t('Ib.Custom.NameLabel'),
- align: 'center',
- },
- {
- prop: 'platform',
- label: t('Label.Platform'),
- align: 'center',
- },
- {
- prop: 'groupName',
- label: t('Label.GroupName'),
- align: 'center',
- },
- {
- prop: 'type',
- type: 'tag',
- label: t('Label.LoginType'),
- align: 'center',
- tagMap: {
- 1: t('AccountType.ClassicAccount'),
- 2: t('AccountType.SeniorAccount'),
- 5: t('AccountType.SpeedAccount'),
- 6: t('AccountType.SpeedAccount'),
- 7: t('AccountType.StandardAccount'),
- 8: t('AccountType.CentAccount'),
- },
- },
- {
- prop: 'Leverage',
- label: t('Label.Leverage'),
- align: 'center',
- formatter: ({ row }) => row.leverage ? `1:${row.leverage}` : '--',
- },
- {
- prop: 'currency',
- label: t('Label.Currency'),
- align: 'center',
- },
- {
- prop: 'balance',
- label: t('Label.LoginBalance'),
- align: 'center',
- formatter: ({ row }) => numberFormat(row.balance ?? 0),
- },
- {
- prop: 'countryEnName',
- label: t('Label.Country'),
- align: 'center',
- },
- {
- prop: 'registration',
- label: t('Label.ApplyTime'),
- align: 'center',
- },
- ])
- const mobilePrimaryFields = ref([
- {
- prop: 'login',
- label: t('Label.Login'),
- align: 'center',
- },
- {
- prop: 'name',
- label: t('Ib.Custom.NameLabel'),
- align: 'center',
- },
- {
- prop: 'platform',
- label: t('Label.Platform'),
- align: 'center',
- },
- {
- prop: 'more',
- type: 'more',
- width: 20,
- align: 'right',
- },
- ])
- const listApi = ref(ibApi.accountSubs)
- const handleDateChange = (val) => {
- search.value.startDate = val[0]
- search.value.endDate = val[1]
- }
- </script>
- <style lang="scss" scoped>
- @import "@/uni.scss";
- .search-content {
- display: flex;
- justify-content: space-between;
- }
- </style>
|