perf: detection左侧筛选样式微调

This commit is contained in:
chenjinsong
2022-02-28 15:24:47 +08:00
parent e812a2db2a
commit 2bd18a18ea
2 changed files with 5 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { unitTypes } from '@/utils/constants' import { unitTypes } from '@/utils/constants'
import _ from 'lodash'
const numberUnit = ['', 'K', 'M', 'G', 'T', 'P', 'E'] const numberUnit = ['', 'K', 'M', 'G', 'T', 'P', 'E']
const byteUnit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'] const byteUnit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']
@@ -35,6 +36,9 @@ export function byteUnitConvert (value, sourceUnit = 'B', targetUnit, dot = 2) {
} }
/* 时间单位转换例如将ms转为h */ /* 时间单位转换例如将ms转为h */
export function timeUnitFormatter (time, sourceUnit = 'ms', targetUnit, dot = 2) { export function timeUnitFormatter (time, sourceUnit = 'ms', targetUnit, dot = 2) {
if (!_.isNumber(time) || time === 0) {
return [0, sourceUnit]
}
let sourceIndex = -1 let sourceIndex = -1
let targetIndex = -1 let targetIndex = -1
timeUnit.forEach((t, i) => { timeUnit.forEach((t, i) => {

View File

@@ -15,7 +15,7 @@
<!-- 内容区 --> <!-- 内容区 -->
<div class="explorer-container" style="height: calc(100% - 20px); flex-direction: column"> <div class="explorer-container" style="height: calc(100% - 20px); flex-direction: column">
<div class="detection__event-severity-bar" :id="`eventSeverityTrendBar${pageType}`"></div> <div class="detection__event-severity-bar" :id="`eventSeverityTrendBar${pageType}`"></div>
<div style="display: flex;"> <div style="display: flex; flex-grow: 1">
<detection-filter <detection-filter
:filter-data="filterData[pageType]" :filter-data="filterData[pageType]"
:q="q" :q="q"