fix: table类型图表逻辑调整;完善一些工具方法;地图切换实现

This commit is contained in:
chenjinsong
2022-03-06 23:26:42 +08:00
parent f4daaa8e75
commit 5427ea0760
11 changed files with 150 additions and 49 deletions

View File

@@ -130,7 +130,19 @@ export const unitTypes = {
export const chartTableDefaultPageSize = 10 // table类型图表默认每页数据量
export const chartTableTopOptions = [10, 100] // table类型图表的TOP-N选项
export const chartActiveIpTableOrderOptions = ['machine'] // active ip table类型图表的order 选项
// table类型图表的TOP-N选项
// table类型图表column映射
export const chartTableColumnMapping = {
sessions: 'overall.sessions',
packets: 'overall.packets',
bytes: 'overall.bytes',
clientIp: 'overall.clientIp',
serverIp: 'overall.serverIp',
domain: 'overall.domain',
appName: 'overall.appName',
queryRate: 'dns.queryRate',
dnsLatency: 'dns.averageResolveLatency',
responseFailRate: 'dns.responseFailureRate'
}
export const chartPieTableTopOptions = [
{ name: 'Sessions', value: 'sessions' },
{ name: 'Packets', value: 'packets' },

View File

@@ -29,7 +29,7 @@ export function getMillisecond (time) {
ms = Math.floor(time * (10 ** (0 - difference)))
}
}
return ms
return ms ? Number(ms) : null
}
// 初始化日期
export function getNowTime (interval) {

View File

@@ -444,12 +444,18 @@ export function lineToHump (name) {
}
// 下划线转换空格首位大写
export function lineToSpace (name) {
if (_.isEmpty(name)) {
return ''
}
return _.upperFirst(name.replace(/\_(\w)/g, function (all, letter) {
return ` ${letter.toUpperCase()}`
}))
}
// 驼峰转换下划线
export function humpToLine (name) {
if (_.isEmpty(name)) {
return ''
}
return name.replace(/([A-Z])/g, '_$1').toLowerCase()
}
// 搜索功能:对象转字符串