Browse Source

(*)大屏样式优化

master
peng.peng 2 years ago
parent
commit
6ff2e61347
  1. 30
      web/client/src/sections/homePage/components/dataTop5.js
  2. 2
      web/client/src/sections/homePage/components/nodeResource.js
  3. 2
      web/client/src/sections/homePage/components/style.less

30
web/client/src/sections/homePage/components/dataTop5.js

@ -37,6 +37,27 @@ function DataTop5(props) {
show: false, 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<br>') // 每 30 个字符添加一个换行符
}
var content = name
return content + ' : <b>' + params[0].value + '</b>万条'
}
},
grid: { grid: {
top: 13, top: 13,
bottom: -10, bottom: -10,
@ -57,14 +78,15 @@ function DataTop5(props) {
}, },
formatter(value, index) { formatter(value, index) {
let str = '', num = 'TOP' + (index + 1) let str = '', num = 'TOP' + (index + 1)
let valueHandle = value.length > 10 ? value.substring(0, 10) + '...' : value
if (index === 0) { if (index === 0) {
str = '{a| ' + num + '}{title| ' + value + '}' str = '{a| ' + num + '}{title| ' + valueHandle + '}'
} else if (index === 1) { } else if (index === 1) {
str = '{b| ' + num + '}{title| ' + value + '}' str = '{b| ' + num + '}{title| ' + valueHandle + '}'
} else if (index === 2) { } else if (index === 2) {
str = '{c| ' + num + '}{title| ' + value + '}' str = '{c| ' + num + '}{title| ' + valueHandle + '}'
} else { } else {
str = '{d| ' + num + '}{title| ' + value + '}' str = '{d| ' + num + '}{title| ' + valueHandle + '}'
} }
return str return str
}, },

2
web/client/src/sections/homePage/components/nodeResource.js

@ -5,7 +5,7 @@ import './style.less';
function NodeResource(props) { function NodeResource(props) {
const { data: cluters = {} } = useFsRequest({ const { data: cluters = {} } = useFsRequest({
url: 'homepage/datatotal/cluters', url: 'homepage/datatotal/cluters',
pollingInterval: 1000 * 10, pollingInterval: 1000 * 20,
}); });
const renderBody = () => { const renderBody = () => {

2
web/client/src/sections/homePage/components/style.less

@ -123,7 +123,7 @@
.data_total { .data_total {
position: absolute; position: absolute;
bottom: 13%; bottom: 13%;
right: 7%; left: 79%;
.data_number { .data_number {
line-height: 25px; line-height: 25px;

Loading…
Cancel
Save