diff --git a/src/assets/css/components/views/charts2/networkOverviewLine.scss b/src/assets/css/components/views/charts2/networkOverviewLine.scss index 61e45f5d..ce490b80 100644 --- a/src/assets/css/components/views/charts2/networkOverviewLine.scss +++ b/src/assets/css/components/views/charts2/networkOverviewLine.scss @@ -7,14 +7,21 @@ height: 80%; width: 100%; .echarts-tooltip.echarts-tooltip-dark { - .cn-chart-tooltip { + .cn-chart-body { display: flex; - justify-content: space-between; - .cn-chart-tooltip-value.cn-chart-tooltip__color { - font-size: 12px; - color: #353636; - line-height: 21px; - font-weight: 600; + .cn-chart-tooltip { + display: flex; + flex-direction: column; + flex: 1; + .cn-chart-tooltip-box { + margin-right: 10px; + } + .cn-chart-tooltip-value.cn-chart-tooltip__color { + font-size: 12px; + color: #353636; + line-height: 21px; + font-weight: 600; + } } } } diff --git a/src/assets/css/components/views/charts2/npmLine.scss b/src/assets/css/components/views/charts2/npmLine.scss index fde5a79f..d46dee35 100644 --- a/src/assets/css/components/views/charts2/npmLine.scss +++ b/src/assets/css/components/views/charts2/npmLine.scss @@ -62,14 +62,21 @@ height: calc(100% - 41px); width: 100%; .echarts-tooltip.echarts-tooltip-dark { - .cn-chart-tooltip { + .cn-chart-body { display: flex; - justify-content: space-between; - .cn-chart-tooltip-value.cn-chart-tooltip__color { - font-size: 12px; - color: #353636; - line-height: 21px; - font-weight: 600; + .cn-chart-tooltip { + display: flex; + flex-direction: column; + flex: 1; + .cn-chart-tooltip-box { + margin-right: 10px; + } + .cn-chart-tooltip-value.cn-chart-tooltip__color { + font-size: 12px; + color: #353636; + line-height: 21px; + font-weight: 600; + } } } } diff --git a/src/assets/css/components/views/charts2/npmTrafficLine.scss b/src/assets/css/components/views/charts2/npmTrafficLine.scss index 2d07ee86..1be7d0cb 100644 --- a/src/assets/css/components/views/charts2/npmTrafficLine.scss +++ b/src/assets/css/components/views/charts2/npmTrafficLine.scss @@ -16,14 +16,21 @@ height: 100%; width: 100%; .echarts-tooltip.echarts-tooltip-dark { - .cn-chart-tooltip { + .cn-chart-body { display: flex; - justify-content: space-between; - .cn-chart-tooltip-value.cn-chart-tooltip__color { - font-size: 12px; - color: #353636; - line-height: 21px; - font-weight: 600; + .cn-chart-tooltip { + display: flex; + flex-direction: column; + flex: 1; + .cn-chart-tooltip-box { + margin-right: 10px; + } + .cn-chart-tooltip-value.cn-chart-tooltip__color { + font-size: 12px; + color: #353636; + line-height: 21px; + font-weight: 600; + } } } } diff --git a/src/views/charts/charts/tools.js b/src/views/charts/charts/tools.js index e7b0aa45..b9769799 100644 --- a/src/views/charts/charts/tools.js +++ b/src/views/charts/charts/tools.js @@ -469,43 +469,27 @@ export function stackedLineTooltipFormatter (params) { str += dateFormatByAppearance(tData) str += '' } - str += '
' + }) + str += '
' + str += '
' + params.forEach((item, i) => { str += '' str += item.marker - str += ` - ${item.seriesName} - ` + str += ` + ${item.seriesName} + ` str += '' - str += ` - ${unitConvert(item.data[1], item.value[2]).join(' ')} - ` - str += '
' }) str += '
' - return str -} -export function trafficLineTooltipFormatter (params) { - let str = '
' + str += '
' params.forEach((item, i) => { - const tData = item.data[0] - if (i === 0) { - str += '
' - str += dateFormatByAppearance(tData) - str += '
' - } - str += '
' - str += '' - str += item.marker - str += ` - ${item.seriesName} - ` - str += '' str += ` ${unitConvert(item.data[1], item.value[2]).join(' ')} ` - str += '
' }) str += '
' + str += '
' + str += '
' return str } export function appStackedLineTooltipFormatter (params) { diff --git a/src/views/charts2/charts/npm/NpmNetworkQuantity.vue b/src/views/charts2/charts/npm/NpmNetworkQuantity.vue index a54985fa..ec0b4031 100644 --- a/src/views/charts2/charts/npm/NpmNetworkQuantity.vue +++ b/src/views/charts2/charts/npm/NpmNetworkQuantity.vue @@ -59,7 +59,7 @@ export default { } else if (condition.length > 1 && type && type === 'ip') { params.q = `${type}='${condition[1]}' and side='${this.side}'` } else if (condition.length > 1 && type && type !== 'ip') { - if (type === 'country' || type === 'asn') { + if (type === 'country' || type === 'asn' || type === 'province' || type === 'city' || type === 'isp') { params.q = `${type}='${condition[1]}'` } else if (type === 'idcRenter') { params.q = `idc_renter='${condition[1]}'` @@ -106,7 +106,7 @@ export default { } else if (condition.length > 1 && type && type === 'ip') { params.q = `${type}='${condition[1]}' and side='${this.side}'` } else if (condition.length > 1 && type && type !== 'ip') { - if (type === 'country' || type === 'asn') { + if (type === 'country' || type === 'asn' || type === 'province' || type === 'city' || type === 'isp') { params.q = `${type}='${condition[1]}'` } else if (type === 'idcRenter') { params.q = `idc_renter='${condition[1]}'` diff --git a/src/views/charts2/charts/npm/NpmTrafficLine.vue b/src/views/charts2/charts/npm/NpmTrafficLine.vue index 2d2f9615..dbb9b37a 100644 --- a/src/views/charts2/charts/npm/NpmTrafficLine.vue +++ b/src/views/charts2/charts/npm/NpmTrafficLine.vue @@ -16,7 +16,7 @@ import { trafficLineChartOption } from '@/views/charts2/charts/options/echartOpt import unitConvert from '@/utils/unit-convert' import { unitTypes, chartColor3 } from '@/utils/constants.js' import { shallowRef } from 'vue' -import { trafficLineTooltipFormatter } from '@/views/charts/charts/tools' +import { stackedLineTooltipFormatter, trafficLineTooltipFormatter } from '@/views/charts/charts/tools' import { get } from '@/utils/http' import { api } from '@/utils/api' import { getSecond } from '@/utils/date-util' @@ -74,7 +74,7 @@ export default { } else if (condition.length > 1 && type && type === 'ip') { params.q = `${type}='${condition[1]}' and side='${this.side}'` } else if (condition.length > 1 && type && type !== 'ip') { - if (type === 'country' || type === 'asn') { + if (type === 'country' || type === 'asn' || type === 'province' || type === 'city' || type === 'isp') { params.q = `${type}='${condition[1]}'` } else if (type === 'idcRenter') { params.q = `idc_renter='${condition[1]}'` @@ -158,7 +158,7 @@ export default { params.forEach(t => { t.seriesName = this.$t(t.seriesName) }) - const str = trafficLineTooltipFormatter(params) + const str = stackedLineTooltipFormatter(params) return str } this.myChart.on('legendselectchanged', this.handleLegendClick)