From fb46c00683c70ba3629db75369cc71a8e89cba85 Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Wed, 15 Jan 2020 17:17:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD=201.?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E9=A2=84=E8=A7=88=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=202.=E5=9B=BE=E8=A1=A8=E9=A2=84=E8=A7=88=E5=A4=9A=E5=9B=BE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=9A=84=E5=88=9B=E5=BB=BA=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=92=8C=E9=80=89=E6=8B=A9=E5=B7=B2=E6=9C=89=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=203.=E5=9B=BE=E8=A1=A8=E9=A2=84=E8=A7=88=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=88=96=E8=80=85=E9=80=89=E6=8B=A9=E9=9D=A2=E6=9D=BF=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=88=90=E5=8A=9F=E5=90=8E=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?panel=E7=95=8C=E9=9D=A2=20=EF=BC=88=E8=AF=B4=E6=98=8E=EF=BC=9A?= =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E5=9B=BEtip=E4=BF=A1=E6=81=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=BF=98=E6=9C=AA=E8=B0=83=E6=95=B4=E5=8F=8Alegend?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=98=BE=E7=A4=BA=E8=BF=98=E6=9C=AA?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-list.vue | 2 +- .../components/charts/line-chart-block.scss | 3 + .../components/charts/line-chart-block.vue | 8 +- .../src/components/common/language/cn.js | 9 +- .../src/components/common/language/en.js | 12 +- .../common/rightBox/metricPrePanelBox.vue | 153 ++++++++++++------ .../page/dashboard/metricPreview.vue | 15 +- .../components/page/dashboard/metricSet.scss | 3 + .../components/page/dashboard/metricSet.vue | 36 +++-- .../src/components/page/dashboard/panel.vue | 12 +- nezha-fronted/src/store/index.js | 4 + 11 files changed, 169 insertions(+), 88 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index f19e1a403..91f9a9848 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -90,7 +90,7 @@ export default { }else { this.dataList = response.data; } - if (this.dataList.length > 0) { + if (this.dataList.length > 0 && this.$refs.editChart) { this.$refs.editChart.forEach((item) => { item.showLoad();//之后要实现 }); diff --git a/nezha-fronted/src/components/charts/line-chart-block.scss b/nezha-fronted/src/components/charts/line-chart-block.scss index 11b6098f3..a27f7fb39 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.scss +++ b/nezha-fronted/src/components/charts/line-chart-block.scss @@ -93,4 +93,7 @@ border-bottom: 1px solid #dfe7f2; margin-bottom:-20px; } + .pt10{ + padding-top:10px; + } } diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index 49971b09f..015483502 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -31,7 +31,7 @@ :before-close="handleClose" @opened="initDialog"> -
+
"+"
"+"{b}"+"
"+"
{c}", }, legend: { type:'scroll', @@ -371,9 +372,6 @@ export default { return `${parseFloat(kbNum.toFixed(2))}K`; } return parseFloat(num.toFixed(2)); - //alert(1); - //return value; - //return this.getNumStr(value); }, }, //boundaryGap:[0,0.2] diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index a72a12ac1..52d0fd9c8 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -89,7 +89,14 @@ const cn = { expert:"Expert", label:"指标标签", addMetric:"添加指标", - expertTip:"请输入表达式" + expertTip:"请输入表达式", + goPanelTip:"是否前去看板,查看创建的图表?", + previewChart:"预览图表", + singleChartShow:"单图展示", + multiChartsShow:"多图展示", + createPanel:"创建面板", + selectPanel:"选择已有面板", + saveChartToPanel:"保存图表到看板" }, metricPreview:{ title:'指标预览', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 8e9d3ff10..ca77113b4 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -98,11 +98,17 @@ const en = { expert:"Expert", label:"MetricLabel", addMetric:"Create Metric", - expertTip:"Please enter an expression" - + expertTip:"Please enter an expression", + goPanelTip:"Go to the panel to view the created chart ?", + previewChart:"Preview Chart", + singleChartShow:"Single Graph Display", + multiChartsShow:"Multi Graph Display", + createPanel:"Create Panel", + selectPanel:"Select Panel", + saveChartToPanel:"Save Chart To Panel" }, metricPreview:{ - title:'MetricPreview', + title:'Metric Preview', }, refresh:'refresh', edit:'edit', diff --git a/nezha-fronted/src/components/common/rightBox/metricPrePanelBox.vue b/nezha-fronted/src/components/common/rightBox/metricPrePanelBox.vue index 307b804e9..51e38f6e3 100644 --- a/nezha-fronted/src/components/common/rightBox/metricPrePanelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/metricPrePanelBox.vue @@ -54,13 +54,16 @@