From b3ac8130d704e64172056cad35c27ce5508c44a4 Mon Sep 17 00:00:00 2001 From: wangwenrui Date: Thu, 18 Jun 2020 16:38:07 +0800 Subject: [PATCH] =?UTF-8?q?perf:explore=20=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD(operator=20function=20=E5=BE=85=E5=AE=8C=E6=88=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-list.vue | 4 +- .../page/dashboard/explore/editor.vue | 255 +++++++++++++++--- .../page/dashboard/explore/suggestions.vue | 12 +- 3 files changed, 228 insertions(+), 43 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 42c4c3612..39f9d0e96 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -1580,7 +1580,9 @@ } }, getAlertListChartData:function(chartInfo,filterType){ - this.$set(chartInfo, "param", {endpointId: this.additionalInfo.id}); + if(this.additionalInfo){ + this.$set(chartInfo, "param", {endpointId: this.additionalInfo.id}); + } this.$refs['editChart'+chartInfo.id][0].getAlertList(filterType); }, getAlertRuleChartData(chartInfo) { diff --git a/nezha-fronted/src/components/page/dashboard/explore/editor.vue b/nezha-fronted/src/components/page/dashboard/explore/editor.vue index 5af1aabe7..6be59a4f2 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/editor.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/editor.vue @@ -4,9 +4,9 @@
-
-
-
+
+
+
@@ -18,7 +18,7 @@ diff --git a/nezha-fronted/src/components/page/dashboard/explore/suggestions.vue b/nezha-fronted/src/components/page/dashboard/explore/suggestions.vue index f0c5a32b8..ab4872344 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/suggestions.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/suggestions.vue @@ -57,7 +57,6 @@ }, ]; const funcs=[ - ...operators, { insertText: 'abs', label: 'abs', @@ -360,6 +359,13 @@ documentation: 'The population standard variance of the values in the specified interval.', }, ] - export default { - } + export default { + getOperators:function(){ + return JSON.parse(JSON.stringify(operators)); + }, + + getFunctions:function(){ + return JSON.parse(JSON.stringify(funcs)) + }, + }