|
|
@@ -47,16 +47,18 @@
|
|
|
<li>
|
|
|
<el-popover trigger="hover" :title="t('account.formula')" :content="t('account.tips1')" :width="220">
|
|
|
<template #reference>
|
|
|
- <span :class="accountStore.currentAccount.hazardRatioColor" style="cursor: pointer;">{{ t('account.riskRate1') }}{{
|
|
|
- parsePercent(accountStore.currentAccount.hazardRatio) }}</span>
|
|
|
+ <span :class="accountStore.currentAccount.hazardRatioColor" style="cursor: pointer;">{{
|
|
|
+ t('account.riskRate1') }}{{
|
|
|
+ parsePercent(accountStore.currentAccount.hazardRatio) }}</span>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
</li>
|
|
|
<li>
|
|
|
<el-popover trigger="hover" :title="t('account.formula')" :content="t('account.tips2')" :width="280">
|
|
|
<template #reference>
|
|
|
- <span :class="accountStore.currentAccount.hazardRatioColor" style="cursor: pointer;">{{ t('account.cutRate') }}{{
|
|
|
- parsePercent(accountStore.currentAccount.liquidationRate) }}</span>
|
|
|
+ <span :class="accountStore.currentAccount.hazardRatioColor" style="cursor: pointer;">{{
|
|
|
+ t('account.cutRate') }}{{
|
|
|
+ parsePercent(accountStore.currentAccount.liquidationRate) }}</span>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
</li>
|
|
|
@@ -73,7 +75,8 @@
|
|
|
<span>{{ serverTime?.format('HH:mm:ss') }}</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <el-tooltip :hide-after="0" :content="`${ t('account.quoteservice') }${ quoteServerStatus ? t('account.connected') : t('account.unconnected') }`">
|
|
|
+ <el-tooltip :hide-after="0"
|
|
|
+ :content="`${t('account.quoteservice')}${quoteServerStatus ? t('account.connected') : t('account.unconnected')}`">
|
|
|
<i :class="['server-status', quoteServerStatus ? 'green' : 'red']"></i>
|
|
|
</el-tooltip>
|
|
|
</li>
|
|
|
@@ -86,7 +89,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, onMounted, onUnmounted, computed } from 'vue'
|
|
|
import { RouteRecordNormalized, RouteRecordName } from 'vue-router'
|
|
|
-import moment, { Moment } from 'moment'
|
|
|
+import moment, { Moment } from 'moment-timezone'
|
|
|
import { timerTask } from '@/utils/timer'
|
|
|
import { parsePercent } from '@/filters'
|
|
|
import { getServerTime } from '@/services/api/common'
|
|
|
@@ -182,7 +185,8 @@ const onTabChange = () => {
|
|
|
// 校验服务器时间
|
|
|
const checkServerTime = () => {
|
|
|
getServerTime().then((res) => {
|
|
|
- serverTime.value = moment.parseZone(res.data)
|
|
|
+ const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone // 获取本地时区
|
|
|
+ serverTime.value = moment.tz(res.data, localTimeZone)
|
|
|
// 每1分钟同步一次服务器时间
|
|
|
timerTask.setTimeout(() => {
|
|
|
checkServerTime()
|