From 0dd52b1ec80c6dee3f0e82eec5686fde7d26f3c3 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 17 Sep 2021 17:55:09 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1003=20fix:=20explore=20logs=20tooltip=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E6=9C=AA=E8=BD=AC=E6=8D=A2=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../page/dashboard/explore/logTab.vue | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue index 66eb611b8..4b75af3cc 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue @@ -257,7 +257,8 @@ export default { boundaryGap: [0, '1%'] }, tooltip: { - trigger: 'axis' + trigger: 'axis', + formatter: vm.tooltipFormatter }, yAxis: { type: 'value', @@ -477,6 +478,29 @@ export default { } else { return expression } + }, + tooltipFormatter (params, a, b) { + const vm = this + console.log(params, a, b) + let str = ` +
+
+
${vm.utcTimeToTimezoneStr(vm.$unixTimeParseToString(vm.toMillisecondTime(params[0].axisValue) / 1000))}
+
+
` + params.forEach(item => { + str += `
+ ${item.marker} + ${item.seriesName} + ${item.value[1]} +
+
` + }) + str += '
' + str += '
' + str += '
' + str += '
' + return str } }, watch: {