From 6ff2e6134784009f2f7d942b27ae12b2abfa291c Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Thu, 29 Jun 2023 14:12:03 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=A4=A7=E5=B1=8F=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/homePage/components/dataTop5.js | 30 ++++++++++++++++--- .../homePage/components/nodeResource.js | 2 +- .../sections/homePage/components/style.less | 2 +- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/web/client/src/sections/homePage/components/dataTop5.js b/web/client/src/sections/homePage/components/dataTop5.js index 37c102b..d3c3325 100644 --- a/web/client/src/sections/homePage/components/dataTop5.js +++ b/web/client/src/sections/homePage/components/dataTop5.js @@ -37,6 +37,27 @@ function DataTop5(props) { show: false, }, }, + tooltip: { + confine: true, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + backgroundColor: 'rgba(13,30,44, 0.7)', + borderColor: 'rgba(3, 65, 118, 0.8)', + textStyle: { + color: '#fff', + }, + formatter: function (params) { + var name = params[0].name + if (name.length > 20) { + name = name.replace(/(.{20})/g, '$1
') // 每 30 个字符添加一个换行符 + } + var content = name + + return content + ' : ' + params[0].value + '万条' + } + }, grid: { top: 13, bottom: -10, @@ -57,14 +78,15 @@ function DataTop5(props) { }, formatter(value, index) { let str = '', num = 'TOP' + (index + 1) + let valueHandle = value.length > 10 ? value.substring(0, 10) + '...' : value if (index === 0) { - str = '{a| ' + num + '}{title| ' + value + '}' + str = '{a| ' + num + '}{title| ' + valueHandle + '}' } else if (index === 1) { - str = '{b| ' + num + '}{title| ' + value + '}' + str = '{b| ' + num + '}{title| ' + valueHandle + '}' } else if (index === 2) { - str = '{c| ' + num + '}{title| ' + value + '}' + str = '{c| ' + num + '}{title| ' + valueHandle + '}' } else { - str = '{d| ' + num + '}{title| ' + value + '}' + str = '{d| ' + num + '}{title| ' + valueHandle + '}' } return str }, diff --git a/web/client/src/sections/homePage/components/nodeResource.js b/web/client/src/sections/homePage/components/nodeResource.js index 101468d..e142a1e 100644 --- a/web/client/src/sections/homePage/components/nodeResource.js +++ b/web/client/src/sections/homePage/components/nodeResource.js @@ -5,7 +5,7 @@ import './style.less'; function NodeResource(props) { const { data: cluters = {} } = useFsRequest({ url: 'homepage/datatotal/cluters', - pollingInterval: 1000 * 10, + pollingInterval: 1000 * 20, }); const renderBody = () => { diff --git a/web/client/src/sections/homePage/components/style.less b/web/client/src/sections/homePage/components/style.less index d71fa30..e3274cb 100644 --- a/web/client/src/sections/homePage/components/style.less +++ b/web/client/src/sections/homePage/components/style.less @@ -123,7 +123,7 @@ .data_total { position: absolute; bottom: 13%; - right: 7%; + left: 79%; .data_number { line-height: 25px;