From b8ea64fccee885222b85d9db2e1b3aefdf56eded Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 8 Sep 2023 17:59:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?NEZ-3188=20fix=EF=BC=9AExplore=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8CMetrics=20save=20chart=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/package-lock.json | 4 ++-- .../page/dashboard/explore/exploreItem.vue | 21 ++++++++++++++++++- .../page/dashboard/overview/chart.vue | 18 ++++++++-------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/nezha-fronted/package-lock.json b/nezha-fronted/package-lock.json index 9545f25a8..531ecdd9a 100644 --- a/nezha-fronted/package-lock.json +++ b/nezha-fronted/package-lock.json @@ -14340,7 +14340,7 @@ }, "node-sass": { "version": "4.14.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", + "resolved": "https://registry.npmmirror.com/node-sass/-/node-sass-4.14.1.tgz", "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", "dev": true, "requires": { @@ -20727,7 +20727,7 @@ }, "webpack-bundle-analyzer": { "version": "2.13.1", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", + "resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz", "integrity": "sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ==", "dev": true, "requires": { diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 9faa5bb42..f851ac6c6 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -4260,7 +4260,26 @@ export default { nullType: 'null', legend: { placement: 'bottom', values: [], show: true }, thresholdShow: true, - thresholds: [{ value: undefined, color: '#eeeeeeff' }] + thresholds: [{ value: undefined, color: '#eeeeeeff' }], + showHeader: 1, + visibility: { + varName: '', + operator: 'equal', + varValue: '', + result: 'show' + }, + rightYAxis: { + elementNames: [], + style: 'line', + unit: 2, + label: '', + min: undefined, + max: undefined + }, + option: { + lineWidth: 1, + pointSize: 6 + } }, elements: [], panel: '', diff --git a/nezha-fronted/src/components/page/dashboard/overview/chart.vue b/nezha-fronted/src/components/page/dashboard/overview/chart.vue index 7e2dd6496..81cf1fb4f 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/chart.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/chart.vue @@ -533,7 +533,7 @@ export default { params.forEach((item, i) => { const alias = this.queryAlias(item.seriesIndex) if (i === 0 && alias.indexOf('Previous ') === -1) { - const value = item.data[0] + const value = item.value[0] str += '
' str += bus.timeFormate(bus.computeTimezone(value)) str += '
' @@ -542,13 +542,13 @@ export default { if (i !== 0) { str += '
' } - const value = item.data[0] - this.minusTime + const value = item.value[0] - this.minusTime str += bus.timeFormate(bus.computeTimezone(value)) minusFlag = false } - showFlag = showFlag || item.data[1] - if (!isNaN(item.data[1] + '')) { - const val = Number(item.data[1]) + showFlag = showFlag || item.value[1] + if (!isNaN(item.value[1] + '')) { + const val = Number(item.value[1]) str += `
` str += `
@@ -565,7 +565,7 @@ export default { const previousItem = params.find((series) => ('Previous ' + item.seriesName) === series.seriesName) if (previousItem) { str += '' - const previousval = formatScientificNotation(previousItem.data[1], dot) + const previousval = formatScientificNotation(previousItem.value[1], dot) let minusVal = 0 if (previousval <= val) { minusVal = val - previousval @@ -759,16 +759,16 @@ export default { } const seriesName = nameArr.join('-') // title - const value = bus.computeTimezone(params.data[0]) + const value = bus.computeTimezone(params.value[0]) const tData = new Date(value) // value - let paramsDot = bus.countDecimals(params.data[1]) + let paramsDot = bus.countDecimals(params.value[1]) if (paramsDot < this.chartDot) { paramsDot = this.chartDot } else if (paramsDot > 6) { paramsDot = 6 } - const val = formatScientificNotation(params.data[1], paramsDot) + const val = formatScientificNotation(params.value[1], paramsDot) const color = this.colors[params.seriesIndex] this.tooltip.tooltipHtml = `
From d7bd87f6e6ec41c6c6debef8d258e79f038b1c98 Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 8 Sep 2023 18:08:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9Aexplore=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=20=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/page/dashboard/explore/exploreItem.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 65d61672c..d6bbbc264 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -4419,6 +4419,7 @@ export default { min: undefined, max: undefined }, + dataLink: [], option: { lineWidth: 1, pointSize: 6