From e72368b6fc762e81ba298151f526864d49ca1529 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Thu, 6 Jan 2022 22:30:22 +0800 Subject: [PATCH] feat: set config --- src/components/Graph.vue | 3 + src/components/Selector.vue | 17 +++- src/store/modules/data.ts | 2 +- src/types/dashboard.ts | 2 +- .../dashboard/configuration/ConfigEdit.vue | 77 +++++++++++++------ .../configuration/StandardOptions.vue | 2 +- .../dashboard/configuration/WidgetOptions.vue | 12 ++- .../configuration/graph-styles/Line.vue | 47 ++++++++++- src/views/dashboard/graphs/Pie.vue | 4 +- src/views/dashboard/panel/Widget.vue | 6 +- 10 files changed, 134 insertions(+), 38 deletions(-) diff --git a/src/components/Graph.vue b/src/components/Graph.vue index 8734626d..e719da7f 100644 --- a/src/components/Graph.vue +++ b/src/components/Graph.vue @@ -51,6 +51,9 @@ function drawEcharts(): void { if (!chart.value) { return; } + if (state.instanceChart) { + return; + } state.instanceChart = echarts.init(chart.value, ""); unWarp(state.instanceChart).setOption(props.option); state.instanceChart.on("click", (params: any) => { diff --git a/src/components/Selector.vue b/src/components/Selector.vue index a349fd5a..fafc936f 100644 --- a/src/components/Selector.vue +++ b/src/components/Selector.vue @@ -32,7 +32,7 @@ limitations under the License. --> diff --git a/src/views/dashboard/graphs/Pie.vue b/src/views/dashboard/graphs/Pie.vue index 5560eb5d..25874d42 100644 --- a/src/views/dashboard/graphs/Pie.vue +++ b/src/views/dashboard/graphs/Pie.vue @@ -16,7 +16,7 @@ limitations under the License. -->