| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124 |
- <template>
- <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
- <view class="header">
- <view class="title">
- <view class="mb-3 h3">{{ t('Home.msg.Custom') }}</view>
- <view class="">{{ dateWeek }}</view>
- </view>
- <button type="button" class="btn btn-secondary btn-shadow waves-effect"
- @click="createAccount">
- <view class="d-flex align-items-center">
- <cwg-icon name="crm-plus" :size="14" color="#fff" />
- <text v-t="'Custom.Index.AddAccount'" />
- </view>
- </button>
- </view>
- <uni-loading v-if="loading" />
- <uni-row v-else class="demo-uni-row uni-row1" :gutter="20">
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
- <uni-row :gutter="10">
- <uni-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <view class="card position-relative">
- <view class="card-body d-flex align-items-center gap-3">
- <view class="icon-placeholder">
- <cwg-icon name="crm-wallet" :size="28" color="red" />
- </view>
- <view class="flex-1">
- <view class="d-flex justify-between items-start mb-1">
- <text class="text-muted text-sm">{{t('vu.custom.t1')}}</text>
- <text
- :class="['growth-rate', compareData.totalBalanceGrowthRate||0 >= 0 ? 'rate-up' : 'rate-down']">
- {{ compareData.totalBalanceGrowthRate || 0 >= 0 ? '+' : ''
- }}{{ compareData.totalBalanceGrowthRate || 0 }}%
- </text>
- </view>
- <view class="fw-bold text-lg">${{ numberFormat(compareData.totalBalance || '0') }}</view>
- </view>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <view class="card position-relative">
- <view class="card-body d-flex align-items-center gap-3">
- <view class="icon-placeholder">
- <cwg-icon name="crm-money-up" :size="28" color="red" />
- </view>
- <view class="flex-1">
- <view class="d-flex justify-between items-start mb-1">
- <text class="text-muted text-sm">{{t('vu.custom.t2')}}</text>
- <text :class="['growth-rate', compareData.totalEquityGrowthRate ||0>= 0 ? 'rate-up' : 'rate-down']">
- {{ compareData.totalEquityGrowthRate || 0 >= 0 ? '+' : ''
- }}{{ compareData.totalEquityGrowthRate || 0 }}%
- </text>
- </view>
- <view class="fw-bold text-lg">${{ numberFormat(compareData.totalEquity || '0') }}</view>
- </view>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <view class="card position-relative">
- <view class="card-body d-flex align-items-center gap-3">
- <view class="icon-placeholder">
- <cwg-icon name="icon_withdraw" :size="28" color="red" />
- </view>
- <view class="flex-1">
- <view class="d-flex justify-between items-start mb-1">
- <text class="text-muted text-sm">{{t('vu.custom.t3')}}</text>
- <text
- :class="['growth-rate', compareData.totalDepositAmountGrowthRate ||0 >= 0 ? 'rate-up' : 'rate-down']">
- {{ compareData.totalDepositAmountGrowthRate || 0 >= 0 ? '+' : ''
- }}{{ compareData.totalDepositAmountGrowthRate || 0 }}%
- </text>
- </view>
- <view class="fw-bold text-lg">${{ numberFormat(compareData.totalDepositAmount || '0') }}</view>
- </view>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <view class="card position-relative">
- <view class="card-body d-flex align-items-center gap-3">
- <view class="icon-placeholder">
- <cwg-icon name="crm-money-bill-transfer" :size="28" color="red" />
- </view>
- <view class="flex-1">
- <view class="d-flex justify-between items-start mb-1">
- <text class="text-muted text-sm">{{t('vu.custom.t4')}}</text>
- <text
- :class="['growth-rate', compareData.totalWithdrawalAmountGrowthRate||0 >= 0 ? 'rate-up' : 'rate-down']">
- {{ compareData.totalWithdrawalAmountGrowthRate || 0 >= 0 ? '+' : ''
- }}{{ compareData.totalWithdrawalAmountGrowthRate || 0 }}%
- </text>
- </view>
- <view class="fw-bold text-lg">${{ numberFormat(compareData.totalWithdrawalAmount || '0') }}</view>
- </view>
- </view>
- </view>
- </uni-col>
- </uni-row>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
- <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mobilH mb-3">
- <view class="chart-box crm-border-radius">
- <view class="chart-title">
- <uni-row>
- <uni-row>
- <view class="opt-title mb-2">
- <view class="bigtitle">
- <text v-if="chartForm.chartType == 4">{{ t('Custom.Index.TradingVolumeStatistics') }}</text>
- <text v-if="chartForm.chartType == 2">{{ t('Custom.Index.DepositStatistical') }}</text>
- <text v-if="chartForm.chartType == 3">{{ t('Custom.Index.WithdrawalsStatistical') }}</text>
- <text v-if="chartForm.chartType == 6">{{ t('Custom.Index.ProfitLoss') }}</text>
- </view>
- <view class="time" @click="toReload">
- <cwg-icon name="crm-refresh" :size="16" color="#666" />
- <text class="crm-cursor"> GMT+3 {{ time }}</text>
- </view>
- </view>
- </uni-row>
- <uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
- <view class="btn-opt">
- <view class="title">
- <view class="account" v-if="chartForm.login">
- <text>{{ t('Custom.Index.TradingAccount') }}</text>
- <text> —</text>
- <text>{{ chartForm.login }}</text>
- </view>
- <view class="date">
- <uni-datetime-picker
- v-model="isDate"
- type="daterange"
- :placeholder="t('placeholder.Start') + ' - ' + t('placeholder.End')"
- @change="getSearchDate"
- />
- </view>
- </view>
- <button class="operation" @click="isChart = true">
- <text style="font-size: 14px">{{ t('Custom.Index.Parameter') }}</text>
- </button>
- </view>
- </uni-col>
- </uni-row>
- </view>
- <view class="chart-container">
- <cwg-match-media :max-width="991">
- <cwg-charts type="line" :chartData="chartData" :opts="chartOpts" tooltipFormat="tooltipCustom" ontouch />
- </cwg-match-media>
- <cwg-match-media :min-width="991">
- <cwg-charts type="line" :chartData="chartData" :opts="chartOpts" tooltipFormat="tooltipCustom" />
- </cwg-match-media>
- </view>
- </view>
- </uni-col>
- <uni-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mobilH">
- <view class="chart-box mh crm-border-radius">
- <view class="bigtitle mb-3">
- {{t('Custom.Index.MyAccount')}}
- </view>
- <view class="mb-2">
- <cwg-combox :clearable="false" v-model:value="loginValue"
- :options="loginComboxOptions" :placeholder="t('placeholder.choose')" @change="setCurData"/>
- </view>
- <view>
- <AccountCard :key="curData?.accountNumber"
- :account="curData" noCtrl />
- </view>
- </view>
- </uni-col>
- </uni-col>
- </uni-row>
- <cwg-improve-popup v-model:visible="dialogCheck" @confirm="confirm" />
- <cwg-popup v-model:visible="isChart" type="center" :mask-click="false" :show-footers="true"
- :title="t('Custom.Index.ChartSet')">
- <view class="dia-content">
- <uni-forms ref="chartFormRef" labelWidth="160">
- <uni-forms-item :label="t('Label.ChartType') + ':'" prop="chartType">
- <cwg-combox
- v-model:value="chartForm.chartType"
- :options="chartTypeOptions"
- :placeholder="t('placeholder.choose')"
- />
- </uni-forms-item>
- <uni-forms-item :label="t('Label.PlatformType') + ':'" prop="platform">
- <cwg-combox
- v-model:value="chartForm.platform"
- :options="platformOptions"
- :placeholder="t('placeholder.choose')"
- @change="onPlatformChange"
- />
- </uni-forms-item>
- <uni-forms-item :label="t('Label.TradingAccount') + ':'" prop="login">
- <cwg-combox
- v-model:value="chartForm.login"
- :options="loginOptions"
- :placeholder="t('placeholder.choose')"
- />
- </uni-forms-item>
- </uni-forms>
- </view>
- <template #footer>
- <button @click="isChart = false">{{ t('Btn.Cancel') }}</button>
- <button type="primary" @click="handleChartConfirm">{{ t('Btn.Confirm') }}</button>
- </template>
- </cwg-popup>
- </cwg-page-wrapper>
- </template>
- <script setup>
- import { ref, computed, watch, onMounted, nextTick,onUnmounted } from 'vue'
- import { useI18n } from 'vue-i18n'
- import dayjs from 'dayjs'
- import useRouter from '@/hooks/useRouter'
- import config from '@/config/index'
- import useUserStore from '@/stores/use-user-store'
- import { useFilters } from '@/composables/useFilters'
- import { documentaryApi } from '@/service/documentary'
- import { customApi } from '@/service/custom'
- import { userApi } from '@/api/user'
- import AccountCard from '@/pages/customer/components/AccountCard.vue'
- const { t, locale } = useI18n()
- const loading = ref(false)
- const router = useRouter()
- const { Code } = config
- const userStore = useUserStore()
- const { numberFormat } = useFilters()
- const loginOptions = ref([])
- const ChartSetDate = ref({})
- const isDealLogin = ref(false)
- const dealDate = ref({})
- const SubscribeProfitDate = ref([])
- const compareData = ref({})
- const loginValue = ref('')
- const isChart = ref(false)
- const isDate = ref(['', ''])
- const time = ref('')
- const chartData = ref({ categories: [], series: [] })
- const chartOpts = computed(() => ({
- color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
- padding: [15, 10, 0, 15],
- enableScroll: true,
- legend: {
- show: false,
- },
- xAxis: {
- // disableGrid: true,
- scrollShow: true,
- itemCount: isMobile.value?3:4,
- },
- tooltipFormat: 'tooltipCustom',
- extra: {
- line: {
- type: 'straight',
- width: 2,
- activeType: 'hollow',
- },
- tooltip: {
- legendShow: false,
- // showCategory: true,
- formatter: 'tooltipCustom',
- },
- },
- }))
- const dropDown = ref([])
- const chartFormRef = ref(null)
- const chartForm = ref({
- chartType: 4,
- platform: '',
- login: '',
- })
- const chartTypeOptions = computed(() => [
- { text: t('Custom.Index.TradingVolumeStatistics'), value: 4 },
- { text: t('Custom.Index.DepositStatistical'), value: 2 },
- { text: t('Custom.Index.WithdrawalsStatistical'), value: 3 },
- { text: t('Custom.Index.ProfitLoss'), value: 6 },
- ])
- const platformOptions = [
- { text: 'MT4', value: 'MT4' },
- { text: 'MT5', value: 'MT5' },
- ]
- const loginDataOptions = ref([])
- const loginComboxOptions = computed(() => {
- return loginDataOptions.value.map((item) => ({
- text: item.label,
- value: item.login
- }))
- })
- const isAfterJuly28 = () => {
- const now = new Date();
- const july28 = new Date(2025, 6, 28, 0, 0, 0); // 月份从0开始,所以7月是6
- return now >= july28;
- }
- const getLocalTime = () => {
- let timezone = 2 //目标时区时间,东2区 东时区正数 西市区负数
- let offset_GMT = new Date().getTimezoneOffset() // 本地时间和格林威治的时间差,单位为分钟
- let nowDate = new Date().getTime() // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
- let now = new Date(
- nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000,
- )
- //当前时间
- let month = now.getMonth() + 1 //月
- let day = now.getDate() //日
- let hh = now.getHours() //时
- let mm = now.getMinutes() //分
- let clock
- if (month < 10) {
- month = '0' + month
- }
- if (day < 10) {
- day = '0' + day
- }
- if (hh < 10) {
- hh = '0' + hh
- }
- if (mm < 10) {
- mm = '0' + mm
- }
- clock = ' ' + hh + ':' + mm + ' ' + month + '/' + day
- time.value = clock
- }
- const toReload = () => {
- goTime()
- }
- // 获取账户信息
- const getDateList = async () => {
- loading.value = true
- let res = await customApi.CustomDropdown({ platform: "" })
- if (res.code == Code.StatusOK) {
- loginDataOptions.value = res.data.map(item => ({
- ...item,
- label: `${item.login}`
- }))
- const found = loginDataOptions.value?.[0]
- loginValue.value = found?.login||null
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- const getSearchDate = (val) => {
- if (Array.isArray(val)) {
- isDate.value = val
- }
- fetchChartData()
- }
- const onPlatformChange = (val) => {
- console.log('Platform changed:', val)
- }
- const handleChartConfirm = async () => {
- try {
- const params = {
- type: chartForm.value.chartType || 4,
- platform: chartForm.value.platform,
- login: chartForm.value.login,
- startDate: isDate.value[0],
- endDate: isDate.value[1],
- }
- const res = await customApi.getChartInfo(params)
- if (res.code === Code.StatusOK) {
- if (res.data) {
- let categories = []
- let seriesData = []
- res.data.forEach((item) => {
- categories.push(item.date.split(' ')[0])
- seriesData.push(item.amount)
- })
- chartData.value = { categories, series: [{ name: '', data: seriesData }] }
- } else {
- chartData.value = { categories: [], series: [] }
- }
- }
- isChart.value = false
- } catch (error) {
- console.error('获取图表数据失败', error)
- isChart.value = false
- }
- }
- const fetchChartData = async () => {
- try {
- const params = {
- type: chartForm.value.chartType || 4,
- platform: chartForm.value.platform,
- login: chartForm.value.login,
- startDate: isDate.value[0],
- endDate: isDate.value[1],
- }
- const res = await customApi.getChartInfo(params)
- if (res.code === Code.StatusOK) {
- if (res.data) {
- let categories = []
- let seriesData = []
- res.data.forEach((item) => {
- categories.push(item.date.split(' ')[0])
- seriesData.push(item.amount)
- })
- chartData.value = { categories, series: [{ name: '', data: seriesData }] }
- } else {
- chartData.value = { categories: [], series: [] }
- }
- }
- } catch (error) {
- console.error('获取图表数据失败', error)
- }
- }
- const getDropDown = async () => {
- try {
- const res = await customApi.CustomDropdown()
- if (res.code === Code.StatusOK) {
- dropDown.value = res.data || []
- loginOptions.value = (res.data || []).map(item => ({
- text: item.login,
- value: item.login,
- }))
- }
- } catch (error) {
- console.error('获取账户列表失败', error)
- }
- }
- // 今日时间
- const dateWeek = computed(() => {
- const now = dayjs()
- const isChinese = locale.value === 'cn' || locale.value === 'zhHant'
- if (isChinese) {
- const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
- const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
- return `${weekDays[now.day()]}, ${months[now.month()]}${now.date()}日, ${now.year()}`
- } else {
- return now.format('ddd, MMMD, YYYY')
- }
- })
- const createAccount = () => {
- getCustomLoginInfo()
- }
- // 获取客户登录信息
- const dialogCheck = ref(false)
- async function getCustomLoginInfo() {
- try {
- const res = await userApi.getUserInfo()
- userStore.saveUserInfo(res.data)
- if (res.code === 200) {
- if (
- res.data.customInfo.status == 2 &&
- res.data.customInfo.applyRealStatus == 2
- ) {
- router.push(`/pages/customer/account-select?server=${'real'}`)
- } else {
- dialogCheck.value = true
- }
- }
- } catch (error) {
- // console.log(error, 111);
- }
- }
- const confirm = () => {
- dialogCheck.value = false
- router.push(`/pages/mine/improveImmediately`)
- }
- const getDailyCompare = async (login) => {
- const res = await documentaryApi.followDailyCompare({ login })
- if (res.code === Code.StatusOK) {
- ChartSetDate.value = res.data ?? {}
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- const getDailyDeal = async (login) => {
- const res = await documentaryApi.followDailyDeal({ login })
- if (res.code === Code.StatusOK) {
- dealDate.value = res.data ?? {}
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- const getDailySubscribeProfit = async (login) => {
- const res = await documentaryApi.followDailySubscribeProfit({ login })
- if (res.code === Code.StatusOK) {
- SubscribeProfitDate.value = res.data?.data ?? []
- } else {
- uni.showToast({ title: res.msg, icon: 'none' })
- }
- }
- watch(() => chartForm.value.login, async (login) => {
- await getDailyCompare(login)
- if (isDealLogin.value) {
- await getDailyDeal(login)
- } else {
- await getDailySubscribeProfit(login)
- }
- })
- const getData = async () => {
- try {
- const res = await customApi.customDailyCompare()
- if (res.code === Code.StatusOK) {
- compareData.value = res.data
- }
- } catch (e) {
- console.log(e)
- }
- }
- const goTime = () => {
- getLocalTime()
- let timezone = 2 //目标时区时间,东2区 东时区正数 西市区负数
- let offset_GMT = new Date().getTimezoneOffset() // 本地时间和格林威治的时间差,单位为分钟
- let nowDate = new Date().getTime() // 本地时间距 1970 年 1 月 1 日午夜(GMT 时间)之间的毫秒数
- let data = new Date(
- nowDate + offset_GMT * 60 * 1000 + timezone * 60 * 60 * 1000,
- )
- //当月第一天和最后一天
- let mon1 = data.setDate(1) //当月第一天
- let mon2 = data.setMonth(data.getMonth() + 1) //下月
- let y1 = new Date(mon1).getFullYear()
- let m1 = new Date(mon1).getMonth() + 1
- let d1 = new Date(mon1).getDate()
- let y2 = new Date(mon2).getFullYear()
- let m2 = new Date(mon2).getMonth() + 1
- let d2 = 1
- isDate.value = [
- y1 + '-' + (m1 < 10 ? '0' + m1 : m1) + '-' + (d1 < 10 ? '0' + d1 : d1),
- y2 + '-' + (m2 < 10 ? '0' + m2 : m2) + '-' + (d2 < 10 ? '0' + d2 : d2),
- ]
- fetchChartData()
- }
- const isMobile = ref(false)
- onUnmounted(() => {
- // #ifdef H5
- window.removeEventListener('resize', handleResize)
- // #endif
- })
- const chartShow = ref(true)
- // 监听窗口大小变化(仅 H5)
- // #ifdef H5
- const handleResize = () => {
- checkIsMobile()
- }
- // #endif
- const checkIsMobile = () => {
- // 适配 uni-app 环境
- chartShow.value = false
- const width = window.innerWidth
- console.log(width,'inner')
- isMobile.value = width < 991
- chartShow.value = true
- // #ifndef H5
- chartShow.value = false
- const systemInfo = uni.getSystemInfoSync()
- isMobile.value = systemInfo.windowWidth < 991
- chartShow.value = true
- // #endif
- }
- const AccountList = ref([])
- const getAccountList = async () => {
- AccountList.value = []
- const res = await customApi.AccountAllList({
- page: {
- current: 1,
- size: 100
- }
- })
- if (res.code === 200) {
- AccountList.value = res.data
- }
- }
- const typeMap = computed(() => ({
- 1: t('AccountType.ClassicAccount'),
- 2: t('AccountType.SeniorAccount'),
- 3: !isAfterJuly28() ? t('AccountType.AgencyAccount') : '',
- 5: t('AccountType.SpeedAccount'),
- 6: t('AccountType.SpeedAccount'),
- 7: t('AccountType.StandardAccount'),
- 8: t('AccountType.CentAccount')
- }));
- // 格式化数值函数
- function formatMoney(value) {
- if (value === null || value === undefined) value = 0;
- const sign = value >= 0 ? '' : '-';
- const absoluteValue = Math.abs(value);
- return '$' + sign + absoluteValue.toFixed(2);
- }
- // 转换数组
- const accounts = computed(() => {
- if (!AccountList.value || AccountList.value.length == 0) return []
- let filteredAccounts = AccountList.value
- return filteredAccounts.map((acc, index) => {
- const currency = acc.currency || 'USD';
- const floating = acc.floating ?? 0;
- let labels = [t('vu.item1'), 'MT4', 'Standard'];
- labels[0] = t('vu.item1');
- labels[1] = acc.platform || 'MT4';
- labels[2] = typeMap.value[acc.type];
- let nickname = typeMap.value[acc.type];
- let fwq
- fwq = acc.platform == 'MT4' ? 'CWGMarketsLtd-Live' : 'CWGMarketsSVG-Live';
- const balance = acc.balance
- return {
- ...acc,
- labels,
- isExpanded: index == 0,
- balance,
- accountNumber: acc.login.toString(),
- nickname,
- fwq,
- balanceWithSymbol: acc.balanceWithSymbol ?? '$0',
- creditWithSymbol: acc.creditWithSymbol ?? '$0',
- equityWithSymbol: acc.equityWithSymbol ?? '$0',
- currency,
- actualLeverage: '1:' + (acc.leverage ?? 0),
- floatingPL: formatMoney(floating),
- platform: acc.platform || 'MT4',
- server: acc.groupCode || '',
- login: acc.login.toString(),
- listType: 'real'
- };
- })
- })
- const curData = ref()
- const setCurData = (val)=>{
- console.log(accounts.value, val)
- curData.value = accounts.value.find(item=>item.login == val)
- }
- watch(() => accounts.value, (val)=>{
- if (val.length){
- curData.value = accounts.value.find(item=>item.login == loginValue.value)
- }
- })
- onMounted(async () => {
- loading.value = true
- goTime()
- await getData()
- await getDropDown()
- await getDateList()
- await getAccountList()
- // #ifdef H5
- window.addEventListener('resize', handleResize)
- // #endif
- checkIsMobile()
- // await fetchChartData()
- loading.value = false
- })
- </script>
- <style lang="scss" scoped>
- @import "@/uni.scss";
- .mobilH{
- height: 100%;
- }
- @media screen and (max-width: 991px){
- .mobilH{
- height: auto;
- }
- }
- .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: px2rpx(20);
- .title {
- font-size: px2rpx(24);
- font-weight: bold;
- }
- }
- .demo-uni-row {
- display: flex;
- flex-wrap: wrap;
- align-items: stretch;
- margin: 0 auto !important;
- }
- .uni-col-left {
- //display: flex;
- //flex-direction: column;
- }
- .uni-col-right {
- display: flex;
- }
- .dashboard-container {
- min-height: 10vh;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- height: 100%;
- }
- /* 卡片通用样式 */
- .card {
- background: var(--color-white);
- color: var(--bs-heading-color);
- border-radius: 4px;
- margin-bottom: px2rpx(20);
- box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
- }
- .card-body {
- padding: px2rpx(16);
- }
- .icon-placeholder {
- width: px2rpx(48);
- height: px2rpx(48);
- border-radius: px2rpx(24);
- background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- }
- .icon-text {
- font-size: px2rpx(20);
- font-weight: bold;
- color: #6c757d;
- }
- .growth-rate {
- font-size: px2rpx(12);
- font-weight: 500;
- padding: px2rpx(2) px2rpx(8);
- border-radius: px2rpx(2);
- }
- .growth-rate.rate-up {
- color: #10b981;
- background: rgba(16, 185, 129, 0.1);
- }
- .growth-rate.rate-down {
- color: #ef4444;
- background: rgba(239, 68, 68, 0.1);
- }
- .custom-number,
- .custom-money {
- background: var(--bs-body-bg);
- border: 1px solid var(--bs-border-color);
- padding: 15px;
- border-radius: 4px;
- margin-bottom: 20px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- min-height: px2rpx(125);
- }
- .custom-number .title,
- .custom-money .left .tit,
- .custom-money .right .tit {
- font-size: 14px;
- color: var(--bs-heading-color);
- margin-bottom: 10px;
- }
- .custom-number .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .custom-money {
- display: flex;
- flex-direction: column;
- }
- .custom-money .left,
- .custom-money .right {
- flex: 1;
- }
- .custom-money .num {
- font-size: 20px;
- font-weight: bold;
- color: var(--bs-heading-color);
- }
- .custom-money .num.red {
- color: #eb3f57;
- }
- .el-dropdown-link {
- display: flex;
- align-items: center;
- gap: 4px;
- color: #6c8595;
- font-size: 12px;
- }
- .account-info1 {
- margin-bottom: 20px;
- }
- .custom-money-left .header,
- .custom-money-right .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: px2rpx(15);
- }
- .custom-money-left .tab,
- .custom-money-right .tab {
- font-size: px2rpx(16);
- font-weight: 600;
- color: var(--bs-heading-color);
- }
- .bottomCol {
- font-size: 16px;
- color: #868686;
- .bo-left1 {
- margin: 20px 0;
- padding: 20px 0;
- border-right: 1px dashed #989898;
- text-align: center;
- font-size: 16px;
- }
- .bo-right1 {
- margin: 20px 0px;
- padding: 20px 0;
- text-align: center;
- font-size: 16px;
- }
- }
- .blue-font {
- margin-top: px2rpx(15);
- color: #007aff;
- font-weight: 600;
- font-size: px2rpx(24);
- }
- .subscribe-table {
- width: 100%;
- border: 1px solid #ebeef5;
- border-radius: 6px;
- overflow: hidden;
- }
- .subscribe-row {
- display: grid;
- grid-template-columns: 1fr 1fr 1fr 1fr;
- border-top: 1px solid #ebeef5;
- }
- .subscribe-head {
- background: #f5f7fa;
- border-top: none;
- }
- .subscribe-cell {
- padding: 10px 8px;
- font-size: 12px;
- color: var(--bs-heading-color);
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .custom-dialog-content {
- padding: px2rpx(20);
- .info-text {
- color: var(--bs-heading-color);
- font-size: px2rpx(14);
- line-height: px2rpx(36);
- }
- }
- .card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: px2rpx(12);
- }
- .header-left {
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .header-title {
- font-size: px2rpx(14);
- font-weight: 600;
- }
- .header-right {
- display: flex;
- align-items: center;
- }
- .action-btn {
- background: #ffde02;
- border: none;
- border-radius: 50%;
- width: px2rpx(32);
- height: px2rpx(32);
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0;
- margin: 0;
- &:after {
- border: none;
- }
- }
- .dia-content {
- padding: 20rpx;
- }
- .content {
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- }
- .label {
- font-weight: 500;
- margin-bottom: 8rpx;
- }
- .btn {
- text-align: center;
- background-color: rgb(var(--bs-danger-rgb));
- font-size: px2rpx(16);
- color: #fff;
- padding: px2rpx(10) px2rpx(20);
- border-radius: px2rpx(8)!important;
- margin: 0;
- }
- .crm-cursor {
- cursor: pointer;
- }
- .link {
- display: flex;
- margin-top: 20rpx;
- .btn {
- display: flex;
- align-items: center;
- justify-content: center;
- height: px2rpx(35);
- margin: 0 px2rpx(10);
- }
- }
- .chart-box {
- background: var(--color-white);
- border-radius: 8px;
- padding: px2rpx(16);
- height: 100%;
- box-shadow: 0 px2rpx(4) px2rpx(12) rgba(0, 0, 0, 0.2);
- }
- .mh{
- height: 100%;
- }
- .chart-title {
- width: 100%;
- //display: flex;
- //justify-content: space-between;
- //align-items: flex-start;
- //margin-bottom: px2rpx(16);
- //padding-bottom: px2rpx(16);
- border-bottom: 1px solid #f0f0f0;
- }
- .bigtitle{
- font-size: px2rpx(18);
- }
- .opt-title{
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .btn-opt{
- display: flex;
- height: 100%;
- align-items: flex-end;
- justify-content: flex-end;
- }
- .chart-title .time {
- display: flex;
- align-items: center;
- gap: px2rpx(8);
- font-size: px2rpx(16);
- margin-bottom: px2rpx(10);
- color: #999;
- }
- .chart-title .title {
- flex: 1;
- margin: 0;
- margin-bottom: px2rpx(10);
- }
- .chart-title .title .name {
- font-size: px2rpx(18);
- font-weight: 600;
- color: var(--bs-heading-color);
- text-align: center;
- margin-bottom: px2rpx(8);
- }
- .chart-title .title .account {
- font-size: px2rpx(14);
- color: #999;
- text-align: center;
- margin-bottom: px2rpx(8);
- }
- .chart-title .title .date {
- display: flex;
- }
- .chart-title .date-picker {
- font-size: px2rpx(12);
- color: #666;
- padding: px2rpx(6) px2rpx(12);
- background: #f5f5f5;
- border-radius: 4px;
- }
- .chart-title .operation {
- //gap: px2rpx(4);
- margin-left: px2rpx(10);
- color: #666;
- margin-bottom: px2rpx(10);
- height: px2rpx(48);
- width: px2rpx(100);
- font-size: px2rpx(16);
- line-height: px2rpx(48)!important;
- }
- .chart-container {
- margin-top: px2rpx(20);
- height: px2rpx(350);
- }
- .popup-content .form {
- padding: px2rpx(16);
- }
- .popup-content .form-item {
- margin-bottom: px2rpx(20);
- }
- .popup-content .form-label {
- display: block;
- font-size: px2rpx(14);
- color: #666;
- margin-bottom: px2rpx(8);
- }
- .popup-content .picker-value {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: px2rpx(12);
- background: #f5f5f5;
- border-radius: 4px;
- font-size: px2rpx(14);
- color: #333;
- }
- .crm-cursor {
- cursor: pointer;
- }
- .crm-border-radius {
- border-radius: 8px;
- }
- </style>
|