diff --git a/src/assets/css/components/views/charts2/npmAppCategoryScore.scss b/src/assets/css/components/views/charts2/npmAppCategoryScore.scss index f3be6df9..047597bd 100644 --- a/src/assets/css/components/views/charts2/npmAppCategoryScore.scss +++ b/src/assets/css/components/views/charts2/npmAppCategoryScore.scss @@ -51,6 +51,7 @@ height: 25px; line-height: 25px; text-align: center; + margin-right: 36px; span { i { font-size: 20px; diff --git a/src/assets/css/components/views/charts2/npmLine.scss b/src/assets/css/components/views/charts2/npmLine.scss index 9c8a6931..7c46f867 100644 --- a/src/assets/css/components/views/charts2/npmLine.scss +++ b/src/assets/css/components/views/charts2/npmLine.scss @@ -14,6 +14,9 @@ margin-right: 10px; align-items: center; } + .npm-line-header-right:last-child { + margin-right: 0; + } .npm-line-header-right.active { .npm-line-header-icon { background: #ccc; diff --git a/src/views/charts2/charts/NetworkOverviewApps.vue b/src/views/charts2/charts/NetworkOverviewApps.vue index 593340c5..498730d2 100644 --- a/src/views/charts2/charts/NetworkOverviewApps.vue +++ b/src/views/charts2/charts/NetworkOverviewApps.vue @@ -32,9 +32,13 @@
{{unitConvert(app.rate, unitTypes.number).join(' ')}}
-
- +-{{unitConvert(periodicJudgmentCalculationChange(app.rate, app.pRate).total, unitTypes.percent).join('')}} +
+ +{{unitConvert(app.value, unitTypes.percent).join('')}}
+
+ -{{unitConvert(app.value, unitTypes.percent).join('').replaceAll('-', '')}} +
+
@@ -116,6 +120,7 @@ import { api } from '@/utils/api' import _ from 'lodash' import { getSecond } from '@/utils/date-util' import { appTestData, appPrevTestData, providerTestData, providerPrevTestData } from './appsTestData' +import { getChainRatio } from '@/utils/tools' export default { name: 'NetworkOverviewApps', props: { @@ -243,7 +248,7 @@ export default { d2.pRate = prevTypeData ? (prevTypeData[app] ? prevTypeData[app].rate : 0) : 0 d2.total = d[app].analysis.total d2.lineData = d[app].values.map(v => [Number(v[0]), Number(v[1]), 'time']) - d2.trend = this.periodicJudgmentCalculationChange(d2.rate, d2.pRate).value + d2.value = getChainRatio(d2.rate, d2.pRate) this.initChart(d2) } }) @@ -461,20 +466,6 @@ export default { } }) }, - periodicJudgmentCalculationChange (period, pperiod) { - const periodicData = {} - if (period > pperiod) { - periodicData.value = 'up' - periodicData.total = pperiod === 0 ? 0 : (period - pperiod) / pperiod - } else if (period < pperiod) { - periodicData.value = 'down' - periodicData.total = (pperiod - period) / pperiod - } else { - periodicData.value = '' - periodicData.total = 0 - } - return periodicData - }, resize () { this.myChart.forEach(t => { t.resize() diff --git a/src/views/charts2/charts/NpmAppCategoryScore.vue b/src/views/charts2/charts/NpmAppCategoryScore.vue index 68dd56fd..884a3339 100644 --- a/src/views/charts2/charts/NpmAppCategoryScore.vue +++ b/src/views/charts2/charts/NpmAppCategoryScore.vue @@ -1,6 +1,6 @@ @@ -147,33 +159,19 @@ export default { timeFilter: Object }, methods: { - tableCellStyle ({ row, column, rowIndex, columnIndex }) { - let style = 'border-right:0px;font-size:12px;padding:7px 0 !important;border-bottom: 1px solid #ECECEC;' - if (rowIndex === this.tableData.length - 1) { - style = style + 'border-bottom:0px !important;' - } - if (columnIndex === 0) { - style = style + 'color:#046ECA;' - } - return style - }, - tableHeaderCellStyle ({ row, column, rowIndex, columnIndex }) { - return 'border-right:0px;font-size:12px;font-weight:500;padding:4px 0 !important;border-bottom: 1px solid #E2E5EC;' - }, - chainCalculation (period, pperiod) { - const periodicData = {} - if (period > pperiod) { - periodicData.value = 'up' - periodicData.total = (period - pperiod) / pperiod - } else if (period < pperiod) { - periodicData.value = 'down' - periodicData.total = (pperiod - period) / pperiod - } else { - periodicData.value = '' - periodicData.total = 0 - } - return periodicData - }, + // tableCellStyle ({ row, column, rowIndex, columnIndex }) { + // let style = 'border-right:0px;font-size:12px;padding:7px 0 !important;border-bottom: 1px solid #ECECEC;' + // if (rowIndex === this.tableData.length - 1) { + // style = style + 'border-bottom:0px !important;' + // } + // if (columnIndex === 0) { + // style = style + 'color:#046ECA;' + // } + // return style + // }, + // tableHeaderCellStyle ({ row, column, rowIndex, columnIndex }) { + // return 'border-right:0px;font-size:12px;font-weight:500;padding:4px 0 !important;border-bottom: 1px solid #E2E5EC;' + // }, init (params) { if (!params) { params = { @@ -200,9 +198,9 @@ export default { const prev = prevData.find(p => p.appSubcategory === d.appSubcategory) if (prev) { - result.bytesRateChainRatio = prev.totalBitsRate === 0 ? '-' : getChainRatio(d.totalBitsRate, prev.totalBitsRate) - result.inboundBytesRateChainRatio = prev.inboundBitsRate === 0 ? '-' : getChainRatio(d.inboundBitsRate, prev.inboundBitsRate) - result.outboundBytesRateChainRatio = prev.outboundBitsRate === 0 ? '-' : getChainRatio(d.outboundBitsRate, prev.outboundBitsRate) + result.bytesRateChainRatio = getChainRatio(d.totalBitsRate, prev.totalBitsRate) + result.inboundBytesRateChainRatio = getChainRatio(d.inboundBitsRate, prev.inboundBitsRate) + result.outboundBytesRateChainRatio = getChainRatio(d.outboundBitsRate, prev.outboundBitsRate) } return result }) @@ -231,8 +229,12 @@ export default { } }) tableData.forEach(t => { - t.score = (t.tcpScore + t.httpScore + t.sslScore + t.tcpLostScore + t.packetRetransScore) * 6 + t.score = Math.ceil((t.tcpScore + t.httpScore + t.sslScore + t.tcpLostScore + t.packetRetransScore) * 6) + if (t.score > 6) { + t.score = 6 + } }) + this.tableData = tableData console.info(tableData) }) } diff --git a/src/views/charts2/charts/SingleValue.vue b/src/views/charts2/charts/SingleValue.vue index 5fce9b5f..fca631f7 100644 --- a/src/views/charts2/charts/SingleValue.vue +++ b/src/views/charts2/charts/SingleValue.vue @@ -4,11 +4,11 @@
{{$t(npmNetworkName[index].name)}}
{{unitConvert(npm.establishLatencyAvg, unitTypes.time).join(' ')}}
-
+
 {{unitConvert(npm.value, unitTypes.percent).join('')}}
-
-  {{unitConvert(npm.value, unitTypes.percent).join('')}} +
+  {{unitConvert(npm.value, unitTypes.percent).join('').replaceAll('-', '')}}
@@ -23,11 +23,11 @@
{{$t(npmNetworkName[index].name)}}
{{unitConvert(npm.httpResponseLatencyAvg, unitTypes.time).join(' ')}}
-
+
 {{unitConvert(npm.value, unitTypes.percent).join('')}}
-
-  {{unitConvert(npm.value, unitTypes.percent).join('')}} +
+  {{unitConvert(npm.value, unitTypes.percent).join('').replaceAll('-', '')}}
@@ -42,11 +42,11 @@
{{$t(npmNetworkName[index].name)}}
{{unitConvert(npm.sslConLatencyAvg, unitTypes.time).join(' ')}}
-
+
 {{unitConvert(npm.value, unitTypes.percent).join('')}}
-
-  {{unitConvert(npm.value, unitTypes.percent).join('')}} +
+  {{unitConvert(npm.value, unitTypes.percent).join('').replaceAll('-', '')}}
@@ -61,11 +61,11 @@
{{$t(npmNetworkName[index].name)}}
{{unitConvert(npm.sequenceGapLossAvg, unitTypes.percent).join(' ')}}
-
+
 {{unitConvert(npm.value, unitTypes.percent).join('')}}
-
-  {{unitConvert(npm.value, unitTypes.percent).join('')}} +
+  {{unitConvert(npm.value, unitTypes.percent).join('').replaceAll('-', '')}}
@@ -80,11 +80,11 @@
{{$t(npmNetworkName[index].name)}}
{{unitConvert(npm.pktRetransAvg, unitTypes.percent).join(' ')}}
-
+
 {{unitConvert(npm.value, unitTypes.percent).join('')}}
-
-  {{unitConvert(npm.value, unitTypes.percent).join('')}} +
+  {{unitConvert(npm.value, unitTypes.percent).join('').replaceAll('-', '')}}
@@ -101,6 +101,7 @@