Compare commits

..

1 Commits

Author SHA1 Message Date
ylx d128e35907 更新 README.md 2025-04-22 06:28:40 +00:00
210 changed files with 666 additions and 10252 deletions

View File

@ -6,7 +6,6 @@ ENV = 'development'
#开发环境
VUE_APP_BASE_API = 'https://test.m2pool.com/api/'
# VUE_APP_BASE_API = 'http://10.168.2.150:8101/'
VUE_APP_BASE_URL = 'https://test.m2pool.com/'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

Binary file not shown.

View File

@ -290,45 +290,13 @@
}
},
"@babel/helpers": {
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz",
"integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==",
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz",
"integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==",
"dev": true,
"requires": {
"@babel/template": "^7.27.0",
"@babel/types": "^7.27.0"
},
"dependencies": {
"@babel/parser": {
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz",
"integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==",
"dev": true,
"requires": {
"@babel/types": "^7.27.0"
}
},
"@babel/template": {
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz",
"integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.26.2",
"@babel/parser": "^7.27.0",
"@babel/types": "^7.27.0"
}
},
"@babel/types": {
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz",
"integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==",
"dev": true,
"requires": {
"@babel/helper-string-parser": "^7.25.9",
"@babel/helper-validator-identifier": "^7.25.9"
}
}
"@babel/template": "^7.26.9",
"@babel/types": "^7.26.9"
}
},
"@babel/highlight": {
@ -1136,9 +1104,9 @@
}
},
"@babel/runtime": {
"version": "7.27.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz",
"integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==",
"version": "7.26.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.9.tgz",
"integrity": "sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.14.0"
@ -1750,11 +1718,6 @@
"integrity": "sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==",
"dev": true
},
"@stomp/stompjs": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/@stomp/stompjs/-/stompjs-7.1.1.tgz",
"integrity": "sha512-chcDs6YkAnKp1FqzwhGvh3i7v0+/ytzqWdKYw6XzINEKAzke/iD00dNgFPWSZEqktHOK+C1gSzXhLkLbARIaZw=="
},
"@trysound/sax": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
@ -3069,9 +3032,9 @@
}
},
"axios": {
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
"version": "1.7.9",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
"requires": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",

View File

@ -10,9 +10,8 @@
},
"dependencies": {
"@dreysolano/prerender-spa-plugin": "^1.0.3",
"@stomp/stompjs": "^7.1.1",
"amfe-flexible": "^2.2.1",
"axios": "^1.8.4",
"axios": "^1.5.0",
"core-js": "^3.8.3",
"echarts": "^5.5.1",
"element-ui": "^2.15.14",

View File

@ -45,7 +45,7 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4582735_7i8wfzc0art.css">
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4582735_irzdjxdsrq8.css">
<title>M2pool - Stable leading high-yield mining pool</title>
<meta name="keywords" content="M2Pool, cryptocurrency mining pool,Entropyx(enx),entropyx, bitcoin mining, DGB mining, mining pool service, 加密货币矿池, 比特币挖矿, DGB挖矿">
<meta name="description" content="M2Pool provides professional mining services, supporting multiple cryptocurrency mining, including nexa, grs, mona, dgb, rxd, enx">

View File

@ -1,19 +1,16 @@
<template>
<div id="app">
<router-view class="page" />
<ChatWidget v-if="!$route.path.includes('/customerService') && !$isMobile" />
</div>
</template>
<script >
import ChatWidget from '../src/components/ChatWidget.vue';
import { Debounce, throttle } from '@/utils/publicMethods';
import Vue from 'vue'
export default {
name: 'App',
components: {
ChatWidget
},
data() {
return {

View File

@ -1,78 +0,0 @@
import request from '../utils/request'
//历史聊天记录查询 用户查询七天前的聊天信息
export function getHistory(data) {
return request({
url: `chat/message/find/history/message`,
method: 'post',
data
})
}
//历史聊天记录查询 查询七天内记录
export function getHistory7(data) {
return request({
url: `chat/message/find/recently/message`,
method: 'post',
data
})
}
//用户点击对话框默认已读
export function getReadMessage(data) {
return request({
url: `chat/message/read/message`,
method: 'post',
data
})
}
//聊天列表
export function getRoomList(data) {
return request({
url: `/chat/rooms/find/room/list`,
method: 'post',
data
})
}
//重要聊天标记
export function getUpdateRoom(data) {
return request({
url: `/chat/rooms/update/room`,
method: 'post',
data
})
}
//图片上传接口
// export function getFileUpdate(data) {
// return request({
// url: `file/update`,
// method: 'post',
// data
// })
// }
//图根据当前用户邮箱查询聊天室id
export function getUserid(data) {
return request({
url: `chat/rooms/find/room/by/userid`,
method: 'post',
data
})
}
//上传图片
export function getFileUpdate(data) {
return request({
url: `pool/ticket/uploadFile`,
method: 'post',
data
})
}

File diff suppressed because it is too large Load Diff

View File

@ -382,15 +382,10 @@ export default {
document.addEventListener("click", function () {
const dropdown = document.querySelector(".dropdown");
const arrow = document.querySelector(".arrow");
try {
if (dropdown.classList.contains("show")) {
if (dropdown.classList.contains("show")) {
dropdown.classList.remove("show");
arrow.classList.remove("up");
}
} catch (error) {
console.log(error)
}
});
@ -450,8 +445,6 @@ export default {
async fetchSignOut() {
const data = await getLogout();
if (data && data.code == 200) {
// Vuex logout action
await this.$store.dispatch('logout')
const lang = this.$i18n.locale;
this.$router.push(`/${lang}`);
}
@ -702,11 +695,8 @@ export default {
justify-content: center;
}
.miningAccountTitle:hover {
color: #6e3edb !important;
}
.hidden {
display: block;

View File

@ -1,235 +0,0 @@
export const ChatWidget_zh = {
chat:{
title: '在线客服',
welcome: '欢迎使用在线客服,请问有什么可以帮您?',
placeholder: '请输入您的消息...',
send: '发送',
close: '关闭',
inputPlaceholder:"请输入您的问题...",
onlyImages:"只能上传图片文件!",
imageTooLarge:"图片大小不能超过5MB!",
imageReceived:"已收到您的图片,我们会尽快处理您的问题。",
networkError:"网络连接已断开,请刷新页面重试",
openCustomerService:"打开客服聊天",
connectToCustomerService:"正在连接客服系统...",
connectionFailed:"连接失败,请刷新页面重试",
tryConnectingAgain:"重试连接",
loading:"加载中...",
loadMore:"加载更多历史消息",
welcomeToUse:"欢迎使用在线客服,请问有什么可以帮您?",
picture:"聊天图片",
read:"已读",
unread:"未读",
subscriptionFailed:"消息订阅失败,可能无法接收新消息",
break:"连接断开",
retry:"秒后重试",
disconnectWaiting:"断线重连中...",
sendFailed:"发送消息失败,请重试",
noHistory:"暂无历史消息",
historicalFailure:"加载历史消息失败,请重试",
loadingHistory:"正在加载更多历史消息...",
noMoreHistory:"没有更多历史消息了",
Loaded:"已加载历史消息",
newMessage:"新消息",
pictureMessage:"图片消息",
initializationFailed:"初始化失败,请刷新页面重试",
beSorry:"抱歉,我暂时无法回答这个问题。请排队等待人工客服或提交工单。",
today:"今天",
yesterday:"昨天",
canOnlyUploadImages:"只能上传图片文件!",
imageSizeExceeded:"图片大小不能超过5MB!",
uploading:"正在上传图片...",
pictureFailed:"发送图片失败,请重试",
readImage:"读取图片失败,请重试",
processingFailed:"图片处理失败,请重试",
Disconnected:"连接已断开",
reconnecting:"正在重连...",
contactList:"联系列表",
search:"搜索最近联系人",
tourist:"游客",
important:"重要",
markAsImportant:"标记为重要",
cancelImportant:"已取消重要标记",
markingFailed:"标记操作失败,请重试",
Marked:"已标记为重要",
select:"请选择联系人",
notSelected:"您尚未选择联系人",
None:"暂无消息记录",
sendPicture:"发送图片",
inputMessage:"请输入消息按Enter键发送按Ctrl+Enter键换行",
bottom:"回到底部",
Preview:"预览图片",
chatRoom:"聊天室",
CLOSED:"已关闭",
picture2:"图片",
Unnamed:"未命名聊天室",
noNewsAtTheMoment:"暂无未读消息",
contactFailed:"加载更多联系人失败",
listException:"获取聊天室列表异常",
my:"我",
unknownSender:"未知发送者",
recordFailed:"加载聊天记录失败",
messageException:"加载消息异常",
chooseFirst:"请先选择联系人",
chatDisconnected:"聊天连接已断开,请刷新页面重试",
pictureSuccessful:"图片已发送",
history:"历史记录",
loadFailed:"加载失败",
guestNotice:"您当前以游客身份聊天,聊天记录将不会保存。",
guestNotice2:"后即可保存聊天记录",
loginToSave:"登录",
server500:"服务器暂时不可用,请稍后重试",
CheckNetwork:"连接失败,请检查网络后重试",
attemptToReconnect:"连接已断开,正在尝试重连...",
retryFailed:"重试连接失败,请刷新页面",
maxConnectionsError:"连接数已达上限,请刷新页面重试",
ipLimitError:"本机连接数已达上限,请刷新页面重试",
serverLimitError:"服务器连接数已达上限,请稍后刷新重试",
identityError:"用户身份设置失败,请刷新页面重试",
emailError:"用户信息获取失败,请刷新页面重试",
refreshPage:"刷新页面",
reconnectSuccess:"重新连接成功",
sendMessageEmpty:"发送消息不能为空",
unableToSubscribe:"连接状态异常,刷新页面重试",
conflict:"连接异常,可能是多窗口冲突,请关闭其他窗口重试",
abnormal:"连接异常",
networkAnomaly:"网络连接异常",
customerServiceOffline:"客服离线,请登录账号发送留言消息",
contentMax:"超出发送内容大小限制,请删除部分内容(300字以内)",
failInSend:"发送失败,请重试",
connectionLimitError:"连接数已达上限,请关闭一些窗口后刷新重试",
serverBusy:"服务器繁忙,请稍后刷新重试",
connectionTimedOut:"连接超时,稍后重试...",
reconnectFailed:"重连失败,请稍后重试",
serviceConfigurationError:"服务配置异常,请稍后重试",
serviceAddressUnavailable:"服务地址不可用,请稍后重试",
connectionFailedService:"无法连接到服务器,请稍后重试",
connectionFailedCustomer:"连接客服系统失败,请检查网络或稍后重试",
},
}
export const ChatWidget_en = {
chat:{
title: 'Online Customer Service',
welcome: 'Welcome to the online customer service, what can I help you with?',
placeholder: 'Please enter your message...',
send: 'Send',
close: 'Close',
inputPlaceholder:"Please enter your question...",
onlyImages:"Only image files can be uploaded!",
imageTooLarge:"The image size cannot exceed 5MB!",
imageReceived:"We have received your image, and we will handle your question as soon as possible.",
networkError: "Network disconnected, please refresh page",
openCustomerService: "Open customer service chat",
connectToCustomerService: "Connecting to customer service...",
connectionFailed: "Connection failed, please refresh page",
tryConnectingAgain: "Retry connection",
loading: "Loading...",
loadMore: "Load more history",
welcomeToUse: "Welcome to online service, how can I help you?",
picture: "Chat image",
read: "Read",
unread: "Unread",
subscriptionFailed: "Message subscription failed",
break: "Connection lost",
retry: "Retry in seconds",
disconnectWaiting: "Reconnecting...",
sendFailed: "Send failed, please retry",
noHistory: "No history",
historicalFailure: "Failed to load history",
loadingHistory: "Loading more history...",
noMoreHistory: "No more history",
Loaded: "History loaded",
newMessage: "New message",
pictureMessage: "Image message",
initializationFailed: "Initialization failed, please refresh",
beSorry: "Sorry, I cannot answer this. Please wait for agent or submit ticket",
today: "Today",
yesterday: "Yesterday",
canOnlyUploadImages: "Only image files allowed",
imageSizeExceeded: "Image size exceeds 5MB",
uploading: "Uploading image...",
pictureFailed: "Failed to send image",
readImage: "Failed to read image",
processingFailed: "Image processing failed",
Disconnected: "Disconnected",
reconnecting: "Reconnecting...",
contactList: "Contact list",
search: "Search contacts",
tourist: "Guest",
important: "Important",
markAsImportant: "Mark as important",
cancelImportant: "Unmarked as important",
markingFailed: "Marking failed",
select: "Select contact",
notSelected: "No contact selected",
None: "No messages",
sendPicture: "Send image",
inputMessage: "Type message, Enter to send, Ctrl+Enter for new line",
bottom: "to bottom",
Preview: "Preview image",
chatRoom: "Chat room",
CLOSED: "Closed",
picture2: "Image",
Unnamed: "Unnamed chat",
noNewsAtTheMoment: "No unread messages",
contactFailed: "Failed to load contacts",
listException: "Failed to get chat list",
my: "Me",
unknownSender: "Unknown sender",
recordFailed: "Failed to load chat records",
messageException: "Failed to load messages",
chooseFirst: "Please select contact first",
chatDisconnected: "Chat disconnected, please refresh",
pictureSuccessful: "Image sent",
history:"History",
loadFailed:"Load Fail",
Marked:"Marked as important",
guestNotice:"You are currently chatting as a guest, and your chat history will not be saved.",
guestNotice2:" to save chat history",
loginToSave:"Login",
server500:"The server is temporarily unavailable, please try again later",
CheckNetwork:"Connection failed, please check the network and try again",
attemptToReconnect:"Connection lost, attempting to reconnect...",
retryFailed:"Retry connection failed, please refresh page",
maxConnectionsError:"Connection limit reached, please refresh page",
ipLimitError:"Connection limit reached, please refresh page",
serverLimitError:"Connection limit reached, please try again later",
identityError:"Failed to set user identity, please refresh page",
emailError:"Failed to get user information, please refresh page",
refreshPage:"Refresh page",
reconnectSuccess:"Reconnect successfully",
sendMessageEmpty:"Message cannot be empty",
unableToSubscribe:"Connection status abnormal, please refresh the page",
conflict:"Connection exception, possibly due to multiple window conflicts, please close other windows and try again",
abnormal:"Connection exception",
networkAnomaly:"Network connection exception",
customerServiceOffline:"Customer service offline, please login to send message",
contentMax:"Content exceeds the size limit, please delete some content(300 characters or less)",
failInSend:"Failed to send, please try again",
connectionLimitError:"Connection limit reached, please close some windows and refresh to try again",
serverBusy:"Server busy, please refresh later",
connectionTimedOut:"Connection timed out, please try again later",
reconnectFailed:"Reconnect failed, please try again later",
serviceConfigurationError:"Service configuration exception, please try again later",
serviceAddressUnavailable:"Service address unavailable, please try again later",
connectionFailedService:"Failed to connect to the server, please try again later",
connectionFailedCustomer:"Failed to connect to the customer service system, please check the network or try again later",
}
}

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,6 @@ import {workOrder_zh,workOrder_en} from'./submitWorkOrder'
import {alerts_zh,alerts_en} from'./alerts'
import {seo_zh,seo_en} from'./seo'
import {chooseUs_zh,chooseUs_en} from'./dataDisplay'
import {ChatWidget_zh,ChatWidget_en} from'./ChatWidget'
@ -31,7 +30,7 @@ export default {
...alerts_zh,
...seo_zh,
...chooseUs_zh,
...ChatWidget_zh,
},
@ -51,7 +50,7 @@ export default {
...alerts_en,
...seo_en,
...chooseUs_en,
...ChatWidget_en,

View File

@ -11,12 +11,6 @@ import './assets/icons/iconfont/iconfont.css'
import {$addStorageEvent} from '../src/utils/publicMethods'
import MetaInfo from 'vue-meta-info'
import loadingStateMixin from './utils/loadingStateMixin';
import networkRecoveryMixin from './mixins/networkRecoveryMixin';
import './utils/loadingRecovery';
import errorNotificationManager from '../src/utils/errorNotificationManager';
// 创建事件总线 用于组件通信
Vue.prototype.$bus = new Vue();
Vue.use(MetaInfo)
Vue.prototype.$addStorageEvent = $addStorageEvent // 添加storage事件
@ -27,9 +21,7 @@ Vue.use(ElementUI, {
Vue.prototype.$axios = axios
console.log = ()=>{} //全局关闭打印
// 全局注册混入
Vue.mixin(loadingStateMixin);
Vue.mixin(networkRecoveryMixin);
Vue.prototype.$baseApi = process.env.VUE_APP_BASE_URL //图片base路径
const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
@ -53,11 +45,6 @@ router.beforeEach((to, from, next) => {
next();
});
// 定期清理过期的错误记录
setInterval(() => {
errorNotificationManager.cleanup();
}, 60000); // 每分钟清理一次
window.vm = new Vue({
router,
store,

View File

@ -1,61 +0,0 @@
//处理断网重连后数据刷新的混入
export default {
data() {
return {
// 注册需要在网络恢复时调用的方法名
recoveryMethods: [],
// 上次调用这些方法时的参数
methodParams: {}
};
},
methods: {
/**
* 注册需要在网络恢复时自动重新调用的方法
* @param {String} methodName - 方法名
* @param {*} params - 调用方法时需要的参数
*/
registerRecoveryMethod(methodName, params) {
if (typeof this[methodName] === 'function' && !this.recoveryMethods.includes(methodName)) {
this.recoveryMethods.push(methodName);
this.methodParams[methodName] = params;
console.log(`[NetworkRecovery] 注册方法: ${methodName}`);
}
},
/**
* 更新方法的参数
* @param {String} methodName - 方法名
* @param {*} params - 新的参数
*/
updateMethodParams(methodName, params) {
if (this.recoveryMethods.includes(methodName)) {
this.methodParams[methodName] = params;
}
},
/**
* 网络恢复后调用所有注册的方法
*/
handleNetworkRecovery() {
console.log('[NetworkRecovery] 网络已恢复,正在刷新数据...');
this.recoveryMethods.forEach(methodName => {
if (typeof this[methodName] === 'function') {
const params = this.methodParams[methodName];
console.log(`[NetworkRecovery] 重新调用方法: ${methodName}`);
this[methodName](params);
}
});
}
},
mounted() {
// 监听网络恢复事件
window.addEventListener('network-retry-complete', this.handleNetworkRecovery);
},
beforeDestroy() {
// 清理事件监听
window.removeEventListener('network-retry-complete', this.handleNetworkRecovery);
}
};

View File

@ -32,7 +32,7 @@ const childrenRoutes = [
component: () => import('../views/miningAccount/index.vue'),
meta: {title: '挖矿账户页面',
description:i18n.t(`seo.miningAccount`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool mining account, crypto mining stats, mining rewards, hashrate monitor, 矿池账户, 挖矿收益, 算力监控'
keywords:{
en: 'M2Pool mining account, crypto mining stats, mining rewards, hashrate monitor, 矿池账户, 挖矿收益, 算力监控',
@ -63,7 +63,7 @@ const childrenRoutes = [
component: () => import('../views/reportBlock/index.vue'),
meta: {title: '报块页面',
description:i18n.t(`seo.reportBlock`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,报块页面,幸运值,区块高度,Block page,Lucky Value,block height,Mining Pool'
keywords:{
en: 'Block page,Lucky Value,block height,Mining Pool',
@ -118,22 +118,6 @@ const childrenRoutes = [
}
},
{//在线客服
path: 'customerService',
name: 'CustomerService',
component: () => import('../views/customerService/index.vue'),
meta: {title: '在线客服',
description:i18n.t(`seo.apiFile`),
allAuthority:[`customer_service`],//客服权限
// keywords: 'M2Pool 矿池,API 文档,认证 token,接口调用,API file,authentication token,Interface call'
keywords:{
en: 'API file,authentication token,Interface call',
zh: 'M2Pool 矿池,API 文档,认证 token,接口调用'
}
}
},
{//接入矿池页面
path: '/:lang/AccessMiningPool',
name: 'AccessMiningPool',
@ -308,7 +292,7 @@ const childrenRoutes = [
component: () => import('../views/submitWorkOrder/index.vue'),
meta: {title: '提交工单页面',
description:i18n.t(`seo.submitWorkOrder`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,提交工单,技术支持,问题处理,Mining Pool,Work Order Submission, Technical Support, Troubleshooting'
keywords:{
en: 'Mining Pool,Work Order Submission, Technical Support, Troubleshooting',
@ -322,7 +306,7 @@ const childrenRoutes = [
component: () => import('../views/workOrderRecords/index.vue'),
meta: {title: '工单记录页面(用户)',
description:i18n.t(`seo.workOrderRecords`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,用户工单记录,处理状态,问题进度,User Work Order Records, Processing Status, Issue Progress'
keywords:{
en: 'User Work Order Records, Processing Status, Issue Progress',
@ -336,7 +320,7 @@ const childrenRoutes = [
component: () => import('../views/userWorkDetails/index.vue'),
meta: {title: '工单详情页面(用户)',
description:i18n.t(`seo.userWorkDetails`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,用户工单详情,问题描述,补充提交,User Work Order Details, Problem Description, Additional Submissions'
keywords:{
en: 'User Work Order Details, Problem Description, Additional Submissions',
@ -408,7 +392,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/index.vue'),
meta: {title: '个人中心页面',
description:i18n.t(`seo.personalCenter`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,个人中心,挖矿账户,只读页面设置安全设置API密钥生成,Personal Center,Mining Account,Read-Only Page Setup,Security Settings,API Key Generation'
keywords:{
en: 'Personal Center,Mining Account,Read-Only Page Setup,Security Settings,API Key Generation',
@ -422,7 +406,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/personalMining/index.vue'),
meta: {title: '挖矿账户设置页面',
description:i18n.t(`seo.personalMining`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,个人中心,挖矿账户设置,币种账户,Personal Center,Mining Account Settings,Coin Accounts'
keywords:{
en: 'Personal Center,Mining Account Settings,Coin Accounts',
@ -436,7 +420,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/readOnly/index.vue'),
meta: {title: '只读页面设置',
description:i18n.t(`seo.readOnly`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,个人中心,只读页面设置,矿池分享,Personal Center,Read-Only Page Setting,Mining Pool Sharing'
keywords:{
en: 'Personal Center,Read-Only Page Setting,Mining Pool Sharing',
@ -450,7 +434,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/securitySetting/index.vue'),
meta: {title: '安全设置页面',
description:i18n.t(`seo.securitySetting`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,安全设置,密码修改,Security settings, password change'
keywords:{
en: 'Security settings, password change',
@ -464,7 +448,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/personal/index.vue'),
meta: {title: '个人信息页面',
description:i18n.t(`seo.personal`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,个人信息,登录历史,Personal Information, Login History'
keywords:{
en: 'Personal Information, Login History',
@ -478,7 +462,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/miningReport/index.vue'),
meta: {title: '挖矿报告页面',
description:i18n.t(`seo.miningReport`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,个人中心,挖矿报告,订阅服务,Mining Report, Subscription Service'
keywords:{
en: 'Mining Report, Subscription Service',
@ -493,7 +477,7 @@ const childrenRoutes = [
component: () => import('../views/personalCenter/personalAPI/index.vue'),
meta: {title: 'API页面',
description:i18n.t(`seo.personalAPI`),
allAuthority:[`admin`,`registered`,`customer_service`],
allAuthority:[`admin`,`registered`],
// keywords: 'M2Pool 矿池,个人中心,API 页面,API密钥生成,API Page,API Key Generation'
keywords:{
en: 'API Page,API Key Generation',
@ -657,7 +641,6 @@ router.beforeEach((to, from, next) => {
let data = localStorage.getItem("jurisdiction");
let jurisdiction =JSON.parse(data);
console.log(jurisdiction,"权限");
localStorage.setItem('superReportError',"")
let element = document.getElementsByClassName('el-main')[0];
@ -690,10 +673,7 @@ console.log(jurisdiction,"权限");
message:i18n.t(`mining.jurisdiction`),
type: 'error'
});
next({ path: `/${lang}` }) // 添加这行,重定向到首页
}
}else{

View File

@ -5,48 +5,12 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
isLoggedIn: false,
userInfo: null
},
getters: {
isLoggedIn: state => state.isLoggedIn,
userInfo: state => state.userInfo
},
mutations: {
SET_LOGIN_STATE(state, isLoggedIn) {
state.isLoggedIn = isLoggedIn
},
SET_USER_INFO(state, userInfo) {
state.userInfo = userInfo
},
CLEAR_USER_DATA(state) {
state.isLoggedIn = false
state.userInfo = null
}
},
actions: {
// 退出登录
async logout({ commit }) {
try {
// 清除本地存储
localStorage.removeItem('token')
localStorage.removeItem('userEmail')
localStorage.removeItem('jurisdiction')
// 清除 Vuex 状态
commit('CLEAR_USER_DATA')
// 触发全局事件,通知其他组件用户已退出
if (Vue.prototype.$bus) {
Vue.prototype.$bus.$emit('user-logged-out')
}
return true
} catch (error) {
console.error('退出登录失败:', error)
return false
}
}
},
modules: {
}

View File

@ -1,74 +0,0 @@
/**
* 错误提示管理器
* 用于控制错误提示的频率避免短时间内重复显示相同类型的错误
*/
class ErrorNotificationManager {
constructor() {
// 记录最近显示的错误信息
this.recentErrors = new Map();
// 默认节流时间 (30秒)
this.throttleTime = 3000;
// 错误类型映射
this.errorTypes = {
'Network Error': 'network',
'timeout': 'timeout',
'Request failed with status code': 'statusCode',
// 添加网络状态类型
'networkReconnected': 'networkStatus',
'NetworkError': 'network'
};
}
/**
* 获取错误类型
* @param {String} message 错误信息
* @returns {String} 错误类型
*/
getErrorType(message) {
for (const [key, type] of Object.entries(this.errorTypes)) {
if (message.includes(key)) {
return type;
}
}
return 'unknown';
}
/**
* 检查是否可以显示错误
* @param {String} message 错误信息
* @returns {Boolean} 是否可以显示
*/
canShowError(message) {
const errorType = this.getErrorType(message);
const now = Date.now();
// 检查同类型的错误是否最近已经显示过
if (this.recentErrors.has(errorType)) {
const lastTime = this.recentErrors.get(errorType);
if (now - lastTime < this.throttleTime) {
console.log(`[错误提示] 已抑制重复错误: ${errorType}`);
return false;
}
}
// 更新最后显示时间
this.recentErrors.set(errorType, now);
return true;
}
/**
* 清理过期的错误记录
*/
cleanup() {
const now = Date.now();
this.recentErrors.forEach((time, type) => {
if (now - time > this.throttleTime) {
this.recentErrors.delete(type);
}
});
}
}
// 创建单例实例
const errorNotificationManager = new ErrorNotificationManager();
export default errorNotificationManager;

View File

@ -1,41 +0,0 @@
import Vue from 'vue';
/**
* 自动恢复加载状态的指令
* 用法: v-loading-recovery="{ loading: 'loadingProp', recovery: ['method1', 'method2'] }"
*/
export const loadingRecoveryDirective = {
// 当绑定元素插入到 DOM 中时
inserted(el, binding, vnode) {
const component = vnode.context;
const { loading, recovery } = binding.value || {};
if (!loading || !recovery || !Array.isArray(recovery)) return;
// 为组件添加加载状态恢复的逻辑
const handleNetworkRecovery = () => {
// 当网络恢复时自动设置loading为false
if (component[loading]) {
component[loading] = false;
}
};
// 保存到元素上,以便后续清理
el._loadingRecovery = handleNetworkRecovery;
window.addEventListener('network-retry-complete', handleNetworkRecovery);
console.log(`[LoadingRecovery] 添加加载状态恢复: ${loading}`);
},
// 当指令与元素解绑时
unbind(el) {
// 清理事件监听
if (el._loadingRecovery) {
window.removeEventListener('network-retry-complete', el._loadingRecovery);
delete el._loadingRecovery;
}
}
};
// 注册全局指令
Vue.directive('loading-recovery', loadingRecoveryDirective);

View File

@ -2,15 +2,6 @@ import axios from 'axios'
import errorCode from './errorCode'
import { Notification, MessageBox, Message } from 'element-ui'
import loadingManager from './loadingManager';
import errorNotificationManager from './errorNotificationManager';
const pendingRequestMap = new Map(); //处理Request aborted 错误
function getRequestKey(config) { //处理Request aborted 错误 生成唯一 key 的函数
const { url, method, params, data } = config;
return [url, method, JSON.stringify(params), JSON.stringify(data)].join('&');
}
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
@ -28,51 +19,10 @@ let lastNetworkErrorTime = 0; // 上次网络错误提示时间
let pendingRequests = new Map();
// 网络状态监听器
// 网络状态最后提示时间
let lastNetworkStatusTime = {
online: 0,
offline: 0
};
// 创建一个全局标志,确保每次网络恢复只显示一次提示
let networkRecoveryInProgress = false;
// 网络状态监听器
window.addEventListener('online', () => {
const now = Date.now();
// 避免短时间内多次触发
if (networkRecoveryInProgress) {
console.log('[网络] 网络恢复处理已在进行中,忽略重复事件');
return;
}
networkRecoveryInProgress = true;
// 严格检查是否应该显示提示
if (now - lastNetworkStatusTime.online > 30000) { // 30秒内不重复提示
lastNetworkStatusTime.online = now;
try {
if (window.vm && window.vm.$message) {
// 确保消息只显示一次
window.vm.$message({
message: window.vm.$i18n.t('home.networkReconnected') || '网络已重新连接,正在恢复数据...',
type: 'success',
duration: 5000,
showClose: true,
});
console.log('[网络] 显示网络恢复提示, 时间:', new Date().toLocaleTimeString());
}
} catch (e) {
console.error('[网络] 显示网络恢复提示失败:', e);
}
} else {
console.log('[网络] 抑制重复的网络恢复提示, 间隔过短:', now - lastNetworkStatusTime.online + 'ms');
}
// 网络恢复时,重试所有待处理的请求
const now = Date.now();
const pendingPromises = [];
pendingRequests.forEach(async (request, key) => {
@ -121,53 +71,34 @@ window.addEventListener('online', () => {
// 等待所有请求完成
Promise.allSettled(pendingPromises).then(() => {
// 重置所有 loading 状态
if (loadingManager) {
loadingManager.resetAllLoadingStates();
}
// 手动重置一些关键的 loading 状态
if (window.vm) {
// 常见的加载状态
const commonLoadingProps = [
'minerChartLoading', 'reportBlockLoading', 'apiPageLoading',
'MiningLoading', 'miniLoading'
];
commonLoadingProps.forEach(prop => {
if (typeof window.vm[prop] !== 'undefined') {
window.vm[prop] = false;
}
});
}
loadingManager.resetAllLoadingStates();
// 触发网络重试完成事件
window.dispatchEvent(new CustomEvent('network-retry-complete'));
// 重置网络恢复标志
setTimeout(() => {
networkRecoveryInProgress = false;
}, 5000); // 5秒后允许再次处理网络恢复
});
// 显示网络恢复提示
if (window.vm && window.vm.$message) {
window.vm.$message({
message: window.vm.$i18n.t('home.networkReconnected') || '网络已重新连接,正在恢复数据...',
type: 'success',
duration: 3000
});
}
});
// 使用错误提示管理器控制网络断开提示
window.addEventListener('offline', () => {
if (window.vm && window.vm.$message && errorNotificationManager.canShowError('networkOffline')) {
if (window.vm && window.vm.$message) {
window.vm.$message({
message: window.vm.$i18n.t('home.networkOffline') || '网络连接已断开,系统将在恢复连接后自动重试',
type: 'error',
duration: 5000,
showClose: true,
type: 'warning',
duration: 3000
});
}
});
service.defaults.retry = 2;// 重试次数
service.defaults.retryDelay = 2000;
service.defaults.shouldRetry = (error) => {
// 只有网络错误或超时错误才进行重试
return error.message === "Network Error" || error.message.includes("timeout");
};
service.defaults.shouldRetry = (error) => true
localStorage.setItem('superReportError', "")
let superReportError = localStorage.getItem('superReportError')
@ -219,22 +150,6 @@ service.interceptors.request.use(config => {
config.params = {};
config.url = url;
}
// 生成请求唯一key 处理Request aborted 错误
const requestKey = getRequestKey(config);
// 如果有相同请求,先取消 处理Request aborted 错误
if (pendingRequestMap.has(requestKey)) {
const cancel = pendingRequestMap.get(requestKey);
cancel(); // 取消上一次请求
pendingRequestMap.delete(requestKey);
}
// 创建新的CancelToken 处理Request aborted 错误
config.cancelToken = new axios.CancelToken(cancel => {
pendingRequestMap.set(requestKey, cancel);
});
return config
}, error => {
Promise.reject(error)
@ -242,10 +157,6 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
// 请求完成后移除
const requestKey = getRequestKey(res.config);
pendingRequestMap.delete(requestKey);
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息
@ -308,18 +219,12 @@ service.interceptors.response.use(res => {
},
error => {
if (error.message && error.message.includes('canceled') || error.message.includes('Request aborted')) {
// 主动取消的请求,直接忽略,不提示
return Promise.reject(error);
}
// 请求异常也要移除 处理Request aborted 错误
if (error.config) {
const requestKey = getRequestKey(error.config);
pendingRequestMap.delete(requestKey);
}
let { message } = error;
if (message == "Network Error" || message.includes("timeout")) {
if (!navigator.onLine) {
// 断网状态,添加到重试队列
@ -329,7 +234,7 @@ service.interceptors.response.use(res => {
params: error.config.params,
data: error.config.data
});
// 根据URL确定请求类型并记录回调
let callback = null;
if (error.config.url.includes('getPoolPower')) {
@ -346,7 +251,7 @@ service.interceptors.response.use(res => {
}
};
}
if (!pendingRequests.has(requestKey)) {
pendingRequests.set(requestKey, {
config: error.config,
@ -354,40 +259,33 @@ service.interceptors.response.use(res => {
retryCount: 0,
callback: callback
});
console.log('请求已加入断网重连队列:', error.config.url);
}
} else {
// 网络已连接,但请求失败,尝试重试
// 确保 config 中有 __retryCount 字段
error.config.__retryCount = error.config.__retryCount || 0;
// 判断是否可以重试
if (error.config.__retryCount < service.defaults.retry && service.defaults.shouldRetry(error)) {
// 增加重试计数
error.config.__retryCount += 1;
console.log(`[请求重试] ${error.config.url} - 第 ${error.config.__retryCount} 次重试`);
// 创建新的Promise等待一段时间后重试
return new Promise(resolve => {
setTimeout(() => {
resolve(service(error.config));
}, service.defaults.retryDelay);
});
}
// 达到最大重试次数,不再重试
console.log(`[请求失败] ${error.config.url} - 已达到最大重试次数`);
} else if ((error.config.retry > 0 && error.config)) {
// 保留现有的重试逻辑
error.config.retry--;
return new Promise(resolve => {
setTimeout(() => {
resolve(service(error.config));
}, 2000);
});
}
}
if (!superReportError) {
superReportError = "error"
localStorage.setItem('superReportError', superReportError)
//使用错误提示管理器errorNotificationManager
if (errorNotificationManager.canShowError(message)) {
if (message == "Network Error") {
let { message } = error;
if (message == "Network Error") {
// message = "后端接口网络连接异常,请刷新重试";
const now = Date.now();
if (now - lastNetworkErrorTime > NETWORK_ERROR_THROTTLE_TIME) {
lastNetworkErrorTime = now; // 更新最后提示时间
Message({
message: window.vm.$i18n.t(`home.NetworkError`),
type: 'error',
@ -395,38 +293,42 @@ service.interceptors.response.use(res => {
showClose: true
});
}
else if (message.includes("timeout")) {
Message({
message: window.vm.$i18n.t(`home.requestTimeout`),
type: 'error',
duration: 5 * 1000,
showClose: true
});
}
else if (message.includes("Request failed with status code")) {
Message({
message: "系统接口" + message.substr(message.length - 3) + "异常",
type: 'error',
duration: 5 * 1000,
showClose: true
});
} else {
Message({
message: message,
type: 'error',
duration: 5 * 1000,
showClose: true
});
}
}
else if (message.includes("timeout")) {
// message = "系统接口请求超时,请刷新重试";
Message({
message: window.vm.$i18n.t(`home.requestTimeout`),
type: 'error',
duration: 5 * 1000,
showClose: true
})
}
else if (message.includes("Request failed with status code")) {
// message = "系统接口" + message.substr(message.length - 3) + "异常";
Message({
message: "系统接口" + message.substr(message.length - 3) + "异常",
type: 'error',
duration: 5 * 1000,
showClose: true
})
} else {
// 避免完全不提示,可以在控制台记录被抑制的错误
console.log('[错误提示] 已抑制重复错误:', message);
Message({
message: message,
type: 'error',
duration: 5 * 1000,
showClose: true
})
}
}
return Promise.reject(error)
}

View File

@ -1,34 +0,0 @@
//自动记录请求参数,并支持断网重连,创建一个函数装饰器
/**
* 包装请求方法自动注册断网重连恢复
* @param {Object} component - 组件实例
* @param {String} methodName - 方法名
* @param {Function} originalMethod - 原始方法
* @returns {Function} 包装后的方法
*/
export function wrapRequestMethod(component, methodName, originalMethod) {
return async function(...args) {
// 注册为恢复方法(仅当组件支持断网重连恢复)
if (component.registerRecoveryMethod) {
component.registerRecoveryMethod(methodName, args[0]);
}
// 调用原始方法
return await originalMethod.apply(component, args);
};
}
/**
* 自动包装组件中的所有请求方法
* @param {Object} component - 组件实例
* @param {Array<String>} methodNames - 方法名列表
*/
export function wrapComponentMethods(component, methodNames) {
methodNames.forEach(methodName => {
if (typeof component[methodName] === 'function') {
const originalMethod = component[methodName];
component[methodName] = wrapRequestMethod(component, methodName, originalMethod);
console.log(`[RequestWrapper] 包装方法: ${methodName}`);
}
});
}

View File

@ -171,13 +171,10 @@ export default {
// this.stateList = JSON.parse(localStorage.getItem('stateList') )
// this.typeList = JSON.parse(localStorage.getItem('typeList') )
this.registerRecoveryMethod('fetchTicketDetails', { id: this.workOrderId });
},
methods: {
async fetchBKendTicket(params){
// this.totalDetailsLoading =true
this.setLoading('totalDetailsLoading', true);
this.totalDetailsLoading =true
const data = await getBKendTicket(params)
if (data && data.code == 200) {
this.$message({
@ -188,12 +185,11 @@ export default {
}
this.setLoading('totalDetailsLoading', false);
this.totalDetailsLoading =false
},
async fetchReply(params){
// this.totalDetailsLoading = true
this.setLoading('totalDetailsLoading', true);
this.totalDetailsLoading = true
const data = await getReply(params)
if (data && data.code == 200) {
this.$message({
@ -209,7 +205,7 @@ export default {
}
this.setLoading('totalDetailsLoading', false);
this.totalDetailsLoading = false
},
handelType2(label){
if (label) {
@ -235,15 +231,14 @@ export default {
},
//请求工单详情
async fetchTicketDetails(param) {
// this.totalDetailsLoading = true
this.setLoading('totalDetailsLoading', true);
this.totalDetailsLoading = true
const { data } = await getDetails(param)
this.recordList = data.list
this.ticketDetails = data
this.setLoading('totalDetailsLoading', false);
this.totalDetailsLoading = false
},

View File

@ -18,8 +18,7 @@
<div class="textBox">
<p>{{ $t(`ServiceTerms.clauseService1`) }}</p>
<p>{{ $t(`ServiceTerms.clauseService2`) }}</p>
<p style="text-align: justify;"><span style="font-weight: 600 ;text-align: justify;">{{ $t(`ServiceTerms.clauseService3`) }} </span>{{ $t(`ServiceTerms.clauseService4`) }}</p>
<p><span style="font-weight: 600;">{{ $t(`ServiceTerms.clauseService3`) }} </span>{{ $t(`ServiceTerms.clauseService4`) }}</p>
</div>
</section>
@ -89,13 +88,13 @@
<p>{{ $t(`ServiceTerms.clauseTermination2`) }}</p>
</div>
</section>
<!-- <section class="clauseBox">
<section class="clauseBox">
<h5>{{ $t(`ServiceTerms.title11`) }}</h5>
<div class="textBox">
<p>{{ $t(`ServiceTerms.clauseLaw1`) }}</p>
<p>{{ $t(`ServiceTerms.clauseLaw2`) }}</p>
</div>
</section> -->
</section>
</section>
@ -118,8 +117,7 @@
<div class="textBox">
<p>{{ $t(`ServiceTerms.clauseService1`) }}</p>
<p>{{ $t(`ServiceTerms.clauseService2`) }}</p>
<p style="text-align: justify;"><span style="font-weight: 600;text-align: justify;">{{ $t(`ServiceTerms.clauseService3`) }} </span>{{ $t(`ServiceTerms.clauseService4`) }}</p>
<p><span style="font-weight: 600;">{{ $t(`ServiceTerms.clauseService3`) }} </span>{{ $t(`ServiceTerms.clauseService4`) }}</p>
</div>
</section>
@ -189,13 +187,13 @@
<p>{{ $t(`ServiceTerms.clauseTermination2`) }}</p>
</div>
</section>
<!-- <section class="clauseBox">
<section class="clauseBox">
<h3>{{ $t(`ServiceTerms.title11`) }}</h3>
<div class="textBox">
<p>{{ $t(`ServiceTerms.clauseLaw1`) }}</p>
<p>{{ $t(`ServiceTerms.clauseLaw2`) }}</p>
</div>
</section> -->
</section>
</section>

View File

@ -92,7 +92,7 @@ export default {
this.params.maId = this.receiveData.id
}
this.fetchList(this.listParams)
this.registerRecoveryMethod('fetchList', this.listParams);
},
methods:{
@ -100,8 +100,7 @@ export default {
return getImageUrl(path);
},
async fetchAddNoticeEmail(params){
// this.addMinerLoading = true
this.setLoading('addMinerLoading', true);
this.addMinerLoading = true
const data = await getAddNoticeEmail(params)
if (data && data.code == 200) {
this.$message({
@ -122,18 +121,17 @@ export default {
}
}
this.setLoading('addMinerLoading', false);
this.addMinerLoading = false
},
async fetchList(params){
// this.alertsLoading=true
this.setLoading('alertsLoading', true);
this.alertsLoading=true
const data = await getList(params)
if (data && data.code == 200) {
this.tableData = data.rows
}
this.setLoading('alertsLoading', false);
this.alertsLoading=false
},
async fetchCode(params){
@ -149,8 +147,7 @@ export default {
},
async fetchUpdateInfo(params){
// this.addMinerLoading = true
this.setLoading('addMinerLoading', true);
this.addMinerLoading = true
const data = await getUpdateInfo(params)
if (data && data.code == 200) {
this.$message({
@ -162,12 +159,11 @@ export default {
this.fetchList(this.listParams)
}
this.setLoading('addMinerLoading', false);
this.addMinerLoading = false
},
async fetchDeleteEmail(params){
// this.deleteLoading = true
this.setLoading('deleteLoading', true);
this.deleteLoading = true
const data = await deleteEmail(params)
if (data && data.code == 200) {
this.$message({
@ -179,8 +175,8 @@ export default {
this.fetchList(this.listParams)
}
this.setLoading('deleteLoading', false);
this.deleteLoading = false
},
add(){

View File

@ -442,7 +442,7 @@
<!-- 挖矿账号下矿工总览 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.overviewOfMiners`) }}</p>
<p class="Interface">Post /oapi/v1/account/watch</p>
<p class="Interface">Post /oapi/v1/account/miners_list</p>
<p class="hash">{{ $t(`apiFile.jurisdiction`) }} account</p>
<p class="hash">{{ $t(`apiFile.parameter`) }}</p>
<table border="1">
@ -797,7 +797,7 @@
<!-- 指定矿机历史24h平均算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.miningMachineHistory24h`) }}</p>
<p class="Interface">Post /oapi/v1/miner/hashrate_history</p>
<p class="Interface">Post /oapi/v1/miner/hashrate_history</p>
<p class="hash">{{ $t(`apiFile.jurisdiction`) }} miner</p>
<p class="hash">{{ $t(`apiFile.parameter`) }}</p>
<table border="1">
@ -1371,7 +1371,7 @@
<!-- 挖矿账号下矿工总览 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.overviewOfMiners`) }}</p>
<p class="Interface">Post /oapi/v1/account/watch </p>
<p class="Interface">Post /oapi/v1/account/miners_list</p>
<p class="hash">{{ $t(`apiFile.jurisdiction`) }} account</p>
<p class="hash">{{ $t(`apiFile.parameter`) }}</p>
<table border="1">
@ -1726,7 +1726,7 @@
<!-- 指定矿机历史24h平均算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.miningMachineHistory24h`) }}</p>
<p class="Interface">Post /oapi/v1/miner/hashrate_history</p>
<p class="Interface">Get /oapi/v1/miner/hashrate_history</p>
<p class="hash">{{ $t(`apiFile.jurisdiction`) }} miner</p>
<p class="hash">{{ $t(`apiFile.parameter`) }}</p>
<table border="1">

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ import * as echarts from "echarts";
import { Debounce, throttle } from "../../utils/publicMethods";
export default {
data() {
return {
activeName: "second",
@ -76,22 +76,22 @@ export default {
nameTextStyle: {
padding: [0, 0, 0, -40],
},
}
// min: `dataMin`,
// max: `dataMax`,
axisLabel: {
formatter: function (value) {
// let data
// if (value > 10000000) {
// data = `${(value / 10000000)} KW`
// } else if (value > 1000000) {
// data = `${(value / 1000000)} M`
// } else if (value / 10000) {
// data = `${(value / 10000)} W`
// }
return value
}
}
// axisLabel: {
// formatter: function (value) {
// let data
// if (value > 10000000) {
// data = `${(value / 10000000)} KW`
// } else if (value > 1000000) {
// data = `${(value / 1000000)} M`
// } else if (value / 10000) {
// data = `${(value / 10000)} W`
// }
// return data
// }
// }
},
{
@ -276,20 +276,20 @@ export default {
name: "GH/s",
nameTextStyle: {
padding: [0, 0, 0, -40],
},
axisLabel: {
formatter: function (value) {
// let data
// if (value > 10000000) {
// data = `${(value / 10000000)} KW`
// } else if (value > 1000000) {
// data = `${(value / 1000000)} M`
// } else if (value / 10000) {
// data = `${(value / 10000)} W`
// }
return value
}
}
// axisLabel: {
// formatter: function (value) {
// let data
// if (value > 10000000) {
// data = `${(value / 10000000)} KW`
// } else if (value > 1000000) {
// data = `${(value / 1000000)} M`
// } else if (value / 10000) {
// data = `${(value / 10000)} W`
// }
// return data
// }
// }
},
{
position: "right",
@ -506,8 +506,7 @@ export default {
show: true,
amount: 1,
},
}
// { //告知已删除此币种 Radiant
// value: "dgb2_odo",
// label: "dgb-odocrypt-pool2",
@ -760,7 +759,7 @@ export default {
],
FeeShow: true,
lang: 'en',
activeItemCoin: {
activeItemCoin:{
value: "nexa",
label: "nexa",
img: require("../../assets/img/currency-nexa.png"),
@ -782,19 +781,19 @@ export default {
},
activeItemCoin: {
handler(newVal) {
// 防止无限循环
if (this.isInternalChange) {
return;
}
this.handleActiveItemChange(newVal);
// 防止无限循环
if (this.isInternalChange) {
return;
}
this.handleActiveItemChange(newVal);
},
deep: true
}
}
},
mounted() {
this.lang = this.$i18n.locale; // 初始化语言值
this.$addStorageEvent(1, `activeItemCoin`, JSON.stringify(this.currencyList[0]))
this.minerChartLoading = true
@ -826,67 +825,13 @@ export default {
}
}else{ //动态计算图表的grid.left 让左侧的Y轴标签显示完全
const yAxis = this.option.yAxis[0]; // 第一个 Y 轴
const maxValue = Math.max(...this.option.series[0].data); // 获取数据最大值
const formatter = yAxis.axisLabel.formatter;
const formattedValue = formatter(maxValue); // 格式化最大值
// 创建一个临时 DOM 元素计算宽度
const tempDiv = document.createElement('div');
tempDiv.style.position = 'absolute';
tempDiv.style.visibility = 'hidden';
tempDiv.style.fontSize = '12px'; // 与 axisLabel.fontSize 一致
tempDiv.innerText = formattedValue;
document.body.appendChild(tempDiv);
const labelWidth = tempDiv.offsetWidth;
document.body.removeChild(tempDiv);
// 动态设置 grid.left加上安全边距
const safeMargin = 20;
this.option.grid.left = labelWidth + safeMargin + 'px';
// ------------全网算力图---------------
//
const yAxis2 = this.minerOption.yAxis[0]; // 第一个 Y 轴
const maxValue2 = Math.max(...this.minerOption.series[0].data); // 获取数据最大值
const formatter2 = yAxis2.axisLabel.formatter;
const formattedValue2 = formatter2(maxValue2); // 格式化最大值
// 创建一个临时 DOM 元素计算宽度
const tempDiv2 = document.createElement('div');
tempDiv2.style.position = 'absolute';
tempDiv2.style.visibility = 'hidden';
tempDiv2.style.fontSize = '12px'; // 与 axisLabel.fontSize 一致
tempDiv2.innerText = formattedValue2;
document.body.appendChild(tempDiv2);
const labelWidth2 = tempDiv2.offsetWidth;
document.body.removeChild(tempDiv2);
// 动态设置 grid.left加上安全边距
const safeMargin2 = 20;
this.minerOption.grid.left = labelWidth2 + safeMargin2 + 'px';
}
this.getBlockInfoData(this.BlockInfoParams)
this.getCoinInfoData(this.params)
this.getPoolPowerData(this.PowerParams)
// 注册需要在网络恢复后自动重新调用的方法
this.registerRecoveryMethod('getCoinInfoData', this.params);
this.registerRecoveryMethod('getPoolPowerData', this.PowerParams);
this.registerRecoveryMethod('getBlockInfoData', this.BlockInfoParams);
this.$addStorageEvent(1, `currencyList`, JSON.stringify(this.currencyList))
if (this.$refs.select) {
this.$refs.select.$el.children[0].children[0].setAttribute('style', "background:url(https://test.m2pool.com/img/nexa.png) no-repeat 10PX;background-size: 20PX 20PX;color:#333;padding-left: 30PX;");
@ -899,39 +844,15 @@ export default {
// let activeItemCoin =localStorage.getItem(`activeItemCoin`)
// this.activeItemCoin=JSON.parse(activeItemCoin)
window.addEventListener("setItem", () => {
let value = localStorage.getItem(`activeItemCoin`)
this.activeItemCoin = JSON.parse(value)
let value =localStorage.getItem(`activeItemCoin`)
this.activeItemCoin=JSON.parse(value)
});
},
methods: {
handelOptionYAxis(option){
const yAxis = option.yAxis[0]; // 第一个 Y 轴
const maxValue = Math.max(...option.series[0].data); // 获取数据最大值
const formatter = yAxis.axisLabel.formatter;
const formattedValue = formatter(maxValue); // 格式化最大值
// 创建一个临时 DOM 元素计算宽度
const tempDiv = document.createElement('div');
tempDiv.style.position = 'absolute';
tempDiv.style.visibility = 'hidden';
tempDiv.style.fontSize = '12px'; // 与 axisLabel.fontSize 一致
tempDiv.innerText = formattedValue;
document.body.appendChild(tempDiv);
const labelWidth = tempDiv.offsetWidth;
document.body.removeChild(tempDiv);
// 动态设置 grid.left加上安全边距
const safeMargin = 20;
option.grid.left = labelWidth + safeMargin + 'px';
return option
},
slideLeft() {
const allLength = this.currencyList.length * 120
const boxLength = document.getElementById('list-box').clientWidth
@ -945,7 +866,7 @@ export default {
listEl.style.left = '-' + (leftMove - 360) + 'PX'
}
},
//初始化图表
inCharts() {
@ -984,7 +905,7 @@ export default {
this.MinerChart = echarts.init(document.getElementById("minerChart"));
}
this.minerOption= this.handelOptionYAxis(this.minerOption) // Y轴文字显示动态调整grid.left
this.minerOption.series[0].name = this.$t(`home.networkPower`)
this.minerOption.series[1].name = this.$t(`home.currencyPrice`)
this.MinerChart.setOption(this.minerOption);
@ -1052,7 +973,61 @@ export default {
}, 200),
// async getPoolPowerData(params) {
// this.minerChartLoading = true
// const data = await getPoolPower(params)
// if (!data) {
// this.minerChartLoading = false
// if (this.myChart) {
// this.myChart.dispose()//销毁图表实列
// }
// return
// }
// let chartData = data.data
// let xData = []
// let pvData = []
// let rejectRate = []
// let price = []
// chartData.forEach(item => {
// if (item.date.includes(`T`) && params.interval == `rt`) {
// item.date = `${item.date.split("T")[0]} ${item.date.split("T")[1].split(`.`)[0]}`
// } else if (item.date.includes(`T`) && params.interval == `1d`) {
// item.date = item.date.split("T")[0]
// }
// xData.push(item.date)
// pvData.push(Number(item.pv).toFixed(2))
// // rejectRate.push((item.rejectRate * 100).toFixed(2))
// if (item.price == 0) {
// price.push(item.price)
// } else if (item.price < 1) {
// price.push(Number(item.price).toFixed(8))
// } else {
// price.push(Number(item.price).toFixed(2))
// }
// });
// // this.maxValue = Math.max(...rejectRate);
// // let leftYMaxData = Math.max(...pvData);
// // this.option.yAxis[0].max =leftYMaxData*2
// this.option.xAxis.data = xData
// this.option.series[0].data = pvData
// // this.option.series[1].data = rejectRate
// this.option.series[1].data = price
// this.$nextTick(() => {
// this.inCharts()
// })
// },
getPoolPowerData: Debounce(async function (params) {
// this.minerChartLoading = true
this.setLoading('minerChartLoading', true);
@ -1072,15 +1047,15 @@ export default {
let rejectRate = []
let price = []
chartData.forEach(item => {
if (item.date.includes(`T`) && params.interval == `rt`) {
item.date = `${item.date.split("T")[0]} ${item.date.split("T")[1].split(`.`)[0]}`
} else if (item.date.includes(`T`) && params.interval == `1d`) {
item.date = item.date.split("T")[0]
}
xData.push(item.date)
pvData.push(Number(item.pv).toFixed(2))
// rejectRate.push((item.rejectRate * 100).toFixed(2))
@ -1088,13 +1063,13 @@ export default {
price.push(item.price)
} else if (item.price < 1) {
price.push(Number(item.price).toFixed(8))
} else {
price.push(Number(item.price).toFixed(2))
}
});
// this.maxValue = Math.max(...rejectRate);
// let leftYMaxData = Math.max(...pvData);
@ -1107,13 +1082,13 @@ export default {
this.inCharts()
})
} catch {
}catch{
console.error('获取数据失败:', error);
} finally {
}finally {
// 确保无论成功失败都设置loading为false
this.setLoading('minerChartLoading', false);
}
}
@ -1246,11 +1221,37 @@ export default {
}, 200),
// async getBlockInfoData(params) {
// this.reportBlockLoading = true
// const data = await getBlockInfo(params)
// if (data && data.code == 200) {
// this.BlockShow = true
// this.newBlockInfoData = []
// this.BlockInfoData = data.rows
// if (!this.BlockInfoData[0]) {
// this.reportBlockLoading = false
// return
// }
// this.BlockInfoData.forEach((item, index) => {
// item.date = `${item.date.split("T")[0]} ${item.date.split("T")[1].split(`.`)[0]}`
// if (index < 8) {
// this.newBlockInfoData.push(item)
// }
// })
// } else {
// this.BlockShow = false
// }
// this.reportBlockLoading = false
// },
getBlockInfoData: Debounce(async function (params) {
try {
// this.reportBlockLoading = true
// this.reportBlockLoading = true
this.setLoading('reportBlockLoading', true);
const data = await getBlockInfo(params)
if (data && data.code == 200) {
@ -1258,8 +1259,7 @@ export default {
this.newBlockInfoData = []
this.BlockInfoData = data.rows
if (!this.BlockInfoData[0]) {
// this.reportBlockLoading = false
this.setLoading('reportBlockLoading', false);
this.reportBlockLoading = false
return
}
@ -1271,21 +1271,13 @@ export default {
}
})
} else {
this.BlockShow = false
}
this.setLoading('reportBlockLoading', false);
// this.reportBlockLoading = false
} catch (error) {
console.error('获取区块信息失败:', error);
this.BlockShow = false;
}finally {
// 确保在任何情况下都会重置 loading 状态
this.setLoading('reportBlockLoading', false);
}
@ -1329,54 +1321,38 @@ export default {
switch (this.time) {
case "day":
this.profit = result.toFixed(8)
// this.profit = result.toFixed(10)
// this.profit = Math.floor(result * 1e10) / 1e10;
// this.profit = this.toFixedNoRound(result, 10);
this.profit = this.toFixedNoRound(result, 10);
break;
case "week":
this.profit = (result * 7).toFixed(8)
// this.profit = (result * 7).toFixed(10)
// this.profit = Math.floor(result * 7 * 1e10) / 1e10;
// this.profit = this.toFixedNoRound(result * 7, 10);
this.profit = this.toFixedNoRound(result * 7, 10);
break;
case "month":
this.profit = (result * 30).toFixed(8)
// this.profit = (result * 30).toFixed(10)
// this.profit = Math.floor(result * 30 * 1e10) / 1e10;
// this.profit = this.toFixedNoRound(result * 30, 10);
this.profit = this.toFixedNoRound(result * 30, 10);
break;
case "year":
this.profit = (result * 365).toFixed(8)
// this.profit = (result * 365).toFixed(10)
// this.profit = Math.floor(result * 365 * 1e10) / 1e10;
// this.profit = this.toFixedNoRound(result * 365, 10);
this.profit = this.toFixedNoRound(result * 365, 10);
break;
default:
break;
}
const nexaFormatter = new Intl.NumberFormat("en-US", {
minimumFractionDigits: 2, // 强制显示 2 位小数(不足补零)
maximumFractionDigits: 2, // 可选:限制最多 2 位小数(避免多余位数)
// 10000000000000000
const formatter = new Intl.NumberFormat("en-US", {
minimumFractionDigits: 10, // 强制显示足够多的小数位
useGrouping: true, // 不使用千位分隔符(如 1,000
});
if (this.value == "nexa") {
this.profit = nexaFormatter.format(this.profit);
} else {
const formatter = new Intl.NumberFormat("en-US", {
minimumFractionDigits: 8, // 强制显示足够多的小数位
useGrouping: true, // 不使用千位分隔符(如 1,000
});
this.profit = formatter.format(this.profit);
}
// const formatter = new Intl.NumberFormat("en-US", {
// minimumFractionDigits: 8, // 强制显示足够多的小数位
// useGrouping: false, // 不使用千位分隔符(如 1,000
// });
// this.profit = formatter.format(this.profit);
this.profit = formatter.format(this.profit);
},
@ -1407,13 +1383,13 @@ export default {
// 其他CSS样式可以根据需要添加
},
handelProfitCalculation() {
for (const key in this.CalculatorData) {
if (this.CalculatorData[key]!==0 && !this.CalculatorData[key]) {
this.$message({
message: this.$t(`home.acquisitionFailed`),
type: "error",
});
if (!this.CalculatorData[key]) {
// this.$message({
// message: this.$t(`home.acquisitionFailed`),
// type: "error",
// });
this.profit = 0
// var myDiv = document.getElementById('myDiv');
// this.disableElement(myDiv);
@ -1441,7 +1417,7 @@ export default {
this.fetchParam({ coin: this.value })
},
handelJump(url) {
handelJump(url) {
if (url === '/AccessMiningPool') {
const coin = this.currencyList.find(item => item.value === this.params.coin);
@ -1449,16 +1425,16 @@ export default {
let jumpName = coin.path.charAt(0).toUpperCase() + coin.path.slice(1) //name跳转 首字母大写
// 使用 name 进行导航,避免重复的路由参数
this.$router.push({
name: jumpName,
params: {
lang: this.lang,
coin: this.params.coin,
imgUrl: this.currencyPath
name: jumpName,
params: {
lang: this.lang,
coin: this.params.coin,
imgUrl: this.currencyPath
},
replace: false // 保留历史记录,允许回退
},
replace: false // 保留历史记录,允许回退
});
} else {
// 移除开头的斜杠,统一处理路径格式
const cleanPath = url.startsWith('/') ? url.slice(1) : url;
@ -1469,106 +1445,77 @@ export default {
handelCalculation() {
this.calculateIncome()
},
// 获取单个币种项目的完整宽度包含margin
getItemFullWidth() {
const listEl = this.$refs.currencyList;
if (!listEl) return 120;
const firstItem = listEl.querySelector('.list-item');
if (!firstItem) return 120;
const style = window.getComputedStyle(firstItem);
const width = firstItem.offsetWidth;
const marginLeft = parseInt(style.marginLeft) || 0;
const marginRight = parseInt(style.marginRight) || 0;
return width + marginLeft + marginRight;
},
// 左滑动逻辑
scrollLeft() {
const allLength = this.currencyList.length * 120
const boxLength = document.getElementById('list-box').clientWidth
if (allLength < boxLength) return
const listEl = document.getElementById('list')
const leftMove = Math.abs(parseInt(window.getComputedStyle(listEl, null)?.left))
if (leftMove + boxLength - 360 < boxLength) {
// 到最开始的时候
listEl.style.left = '0PX'
} else {
listEl.style.left = '-' + (leftMove - 360) + 'PX'
}
},
// 右滑动逻辑
scrollRight() {
const allLength = this.currencyList.length * 120
const boxLength = document.getElementById('list-box').clientWidth
if (allLength < boxLength) return
const listEl = document.getElementById('list')
const leftMove = Math.abs(parseInt(window.getComputedStyle(listEl, null)?.left))
if (leftMove + boxLength + 360 > allLength) {
listEl.style.left = '-' + (allLength - boxLength) + 'PX'
} else {
listEl.style.left = '-' + (leftMove + 360) + 'PX'
}
},
// 左滑动逻辑
scrollLeft() {
const allLength = this.currencyList.length * 120
const boxLength = document.getElementById('list-box').clientWidth
if (allLength < boxLength) return
const listEl = document.getElementById('list')
const leftMove = Math.abs(parseInt(window.getComputedStyle(listEl, null)?.left))
if (leftMove + boxLength - 360 < boxLength) {
// 到最开始的时候
listEl.style.left = '0PX'
} else {
listEl.style.left = '-' + (leftMove - 360) + 'PX'
}
},
// 右滑动逻辑
scrollRight() {
const allLength = this.currencyList.length * 120
const boxLength = document.getElementById('list-box').clientWidth
if (allLength < boxLength) return
const listEl = document.getElementById('list')
const leftMove = Math.abs(parseInt(window.getComputedStyle(listEl, null)?.left))
if (leftMove + boxLength + 360 > allLength) {
listEl.style.left = '-' + (allLength - boxLength) + 'PX'
} else {
listEl.style.left = '-' + (leftMove + 360) + 'PX'
}
},
// // 左滑动逻辑
// scrollLeft() {
// const allLength = this.currencyList.length * 120
// const boxLength = document.getElementById('list-box').clientWidth
// if (allLength < boxLength) return
// const listEl = document.getElementById('list')
// const leftMove = Math.abs(parseInt(window.getComputedStyle(listEl, null)?.left))
// if (leftMove + boxLength - 360 < boxLength) {
// // 到最开始的时候
// listEl.style.left = '0PX'
// } else {
// listEl.style.left = '-' + (leftMove - 360) + 'PX'
// clickCurrency: throttle(function(item) {
// this.currency = item.label
// this.currencyPath = item.imgUrl
// this.params.coin = item.value
// this.BlockInfoParams.coin = item.value
// this.itemActive = item.value
// this.PowerParams.coin = item.value
// this.getCoinInfoData(this.params)
// this.getBlockInfoData(this.BlockInfoParams)
// // this.getPoolPowerData(this.PowerParams)
// // this.getMinerCountData(this.params)
// if (this.powerActive) {
// this.handelPower()
// } else if (!this.powerActive) {
// this.handelMiner()
// }
// },
// // 右滑动逻辑
// scrollRight() {
// const allLength = this.currencyList.length * 120
// const boxLength = document.getElementById('list-box').clientWidth
// if (allLength < boxLength) return
// const listEl = document.getElementById('list')
// const leftMove = Math.abs(parseInt(window.getComputedStyle(listEl, null)?.left))
// if (leftMove + boxLength + 360 > allLength) {
// listEl.style.left = '-' + (allLength - boxLength) + 'PX'
// } else {
// listEl.style.left = '-' + (leftMove + 360) + 'PX'
// }
// },
// }, 1000),
handleActiveItemChange(item) {
if (!item) return;
this.currency = item.label;
this.currencyPath = item.imgUrl;
this.params.coin = item.value;
console.log(this.params.coin, "item");
console.log( this.params.coin , "item");
this.BlockInfoParams.coin = item.value;
this.itemActive = item.value;
this.PowerParams.coin = item.value;
// 调用相关数据更新方法
this.getCoinInfoData(this.params);
this.getBlockInfoData(this.BlockInfoParams);
if (this.powerActive) {
this.handelPower();
this.handelPower();
} else {
this.handelMiner();
this.handelMiner();
}
this.handelCoinLabel(item.value);
},
},
clickCurrency(item) {
if (!item) return;
@ -1584,16 +1531,16 @@ scrollRight() {
// this.PowerParams.coin = item.value
// this.getCoinInfoData(this.params)
// this.getBlockInfoData(this.BlockInfoParams)
// 在下一个事件循环中重置标记
this.$nextTick(() => {
this.isInternalChange = false;
});
// 直接调用处理方法
this.handleActiveItemChange(item);
// 直接调用处理方法
this.handleActiveItemChange(item);
},
clickReportBlock() {
this.$router.push({

View File

@ -3,10 +3,10 @@
<section v-if="$isMobile">
<div class="imgTop">
<img src="../../assets/mobile/home/home.png" alt="mining" loading="lazy" />
<!--
<!-- <img src="../../assets/mobile/home/home.png" alt="mining" loading="lazy" /> -->
<img v-if="lang == 'zh'" src="../../assets/img/enx推广.png" alt="mining" loading="lazy"/>
<img v-else src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/> -->
<img v-else src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/>
</div>
@ -21,12 +21,12 @@
</span>
</template>
<ul class="moveCurrencyBox" >
<li @click="clickCurrency(item)" v-for="item in currencyList" :key="item.value">
<img :src="item.img" alt="coin" loading="lazy"/>
<p>{{ item.label }}</p>
</li>
</ul>
<ul class="moveCurrencyBox" >
<li @click="clickCurrency(item)" v-for="item in currencyList" :key="item.value">
<img :src="item.img" alt="coin" loading="lazy"/>
<p>{{ item.label }}</p>
</li>
</ul>
</el-submenu>
@ -329,12 +329,13 @@
</section>
<div class="content" v-else v-loading="minerChartLoading">
<div class="bgBox">
<!--
<img v-if="lang == 'zh'" class="bgBoxImg2Img" src="../../assets/img/enx推广.png" alt="mining" loading="lazy"/>
<img v-else class="bgBoxImg2Img" src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/> -->
<img class="bgImg" src="../../assets/img/home.png" alt="mining" loading="lazy"/>
<img v-else class="bgBoxImg2Img" src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/>
<!-- <img class="bgBoxImg" src="../../assets/img/enx推广.png" style="width: 100%;height: 100%;" alt="mining" loading="lazy"/> -->
</div>
<el-row>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
@ -365,7 +366,6 @@
</el-card>
</el-col>
</el-row>
<section class="describeBox">
<p> <i class="iconfont icon-tishishuoming "></i><span class="describeTitle">{{ $t(`home.describeTitle`) }}</span>{{ $t(`home.describe`) }} <span class="view" @click="handelJump(`/allocationExplanation`)"> {{ $t(`home.view`) }} </span> </p>
</section>
@ -375,7 +375,7 @@
<div class="currencyDescription2">
<section class="miningPoolBox">
<el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
<div class="miningPoolLeft" v-loading="minerChartLoading" v-loading-recovery="{ loading: 'minerChartLoading', recovery: ['getPoolPowerData', 'fetchNetPower'] }">
<div class="miningPoolLeft" v-loading="minerChartLoading">
<div class="interval">
<div class="chartBth">
@ -406,6 +406,7 @@
>{{ $t(item.label) }}</span
>
</div>
<div
id="chart"
@ -602,7 +603,7 @@
<el-row>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<div class="reportBlock">
<div class="reportBlockBox" v-loading="reportBlockLoading" v-loading-recovery="{ loading: 'reportBlockLoading', recovery: ['getBlockInfoData'] }">
<div class="reportBlockBox" v-loading="reportBlockLoading">
<div class="belowTable">
<ul>
<li class="table-title">
@ -680,7 +681,6 @@
:key="item.value"
:label="item.label"
:value="item.value"
v-show="item.value !== 'enx'"
>
<div style="display: flex; align-items: center">
<img :src="item.imgUrl" style="float: left; width: 20px" />
@ -762,7 +762,7 @@ export default {
};
</script>
<style scoped lang="scss">
<style scoped lang="scss">
//
@media screen and (min-width: 220px) and (max-width: 800px) {
.imgTop {
@ -785,7 +785,6 @@ export default {
p{
width: 100% ;
background: transparent ;
padding-left: 8px;
}
i{
@ -801,7 +800,6 @@ export default {
.view{
color: #5721e4;
margin-left: 5px;
cursor: pointer;
}
}
@ -828,7 +826,6 @@ export default {
// overflow: hidden;
padding: 5px 5px;
box-sizing: border-box;
cursor: pointer;
// background: palegoldenrod;
img {
@ -844,13 +841,7 @@ export default {
text-transform: capitalize;
}
}
}
.moveCurrencyBox li:hover {
transform: scale(1.05);
}
.currencySelect{
display: flex;
align-items: center;
@ -1304,45 +1295,16 @@ export default {
@media screen and (min-width:800px) and (max-width: 1279px) {
.imgTop {
width: 100%;
padding-left: 20%;
text-align: left;
// padding-left: 10%;
text-align: center;
img {
width: auto ;
height:300px;
width: 100%;
}
}
#chart {
height: 400px !important;
}
.describeBox2{
width: 100%;
font-size: 0.9rem;
padding: 8px;
margin: 0 auto;
p{
width: 100% ;
background: transparent ;
padding-left: 8px;
}
i{
color: #5721e4;
margin-right: 5px;
}
.describeTitle{
color: #5721e4;
font-weight: 600;
font-size: 0.95rem;
}
.view{
color: #5721e4;
margin-left: 5px;
cursor: pointer;
}
}
.moveCurrencyBox {
@ -1369,7 +1331,6 @@ export default {
padding: 5px 5px;
box-sizing: border-box;
// background: palegoldenrod;
cursor: pointer;
img {
width: 25px;
@ -1384,13 +1345,7 @@ export default {
text-transform: capitalize;
}
}
}
.moveCurrencyBox li:hover {
transform: scale(1.05);
}
.currencySelect{
display: flex;
align-items: center;
@ -2091,7 +2046,7 @@ export default {
.bgBox {
// background: gold;
width: 100%;
height: 300px;
// height: 380px;
box-sizing: border-box;
// background-position: 50% 28%;
// background-size: cover;
@ -2104,20 +2059,12 @@ export default {
// background-position: 13.2vw 0 ;
// background-repeat: no-repeat;
// margin-top: 50px;
// margin: 30px 0px;
margin: 30px 0px;
text-align: left;
.bgImg{
height: 100%;
width: auto ;
position: absolute;
left: 25vw;
top: 0;
}
text-align: center;
.bgBoxImg {
height: 100%;
width: auto;
position: absolute;
left: 23%;
transition: all 0.3s linear;
@ -3286,7 +3233,6 @@ export default {
cursor: pointer;
margin-left: 8px;
color: #6E3EDB;
// background: palegoldenrod;
}
.view:hover{

View File

@ -214,7 +214,6 @@ import {
import { encryption } from "../../utils/fun";
import { getAccountList } from "../../api/personalCenter";
export default {
data() {
return {
@ -373,11 +372,6 @@ export default {
JSON.stringify(data.data.access_token)
);
//
await new Promise(resolve => setTimeout(resolve, 50));
//
this.$bus.$emit('user-logged-in'); //
this.fetchAccountList();
this.fetchAccountGradeList();
this.fetchJurisdiction();

View File

@ -1345,14 +1345,7 @@ export default {
this.getMinerListData(this.MinerListParams)
this.getHistoryIncomeData(this.IncomeParams)
this.getHistoryOutcomeData(this.OutcomeParams)
this.registerRecoveryMethod('getMinerAccountInfoData', this.params);
this.registerRecoveryMethod('getMinerAccountPowerData', this.PowerParams);
this.registerRecoveryMethod('getAccountPowerDistributionData', this.PowerDistribution);
this.registerRecoveryMethod('getMinerListData', this.MinerListParams);
this.registerRecoveryMethod('getHistoryIncomeData', this.IncomeParams);
this.registerRecoveryMethod('getHistoryOutcomeData', this.OutcomeParams);
},
methods: {
@ -1407,12 +1400,11 @@ export default {
// console.log(data,"获取币种信息");
},
async getMinerAccountPowerData(params) {
// this.powerChartLoading = true
this.setLoading('powerChartLoading', true);
this.powerChartLoading = true
const data = await getMinerAccountPower(params)
if (!data) {
this.setLoading('powerChartLoading', false);
this.powerChartLoading = false
if (this.myChart) {
this.myChart.dispose()//销毁图表实列
}
@ -1445,13 +1437,13 @@ export default {
this.option.series[1].data = rejectRate
this.inCharts()
this.setLoading('powerChartLoading', false);
this.powerChartLoading = false
},
async getAccountPowerDistributionData(params) {
this.setLoading('barChartLoading', true);
this.barChartLoading = true
const data = await getAccountPowerDistribution(params)
let barData = data.data
let xData = []
@ -1463,7 +1455,7 @@ export default {
this.barOption.xAxis[0].data = xData
this.barOption.series[0].data = barValueList
this.barInCharts()
this.setLoading('barChartLoading', false);
this.barChartLoading = false
},
formatNumber(num) {//保留两位小数并补0
const intPart = Math.floor(num);
@ -1471,7 +1463,7 @@ export default {
return `${intPart}.${String(decimalPart).padStart(2, '0')}`;
},
async getMinerListData(params) {
this.setLoading('MinerListLoading', true);
this.MinerListLoading = true
const data = await getMinerList(params)
if (data && data.code == 200) {
this.MinerListData = data.data
@ -1511,7 +1503,7 @@ export default {
}
this.setLoading('MinerListLoading', false);
this.MinerListLoading = false
},
@ -1570,11 +1562,11 @@ export default {
// this.miniLoading=false
// },
getMinerPowerData:Debounce(async function(params){
this.setLoading('miniLoading', true);
this.miniLoading=true
const data = await getMinerPower(params)
if (!data) {
this.setLoading('miniLoading', false);
this.miniLoading=false
return
}
let miniData = data.data
@ -1626,18 +1618,62 @@ export default {
this.setLoading('miniLoading', false);
this.miniLoading=false
},200),
//小图
// async getMinerPowerOnLine(params) {
// this.miniLoading=true
// const data = await getMinerPower(params)
// if (!data) {
// this.miniLoading=false
// return
// }
// let miniData = data.data
// let xData = []
// let pv = []
// let rejectRate = []
// miniData.forEach(item => {
// if (item.date.includes(`T`)) {
// xData.push(`${item.date.split("T")[0]} ${item.date.split("T")[1].split(".")[0]}` )
// } else {
// xData.push(item.date)
// }
// pv.push(item.pv.toFixed(2))
// rejectRate.push((item.rejectRate * 100).toFixed(4))
// })
// this.onLineOption.xAxis.data = xData
// this.onLineOption.series[0].data = pv
// this.onLineOption.series[1].data = rejectRate
// this.onLineOption.series[0].name= this.$t(`home.finallyPower`)
// this.onLineOption.series[1].name= this.$t(`home.rejectionRate`)
// this.ids = `Small${this.miniId}`
// this.miniChartOnLine = echarts.init(document.getElementById(this.ids))
// this.$nextTick(() => {
// this.miniChartOnLine.setOption(this.onLineOption,true);
// window.addEventListener("resize", () => {
// if (this.miniChartOnLine) this.miniChartOnLine.resize();
// });
// });
// this.miniLoading=false
// },
getMinerPowerOnLine:Debounce(async function(params){
this.setLoading('miniLoading', true);
this.miniLoading=true
const data = await getMinerPower(params)
if (!data) {
this.setLoading('miniLoading', false);
this.miniLoading=false
return
}
let miniData = data.data
@ -1680,7 +1716,7 @@ export default {
this.setLoading('miniLoading', false);
this.miniLoading=false
},200),
@ -1732,10 +1768,10 @@ export default {
// this.miniLoading=false
// },
getMinerPowerOffLine:Debounce(async function(params){
this.setLoading('miniLoading', true);
this.miniLoading=true
const data = await getMinerPower(params)
if (!data) {
this.setLoading('miniLoading', false);
this.miniLoading=false
return
}
let miniData = data.data
@ -1779,7 +1815,7 @@ export default {
this.setLoading('miniLoading', false);
this.miniLoading=false
},200),

View File

@ -96,20 +96,17 @@ export default {
},
mounted() {
this.fetchApiList(this.listParams)
this.registerRecoveryMethod('fetchApiList', this.listParams);
},
methods: {
async fetchApiKey(params) {
this.ApiKeyLoading = true
this.setLoading('ApiKeyLoading', true);
const data = await getApiKey(params)
if (data && data.code == 200) {
this.fetchApiList(this.listParams)
this.dialogVisible = false
}
this.setLoading('ApiKeyLoading', false);
this.ApiKeyLoading = false
},
async fetchApiList(params) {
this.apiPageLoading = true
@ -118,7 +115,7 @@ export default {
this.apiList = data.rows
}
this.setLoading('apiPageLoading', false);
this.apiPageLoading = false
},
async fetchApiInfo(params) {
this.apiPageLoading = true
@ -130,7 +127,7 @@ export default {
}
}
this.setLoading('apiPageLoading', false);
this.apiPageLoading = false
},
async fetchUpdateAPI(params) {
this.apiPageLoading = true
@ -140,7 +137,7 @@ export default {
this.modifyDialogVisible =false
}
this.setLoading('apiPageLoading', false);
this.apiPageLoading = false
},
async fetchDelApi(params) {
this.apiPageLoading = true
@ -152,7 +149,7 @@ export default {
this.fetchApiList(this.listParams)
}
this.setLoading('apiPageLoading', false);
this.apiPageLoading = false
},
RequestApiKey() {
this.dialogVisible = true

View File

@ -1,7 +1,6 @@
import { getCheck,getAddBalace, getAddMinerAccount, getAccountList, getDelMinerAccount, getMinerAccountBalance, getCheckAccount,getCheckBalance,getIfBind } from "../../../api/personalCenter"
import {getAccountGradeList } from "../../../api/login"
import { Debounce,throttle }from "../../../utils/publicMethods";
export default {
data() {
@ -271,9 +270,6 @@ export default {
this.fetchAccountList()
this.registerRecoveryMethod('fetchIfBind', "");
this.registerRecoveryMethod('fetchAccountList', "");
this.currencyList = JSON.parse(localStorage.getItem("currencyList"))
window.addEventListener("setItem", () => {
this.currencyList = JSON.parse(localStorage.getItem("currencyList"))
@ -288,8 +284,7 @@ export default {
},
methods: {
async fetchIfBind(params){
// this.securityLoading = true
this.setLoading('securityLoading', true);
this.securityLoading = true
const data = await getIfBind(params)
if (data && data.code === 200) {
if (data.data) {
@ -307,14 +302,13 @@ export default {
this.dialogVerification=true
}
}
this.setLoading('securityLoading', false);
this.securityLoading = false
},
async fetchCheck(params){
// this.addMinerLoading =true
this.setLoading('addMinerLoading', true);
this.addMinerLoading =true
const data = await getCheck(params)
if (!data) {
this.setLoading('addMinerLoading', false);
this.addMinerLoading =false
}
if (data && data.code === 200) {
@ -326,21 +320,20 @@ export default {
type: "error",
showClose: true
});
this.setLoading('addMinerLoading', false);
this.addMinerLoading =false
}else if(data.code === 802){//钱包不可用
this.$message({
message: this.$t(`personal.invalidAddress`),
type: "error",
showClose: true
});
this.setLoading('addMinerLoading', false);
this.addMinerLoading =false
}
},
async fetchCheckBalance(params){
// this.confirmBindingLoading =true
this.setLoading('confirmBindingLoading', true);
this.confirmBindingLoading =true
const data = await getCheckBalance(params)
if (data && data.data) {
this.fetchWalletAddress(this.WalletAddressParams)
@ -351,7 +344,7 @@ export default {
type: 'error'
});
}
this.setLoading('confirmBindingLoading', false);
this.confirmBindingLoading =false
},
async fetchAccountGradeList(){
const data = await getAccountGradeList()
@ -376,8 +369,7 @@ export default {
}
},
async fetchMinerAccountBalance(params) {
// this.MiningLoading = true
this.setLoading('MiningLoading', true);
this.MiningLoading = true
const data = await getMinerAccountBalance(params)
if (data && data.code == 200) {
this.walletDialogVisible = true
@ -394,11 +386,10 @@ export default {
this.paymentSettingsData.active = this.paymentSettingsData.active==`1` ? this.$t(`personal.no`) :this.$t(`personal.yes`)
this.paymentSettingsData.amount = this.paymentSettingsData.amount ? this.paymentSettingsData.amount : `0`
this.setLoading('MiningLoading', false);
this.MiningLoading = false
},
async fetchDelMinerAccount(params) {
// this.MiningLoading = true
this.setLoading('MiningLoading', true);
this.MiningLoading = true
const data = await getDelMinerAccount(params)
if (data && data.code == 200) {
@ -409,18 +400,17 @@ export default {
}
this.setLoading('MiningLoading', false);
this.MiningLoading = false
},
async fetchAccountList(params) {
// this.MiningLoading = true
this.setLoading('MiningLoading', true);
this.MiningLoading = true
const data = await getAccountList(params)
this.accountList = data.data
console.log("请求成功,",data);
this.newAccountList = this.accountList
this.$addStorageEvent(1, `accountList`, JSON.stringify(this.accountList))
this.setLoading('MiningLoading', false);
this.MiningLoading = false
},
@ -441,8 +431,7 @@ export default {
},
//添加挖矿账户
async fetchAddMinerAccount(params) {
// this.addMinerLoading =true
this.setLoading('addMinerLoading', true);
this.addMinerLoading =true
const data = await getAddMinerAccount(params)
if (data && data.code == 200) {
this.$message({
@ -462,7 +451,7 @@ export default {
this.fetchAccountList()
this.fetchAccountGradeList()
this.setLoading('addMinerLoading', false);
this.addMinerLoading =false
},
handleCheckAllChange(val) {
@ -543,7 +532,13 @@ export default {
}
},
confirmAdd:Debounce(function(){
confirmAdd() {
// this.accountList.push({
// account: this.params.account,
// miningPool: this.params.miningPool,
// currency: this.params.miningPool,
// remarks: this.params.remarks,
// })
if (!this.AccountParams.ma) {
this.$message({
message: this.$t(`personal.accountNumber`),
@ -595,66 +590,12 @@ export default {
}
this.fetchCheck({ coin: this.AccountParams.coin, ma: this.AccountParams.ma,balance: this.AccountParams.balance})
},200),
// confirmAdd() {
// if (!this.AccountParams.ma) {
// this.$message({
// message: this.$t(`personal.accountNumber`),
// type: "error",
// showClose: true
// });
// return
// }
// if (!this.AccountParams.balance) {
// this.$message({
// message: this.$t(`personal.inputWalletAddress`),
// type: "error",
// showClose: true
// });
// return
// }
// if (!this.AccountParams.coin) {
// this.$message({
// message:this.$t(`personal.selectCurrency`),
// type: "error",
// showClose: true
// });
// return
// }
// if (!this.AccountParams.code && this.isItBound) {
// this.$message({
// showClose: true,
// message: this.$t(`personal.gCode`),
// type: 'error'
// });
// return
// }
// // 账户只能输入字母、数字、下划线且不能以数字开头长度不小于4位不大于24位
// const regexAccount=/^[a-zA-Z_][a-zA-Z0-9_]{3,23}$/
// const PasswordIsValid = regexAccount.test(this.AccountParams.ma);
// if (!PasswordIsValid) {
// // 如果输入不符合要求,可以根据具体需求给出错误提示或进行其他处理
// this.$message({
// message: this.$t(`personal.accountFormat`),
// type: "error",
// showClose: true
// });
// return;
// }
// this.fetchCheck({ coin: this.AccountParams.coin, ma: this.AccountParams.ma,balance: this.AccountParams.balance})
// // this.fetchCheckAccount({ coin: this.AccountParams.coin, ma: this.AccountParams.ma })
// this.fetchCheckAccount({ coin: this.AccountParams.coin, ma: this.AccountParams.ma })
// },
},
handelAddClose(){
for (let key in this.AccountParams) {
this.AccountParams[key] = "";

View File

@ -197,16 +197,14 @@ export default {
}))
}));
console.log( this.newMiningAccountList,"isrjiojfeo");
this.fetchUrlList(this.UrlListParams)
this.registerRecoveryMethod('fetchUrlList', this.UrlListParams);
},
methods: {
async fetchHtmlUrl(params){
// this.establishLoading = true
this.setLoading('establishLoading', true);
this.establishLoading = true
const data = await getHtmlUrl(params)
if (data && data.code == 200) {
@ -214,11 +212,10 @@ export default {
this.dialogVisible=false
}
this.setLoading('establishLoading', false);
this.establishLoading = false
},
async fetchUrlList(params){
// this.UrlListLoading = true
this.setLoading('UrlListLoading', true);
this.UrlListLoading = true
const data = await getUrlList(params)
console.log(data,666 );
@ -226,7 +223,7 @@ export default {
this.TotalSize = data.total
this.setLoading('UrlListLoading', false);
this.UrlListLoading = false
},
async fetchUrlInfo(params){
const data = await getUrlInfo(params)
@ -242,8 +239,7 @@ export default {
},
async fetchChangeUrlInfo(params){
// this.modifyLoading=true
this.setLoading('modifyLoading', true);
this.modifyLoading=true
const data = await getChangeUrlInfo(params)
console.log(data);
if (data && data.code == 200) {
@ -252,7 +248,7 @@ export default {
console.log("修改成功");
}
this.setLoading('modifyLoading', false);
this.modifyLoading=false
},
async fetchDelete(params){

View File

@ -155,14 +155,13 @@ export default {
this.lang = this.$i18n.locale; // 初始化语言值
this.fetchIfBind()
this.registerRecoveryMethod('fetchIfBind', "");
if (this.$route.params.active) {
this.handelVerification()
}
},
methods: {
async fetchIfBind(params) {
this.setLoading('securityLoading', true);
this.securityLoading = true
const data = await getIfBind(params)
if (data && data.code === 200) {
if (data.data) {
@ -171,10 +170,10 @@ export default {
this.isItBound = false
}
}
this.setLoading('securityLoading', false);
this.securityLoading = false
},
async fetchBindInfo(params) {
this.setLoading('BindInfoLoading', true);
this.BindInfoLoading = true
const data = await getBindInfo(params)
console.log(data, "绑定信息");
if (data && data.code === 200) {
@ -183,10 +182,10 @@ export default {
this.dialogVisible = false
}
this.setLoading('BindInfoLoading', false);
this.BindInfoLoading = false
},
async fetchBindGoogle(params) {
this.setLoading('BindInfoLoading', true);
this.BindInfoLoading = true
const data = await getBindGoogle(params)
console.log(data, "绑定");
if (data && data.code === 200) {
@ -204,7 +203,7 @@ export default {
}
this.setLoading('BindInfoLoading', false);
this.BindInfoLoading = false
},
async fetchBindCode(params) {
const data = await getBindCode(params)
@ -217,7 +216,7 @@ export default {
}
},
async fetchResetPwd(params) {
this.setLoading('ResetPwdLoading', true);
this.ResetPwdLoading = true
const data = await getUpdatePwd(params)
if (data && data.code === 200) {
this.$message({
@ -231,7 +230,7 @@ export default {
localStorage.removeItem("token")
this.$router.push(`/${lang}/login`);
}
this.setLoading('ResetPwdLoading', false);
this.ResetPwdLoading = false
},
async fetchResetPwdCode(params) {
const data = await getUpdatePwdCode(params)
@ -245,7 +244,7 @@ export default {
},
async fetchCloseStepTwo(params) {
this.setLoading('closeLoading', true);
this.closeLoading = true
const data = await getCloseStepTwo(params)
if (data && data.code === 200) {
this.$message({
@ -261,7 +260,7 @@ export default {
this.closeParams[key] = ""
}
}
this.setLoading('closeLoading', false);
this.closeLoading = false
},
async fetchCloseCode(params) {
const data = await getCloseCode(params)

View File

@ -269,7 +269,7 @@
<span class="title">{{ $t(`personal.verificationCode`) }}</span>
<div class="verificationCode">
<el-input
type="text"
type="email"
v-model="closeParams.eCode"
autocomplete="off"
:placeholder="$t(`user.verificationCode`)"

View File

@ -69,7 +69,7 @@ export default {
value:"enx",
label:"Entropyx(Enx)",
img:`${this.$baseApi}img/enx.svg`,
rate:"1%",
rate:"0",
address:"",
mode:"PPLNS+PROPDIF",
quota:"5000",

View File

@ -12,8 +12,8 @@
<template slot="title">
<div class="collapseTitle">
<span ><img :src="item.img" alt="coin" loading="lazy"> {{item.label}}</span>
<!-- <span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span> -->
<span >{{item.rate}}</span>
<span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span>
<span v-else>{{item.rate}}</span>
</div>
</template>
<section class="contentBox2">
@ -76,8 +76,8 @@
<li v-for="item in rateList" :key="item.value">
<span class="coin"><img :src="item.img" alt="coin" loading="lazy"> {{item.label}}</span>
<span>{{item.address}}</span>
<!-- <span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span> -->
<span >{{item.rate}}</span>
<span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span>
<span v-else>{{item.rate}}</span>
<span>{{item.mode}}</span>
<span>{{item.quota}}</span>
</li>

View File

@ -1228,8 +1228,6 @@ export default {
this.getMinerAccountPowerData(this.PowerParams)
this.getAccountPowerDistributionData(this.PowerDistribution)
},
"$i18n.locale":(val)=>{
location.reload();//刷新页面 刷新echarts
@ -1271,12 +1269,6 @@ export default {
this.getMinerListData(this.MinerListParams)
this.getMinerAccountPowerData(this.PowerParams)
this.getAccountPowerDistributionData(this.PowerDistribution)
this.registerRecoveryMethod('getMinerListData', this.MinerListParams);
this.registerRecoveryMethod('getMinerAccountPowerData', this.PowerParams);
this.registerRecoveryMethod('getAccountPowerDistributionData', this.PowerDistribution);
this.registerRecoveryMethod('fetchPageInfo', {key:this.params.key});
},
@ -1328,7 +1320,7 @@ export default {
},
//返回权限 1矿工 2收益 3支付
async fetchPageInfo(params){
this.setLoading('jurisdictionLoading', true);
this.jurisdictionLoading = true
const data = await getPageInfo(params)
console.log(data);
if (data && data.code == 200) {
@ -1362,7 +1354,7 @@ export default {
}
this.setLoading('jurisdictionLoading', false);
this.jurisdictionLoading = false
},
//获取当前挖矿账号信息(包含收益、余额)
async getMinerAccountInfoData(params) {
@ -1370,11 +1362,11 @@ export default {
this.MinerAccountData = data.data
},
async getMinerAccountPowerData(params) {
this.setLoading('powerChartLoading', true);
this.powerChartLoading = true
const data = await getMinerAccountPower(params)
if (!data) {
this.setLoading('powerChartLoading', false);
this.powerChartLoading = false
if (this.myChart) {
this.myChart.dispose()//销毁图表实列
}
@ -1407,13 +1399,13 @@ export default {
this.option.series[1].data = rejectRate
this.inCharts()
this.setLoading('powerChartLoading', false);
this.powerChartLoading = false
},
async getAccountPowerDistributionData(params) {
this.setLoading('barChartLoading', true);
this.barChartLoading = true
const data = await getAccountPowerDistribution(params)
let barData = data.data
let xData = []
@ -1425,7 +1417,7 @@ export default {
this.barOption.xAxis[0].data = xData
this.barOption.series[0].data = barValueList
this.barInCharts()
this.setLoading('barChartLoading', false);
this.barChartLoading = false
},
formatNumber(num) {//保留两位小数并补0
const intPart = Math.floor(num);
@ -1433,7 +1425,7 @@ export default {
return `${intPart}.${String(decimalPart).padStart(2, '0')}`;
},
async getMinerListData(params) {
this.setLoading('MinerListLoading', true);
this.MinerListLoading = true
const data = await getMinerList(params)
if (data && data.code == 200) {
this.MinerListData = data.data
@ -1459,17 +1451,17 @@ export default {
}
this.setLoading('MinerListLoading', false);
this.MinerListLoading = false
},
//小图
async getMinerPowerData(params) {
this.setLoading('miniLoading', true);
this.miniLoading=true
const data = await getMinerPower(params)
if (!data) {
this.setLoading('miniLoading', false);
this.miniLoading=false
return
}
let miniData = data.data
@ -1515,15 +1507,15 @@ export default {
this.setLoading('miniLoading', false);
this.miniLoading=false
},
//小图
async getMinerPowerOnLine(params) {
this.setLoading('miniLoading', true);
this.miniLoading=true
const data = await getMinerPower(params)
if (!data) {
this.setLoading('miniLoading', false);
this.miniLoading=false
return
}
let miniData = data.data
@ -1564,14 +1556,14 @@ export default {
this.setLoading('miniLoading', false);
this.miniLoading=false
},
//小图
async getMinerPowerOffLine(params) {
this.setLoading('miniLoading', true);
this.miniLoading=true
const data = await getMinerPower(params)
if (!data) {
this.setLoading('miniLoading', false);
this.miniLoading=false
return
}
let miniData = data.data
@ -1613,7 +1605,7 @@ export default {
this.setLoading('miniLoading', false);
this.miniLoading=false
},
async getHistoryIncomeData(params) {
const data = await getHistoryIncome(params)

View File

@ -235,10 +235,6 @@ export default {
this.getLuckData(this.params)
this.getBlockInfoData(this.BlockInfoParams)
this.registerRecoveryMethod('getLuckData', this.params);
this.registerRecoveryMethod('getBlockInfoData', this.BlockInfoParams);
let value = localStorage.getItem("activeItemCoin")
this.activeItemCoin = JSON.parse(value)
this.currencyList = JSON.parse(localStorage.getItem("currencyList"))
@ -264,14 +260,14 @@ export default {
// },
getLuckData: Debounce(async function (params) {
this.setLoading('LuckDataLoading', true);
this.LuckDataLoading = true
const data = await getLuck(params)
if (data && data.code == 200) {
this.luckData = data.data
}
this.setLoading('LuckDataLoading', false);
this.LuckDataLoading = false
}, 200),
// async getBlockInfoData(params) {
// this.reportBlockLoading=true
@ -290,10 +286,10 @@ export default {
// },
getBlockInfoData: Debounce(async function (params) {
this.setLoading('reportBlockLoading', true);
this.reportBlockLoading = true
const data = await getBlockInfo(params)
if (!data) {
this.setLoading('reportBlockLoading', false);
this.reportBlockLoading = false
}
this.totalSize = data.total
this.BlockInfoData = data.rows
@ -302,7 +298,7 @@ export default {
})
// this.currentPage = 1
// console.log(data,"获取币种信息");
this.setLoading('reportBlockLoading', false);
this.reportBlockLoading = false
}, 200),
handleActiveItemChange(item) {
@ -318,9 +314,6 @@ export default {
clickCurrency(item) {
if (!item) return;
// 设置标记,防止触发 watch
this.luckData={}
this.isInternalChange = true;
this.activeItemCoin = item;
this.$addStorageEvent(1, `activeItemCoin`, JSON.stringify(item))

View File

@ -27,7 +27,7 @@
</el-menu>
</div>
<div class="luckyBox" v-show="this.activeItemCoin.value != 'enx' && this.activeItemCoin.value != 'alph'">
<div class="luckyBox" >
<div class="luckyItem">
<span class="title">{{$t(`home.lucky3`)}}</span>
@ -125,8 +125,7 @@
</el-col>
<!-- v-loading = "LuckDataLoading" -->
<el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
<div class="luckyBox" v-show="this.activeItemCoin.value != 'enx' && this.activeItemCoin.value != 'alph'" >
<div class="luckyBox" >
<div class="luckyItem">
<span class="title">{{$t(`home.lucky3`)}}</span>

View File

@ -247,7 +247,7 @@
import { getResetPwd, getResetPwdCode } from "../../api/login";
import { encryption } from "../../utils/fun";
import { getEmailIfBind } from "../../api/personalCenter";
import { Debounce,throttle }from "../../utils/publicMethods";
export default {
data() {
return {
@ -419,10 +419,6 @@ export default {
type: "success",
showClose: true,
});
for (const key in this.loginForm) {//
this.loginForm[key] = "";
}
this.$router.push(`/${this.lang}/login`);
}
},
@ -525,8 +521,7 @@ export default {
}
});
},
submitForm:Debounce(function(){
submitForm() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
//
@ -601,83 +596,7 @@ export default {
this.fetchResetPwd(form);
}
});
},200),
// submitForm() {
// this.$refs.ruleForm.validate((valid) => {
// if (valid) {
// //
// this.loginForm.userName = this.loginForm.email.trim();
// this.loginForm.password = this.loginForm.password.trim();
// this.loginForm.newPassword = this.loginForm.newPassword.trim();
// if (this.loginForm.password !== this.loginForm.newPassword) {
// this.$message({
// message: this.$t(`user.confirmPassword2`),
// type: "error",
// customClass: "messageClass",
// showClose: true,
// });
// return;
// }
// //
// const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;
// let isMailbox = emailRegex.test(this.loginForm.email);
// if (!isMailbox) {
// this.$message({
// message: this.$t(`user.emailVerification`),
// type: "error",
// customClass: "messageClass",
// showClose: true,
// });
// return;
// //1.3<=<=16; 使线
// // const regex = /^[a-zA-Z][a-zA-Z0-9_]{2,15}$/; //
// // const isValid = regex.test(this.loginForm.email);
// // if (!isValid) {
// // //
// // this.$message({
// // message: this.$t(`user.accountReminder`),
// // type: "error",
// // customClass: "messageClass",
// // showClose: true
// // });
// // return;
// // }
// }
// // 8<=<=32 @#%&*
// const regexPassword =
// /^(?!.*[\u4e00-\u9fa5])(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_]+$)(?![a-z0-9]+$)(?![a-z\W_]+$)(?![0-9\W_]+$)[a-zA-Z0-9\W_]{8,32}$/; //
// const PasswordIsValid = regexPassword.test(this.loginForm.password);
// if (!PasswordIsValid) {
// //
// this.$message({
// message: this.$t(`user.PasswordReminder`),
// type: "error",
// showClose: true,
// });
// return;
// }
// // ,gCode: this.loginForm.gCode,
// let obj = {
// email: this.loginForm.email,
// password: this.loginForm.password,
// resetPwdCode: this.loginForm.resetPwdCode,
// };
// //
// // const form = { ...this.loginForm };
// // form.password = encryption(this.loginForm.password);
// const form = { ...obj };
// form.password = encryption(obj.password);
// this.fetchResetPwd(form);
// }
// });
// },
},
handleClick() {
this.$router.push(`/${this.lang}`);
},

View File

@ -1,397 +1,153 @@
<template>
<div>
<h1>{{ msg }}</h1>
<!-- 用户ID输入部分 -->
<div class="user-input-container">
<div class="input-group" :class="{ 'disabled': isConnected }">
<input
v-model="email"
placeholder="请输入您的用户邮箱"
:disabled="isConnected"
/>
<input
v-model="targetEmail"
placeholder="请输入目标用户邮箱"
:disabled="isConnected"
@keyup.enter="!isConnected && !isConnecting && connectWebSocket()"
/>
</div>
<div class="button-group">
<button
@click="connectWebSocket"
:disabled="isConnected || isConnecting || !email || !targetEmail"
:class="{ 'disabled': isConnected || isConnecting || !email || !targetEmail }"
>
{{ isConnecting ? '连接中...' : '连接' }}
</button>
<button
v-if="isConnected"
@click="disconnectWebSocket"
class="disconnect-btn"
>
断开连接
</button>
</div>
</div>
<div v-if="connectionError" class="error-message">
{{ connectionError }}
</div>
<div v-if="isConnected">
<!-- WebSocket 聊天部分 -->
<div class="chat-container">
<div class="message-list" ref="messageList">
<div v-for="(msg, index) in receivedMessages" :key="index" class="message"
:class="{ 'error-message': msg.error }">
<div v-if="typeof msg === 'string'">{{ msg }}</div>
<div v-else>
<div class="message-header">
<span class="message-sender">{{ msg.sender || 'Unknown' }}</span>
<span class="message-time">{{ formatTime(msg.timestamp) }}</span>
</div>
<div class="message-content">{{ msg.content }}</div>
</div>
</div>
</div>
<div class="input-container">
<textarea
v-model="message"
@keyup.enter="sendMessage"
placeholder="输入消息..."
rows="3"
></textarea>
<button @click="sendMessage" :disabled="!message.trim()">
发送
</button>
</div>
</div>
</div>
<div style="width: 1300px; height: 600px">
<div id="chart" style="width: 100%; height: 100%; min-width: 500px"></div>
</div>
</template>
<script setup>
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
import { Stomp } from '@stomp/stompjs'
<script>
import * as echarts from "echarts";
export default {
data() {
return {
countDownTime: 60,
timer: null,
};
},
const props = defineProps({
msg: {
type: String,
required: true
}
})
const message = ref('')
const receivedMessages = ref([])
const email = ref('')
const targetEmail = ref('')
const isConnected = ref(false)
const isConnecting = ref(false)
const connectionError = ref('')
const messageList = ref(null)
// stompClient
const stompClient = ref(null)
//
const connectTime = ref(null)
//
const scrollToBottom = async () => {
await nextTick()
if (messageList.value) {
messageList.value.scrollTop = messageList.value.scrollHeight
}
}
//
watch(receivedMessages, () => {
scrollToBottom()
})
//
const formatTime = (timestamp) => {
if (!timestamp) return ''
try {
const date = new Date(timestamp)
return date.toLocaleTimeString()
} catch (e) {
return ''
}
}
// WebSocket
const connectWebSocket = () => {
if (!email.value || !targetEmail.value) {
connectionError.value = '请输入用户邮箱和目标用户邮箱'
return
}
connectionError.value = ''
isConnecting.value = true
connectTime.value = new Date() //
try {
stompClient.value = Stomp.client('ws://localhost:8101/chat/ws')
stompClient.value.heartbeat.outgoing = 20000
stompClient.value.heartbeat.incoming = 0
const connectHeaders = {
'email': email.value,
'type': 2 //0 1 2
mounted() {
let base = +new Date(1968, 9, 3);
let oneDay = 24 * 3600 * 1000;
let date = [];
let data = [Math.random() * 300];
for (let i = 1; i < 20000; i++) {
var now = new Date((base += oneDay));
date.push([now.getFullYear(), now.getMonth() + 1, now.getDate()].join("/"));
data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]));
}
stompClient.value.connect(
connectHeaders,
function(frame) {
console.log('连接成功: ' + frame)
console.log('连接时间:', connectTime.value?.toLocaleString())
isConnected.value = true
isConnecting.value = false
//
receivedMessages.value.push({
sender: 'System',
content: '已连接到聊天服务器',
timestamp: new Date().toISOString(),
system: true
})
//
stompClient.value.subscribe(`/user/queue/${email.value}`, function(message) {
console.log('收到消息:', message.body)
try {
const parsedMessage = JSON.parse(message.body)
receivedMessages.value.push(parsedMessage)
} catch (error) {
console.error('消息解析失败:', error)
receivedMessages.value.push({
sender: 'System',
content: `消息格式错误: ${message.body}`,
timestamp: new Date().toISOString(),
error: true
})
}
})
// 10
for (let i = 0; i < 100; i++) {
date.unshift(null);
data.unshift(null);
}
for (let i = 0; i < 100; i++) {
date.push(null);
data.push(null);
}
var option = {
tooltip: {
trigger: "axis",
position: function (pt) {
return [pt[0], "10%"];
},
},
function(error) {
console.error('连接失败:', error)
isConnected.value = false
isConnecting.value = false
connectionError.value = `连接失败: ${error.headers?.message || error.message || '未知错误'}`
title: {
left: "center",
text: "Large Area Chart",
},
toolbox: {
feature: {
dataZoom: {
yAxisIndex: "none",
},
restore: {},
saveAsImage: {},
},
},
xAxis: {
type: "category",
// boundaryGap: [0.5, 0.5],
data: date,
},
yAxis: [
{
type: "value",
boundaryGap: [0, "100%"],
axisLine: {
show: true, // Y 线
},
},
{
position: "right",
type: "value",
boundaryGap: [0, "100%"],
},
],
dataZoom: [
{
type: "inside",
start: 0,
end: 10,
},
{
start: 0,
end: 10,
},
],
series: [
{
name: "Fake Data",
type: "line",
symbol: "none",
sampling: "lttb",
itemStyle: {
color: "rgb(255, 70, 131)",
},
data: data,
},
],
};
this.myChart = echarts.init(document.getElementById("chart"));
this.myChart.setOption(option);
window.addEventListener(
"resize", () => {
if (this.myChart) this.myChart.resize();
}
)
} catch (error) {
console.error('初始化WebSocket客户端失败:', error)
isConnected.value = false
isConnecting.value = false
connectionError.value = `初始化失败: ${error.message || '未知错误'}`
}
}
//
const disconnectWebSocket = () => {
if (stompClient.value?.connected) {
stompClient.value.disconnect(() => {
const disconnectTime = new Date()
const duration = connectTime.value ?
Math.floor((disconnectTime.getTime() - connectTime.value.getTime()) / 1000) : 0
console.log('断开连接时间:', disconnectTime.toLocaleString())
console.log(`连接持续时间: ${Math.floor(duration / 60)}${duration % 60}`)
isConnected.value = false
receivedMessages.value = []
connectTime.value = null
//
connectionError.value = '已断开连接'
setTimeout(() => {
connectionError.value = ''
}, 3000)
})
}
}
//
const sendMessage = () => {
if (!message.value.trim()) return
if (stompClient.value?.connected) {
try {
const messageObj = {
email: targetEmail.value,
content: message.value.trim()
);
},
methods: {
//
inCharts() {
if (this.myChart == null) {
this.myChart = echarts.init(document.getElementById("chart"));
}
stompClient.value.send(
`/point/send/message`,
{},
JSON.stringify(messageObj)
)
//
receivedMessages.value.push({
sender: email.value,
content: message.value.trim(),
timestamp: new Date().toISOString(),
isSelf: true
})
message.value = ''
} catch (error) {
console.error('发送消息失败:', error)
receivedMessages.value.push({
sender: 'System',
content: `发送失败: ${error.message || '未知错误'}`,
timestamp: new Date().toISOString(),
error: true
})
}
} else {
connectionError.value = '连接已断开,请重新连接'
isConnected.value = false
}
}
//
onUnmounted(() => {
if (stompClient.value?.connected) {
stompClient.value.disconnect()
}
})
</script>
this.option.series[0].name = this.$t(`home.computingPower`);
this.option.series[1].name = this.$t(`home.currencyPrice`);
<style scoped>
.read-the-docs {
color: #888;
}
this.myChart.setOption(this.option);
//
this.myChart.on("finished", () => {
//
// console.log('');
this.minerChartLoading = false;
});
// window.addEventListener("resize", () => {
// if (this.myChart) this.myChart.resize();
// });
.user-input-container {
max-width: 400px;
margin: 20px auto;
}
.input-group {
display: flex;
gap: 10px;
margin-bottom: 10px;
}
.chat-container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.message-list {
height: 300px;
overflow-y: auto;
border: 1px solid #eee;
padding: 10px;
margin-bottom: 10px;
border-radius: 4px;
}
.message {
margin: 8px 0;
padding: 10px;
background-color: #f5f5f5;
border-radius: 8px;
max-width: 80%;
}
.message-header {
display: flex;
justify-content: space-between;
font-size: 0.8em;
margin-bottom: 4px;
}
.message-sender {
font-weight: bold;
color: #333;
}
.message-time {
color: #999;
}
.message-content {
word-break: break-word;
}
.message[class*="isSelf"] {
background-color: #dcf8c6;
margin-left: auto;
}
.error-message {
background-color: #ffebee;
color: #d32f2f;
padding: 8px;
border-radius: 4px;
margin: 10px 0;
text-align: center;
}
.input-container {
display: flex;
gap: 10px;
}
input, textarea {
flex: 1;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-family: inherit;
resize: none;
}
button {
padding: 8px 16px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover:not(:disabled) {
background-color: #45a049;
}
button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.button-group {
display: flex;
gap: 10px;
}
.disabled {
opacity: 0.6;
cursor: not-allowed;
}
.disconnect-btn {
background-color: #dc3545;
}
.disconnect-btn:hover {
background-color: #c82333;
}
input:disabled, textarea:disabled {
background-color: #f5f5f5;
cursor: not-allowed;
}
</style>
window.addEventListener(
"resize",
throttle(() => {
if (this.myChart) this.myChart.resize();
}, 200)
);
},
startCountDown() {
this.timer = setInterval(() => {
if (this.countDownTime <= 0) {
//countDownTime0,sessionStorage,
clearInterval(this.timer);
sessionStorage.removeItem("exam_time");
alert("提交试卷");
} else if (this.countDownTime > 0) {
//countDownTime -1,sessionStorage
this.countDownTime--;
window.sessionStorage.setItem("exam_time", this.countDownTime);
}
}, 1000);
},
},
};
</script>

View File

@ -103,21 +103,11 @@ export default {
data: this.FormDatas,
}).then(res => {
console.log(res,"文件返回");
if (res.status == 200 && res.data.code != 200) {
this.$message.error(res.data.msg);
return
}
this.ruleForm.files = res.data.data.id
if (this.ruleForm.files) {//成功拿到返回ID
this.fetchSubmitWork(this.ruleForm)
}
})
} else {

View File

@ -24,8 +24,8 @@
show-word-limit
v-model="ruleForm.desc">
</el-input>
</el-form-item>
</el-form-item>
<el-form-item style="width: 100%;">
<div style="width: 100%;font-weight: 600;color: rgba(0,0,0,0.7);">{{ $t(`work.enclosure`) }}</div>

View File

@ -167,7 +167,6 @@ export default {
this.workOrderId = localStorage.getItem("workOrderId")
if (this.workOrderId) {
this.fetchTicketDetails({ id: this.workOrderId })
this.registerRecoveryMethod('fetchTicketDetails', { id: this.workOrderId });
}
// this.faultList = JSON.parse(localStorage.getItem('faultList') )

View File

@ -198,22 +198,18 @@ export default {
case `all`:
this.params.status = 0
this.fetchRechargeRecord0(this.params)
this.registerRecoveryMethod('fetchRechargeRecord0', this.params);
break;
case `pending`:
this.params.status = 2
this.fetchRechargeRecord2(this.params)
this.registerRecoveryMethod('fetchRechargeRecord2', this.params);
break;
case `Finished`:
this.params.status = 10
this.fetchRechargeRecord10(this.params)
this.registerRecoveryMethod('fetchRechargeRecord10', this.params);
break;
case `pendingProcessing`:
this.params.status = 1
this.fetchRechargeRecord1(this.params)
this.registerRecoveryMethod('fetchRechargeRecord1', this.params);
break;
default:

View File

@ -95,17 +95,14 @@ export default {
case "pending":
this.params.status = 1
this.fetchPrivateConsume1(this.params)
this.registerRecoveryMethod('fetchPrivateConsume1', this.params);
break;
case "success"://已完成工单
this.params.status = 2
this.fetchPrivateConsume2(this.params)
this.registerRecoveryMethod('fetchPrivateConsume2', this.params);
break;
case "reply"://全部工单
this.params.status = 0
this.fetchPrivateConsume0(this.params)
this.registerRecoveryMethod('fetchPrivateConsume0', this.params);
break;
default:

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More