From b0fd2ddf2c06cd00804a8e74a68c7be0cacdf363 Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Sat, 22 Feb 2020 18:44:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9BUG=201.dashboard?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=EF=BC=9A=E8=B0=83=E6=95=B4=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E5=8C=BA=E5=9F=9F=E5=A4=A7=E5=B0=8F=EF=BC=9B?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BB=9F=E4=B8=80=E6=A0=87=E9=A2=98=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=B9=E5=BC=8F=EF=BC=9B=E8=B0=83=E6=95=B4=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E8=A1=8C=E9=AB=98=E5=BA=A6=E5=8F=8A4=E4=B8=AA?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=A4=A7=E5=B0=8F=202.=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=8F=B3=E4=B8=8A=E8=A7=92create=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8F=96=E6=B6=88=E6=96=87=E5=AD=97=EF=BC=8C=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=82=AC=E6=B5=AE=E6=98=BE=E7=A4=BA=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-list.vue | 75 ++++++++++--------- .../src/components/charts/chart-table.scss | 9 ++- .../src/components/charts/chart-table.vue | 4 +- .../components/charts/line-chart-block.scss | 18 ++++- .../components/charts/line-chart-block.vue | 35 +++++---- .../src/components/common/language/cn.js | 9 ++- .../src/components/common/language/en.js | 7 ++ .../src/components/page/alert/config.vue | 6 +- .../src/components/page/asset/asset.vue | 4 +- .../src/components/page/config/account.vue | 6 +- .../src/components/page/config/dc.vue | 6 +- .../src/components/page/config/promServer.vue | 4 +- .../src/components/page/dashboard/panel.vue | 11 ++- .../src/components/page/project/project.vue | 6 +- 14 files changed, 116 insertions(+), 84 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 44ec7cc13..a96607fa0 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -199,7 +199,9 @@ export default { // 没有数据的设置提示信息暂无数据-针对每一个图 if (len === 0) { this.$nextTick(() => { - this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, this.filter);//????怎么设置的无数据?? + if(this.$refs.editChart[index]){ + this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, this.filter);//????怎么设置的无数据?? + } }); } else { let startTime = ''; @@ -327,44 +329,47 @@ export default { } } }); - if (chartItem.type === 'table') {//表格 - if(filterType==='showFullScreen'){//table的全屏查询 - this.$refs.editChart[index].setData(chartItem, tableData, - this.filter.panelId, this.filter,filterType); - }else { - this.$refs.editChart[index].setData(chartItem, tableData, - this.filter.panelId, this.filter); - } - - } else if (chartItem.type === 'line' || chartItem.type === 'bar' || chartItem.type === 4) { - if (series.length && chartItem.type === 4) {//曲线汇总 - //series.push(sumData);//后续需要 - } - if(filterType==='showFullScreen'){//table的全屏查询 - this.$refs.editChart[index].setData(chartItem, series, - this.filter.panelId, this.filter,legend,filterType); - }else { - this.$refs.editChart[index].setData(chartItem, series, - this.filter.panelId, this.filter,legend); + if(this.$refs.editChart[index]) { + if (chartItem.type === 'table') {//表格 + if (filterType === 'showFullScreen') {//table的全屏查询 + this.$refs.editChart[index].setData(chartItem, tableData, + this.filter.panelId, this.filter, filterType); + } else { + this.$refs.editChart[index].setData(chartItem, tableData, + this.filter.panelId, this.filter); + } + } else if (chartItem.type === 'line' || chartItem.type === 'bar' || chartItem.type === 4) { + if (series.length && chartItem.type === 4) {//曲线汇总 + //series.push(sumData);//后续需要 + } + if (filterType === 'showFullScreen') {//table的全屏查询 + this.$refs.editChart[index].setData(chartItem, series, + this.filter.panelId, this.filter, legend, filterType); + } else { + this.$refs.editChart[index].setData(chartItem, series, + this.filter.panelId, this.filter, legend); + } } } } else { const type = chartItem.type; - if (type === 'table') { - if(filterType==='showFullScreen'){//table的全屏查询 - this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, - this.filter,filterType); - }else { - this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, - this.filter); - } - } else if (type === 'line' || type === 'bar' || chartItem.type === 4) { - if(filterType==='showFullScreen'){//table的全屏查询 - this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, - this.filter,filterType); - }else { - this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, - this.filter); + if(this.$refs.editChart[index]) { + if (type === 'table') { + if (filterType === 'showFullScreen') {//table的全屏查询 + this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, + this.filter, filterType); + } else { + this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, + this.filter); + } + } else if (type === 'line' || type === 'bar' || chartItem.type === 4) { + if (filterType === 'showFullScreen') {//table的全屏查询 + this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, + this.filter, filterType); + } else { + this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, + this.filter); + } } } } diff --git a/nezha-fronted/src/components/charts/chart-table.scss b/nezha-fronted/src/components/charts/chart-table.scss index 42274ee9c..7e9c7c479 100644 --- a/nezha-fronted/src/components/charts/chart-table.scss +++ b/nezha-fronted/src/components/charts/chart-table.scss @@ -25,7 +25,7 @@ .table-title { font-weight: bold; font-size: 18px; - line-height: 30px; + line-height: 26px; color: #333; } .edit:after{ @@ -33,6 +33,13 @@ content: ""; clear: both; } + + .button-panel-height{ + height:26px; + } + .button-panel-height button{ + height:26px; + } .edit { position: absolute; right: 20px; diff --git a/nezha-fronted/src/components/charts/chart-table.vue b/nezha-fronted/src/components/charts/chart-table.vue index 3ce6d65a9..314a7d098 100644 --- a/nezha-fronted/src/components/charts/chart-table.vue +++ b/nezha-fronted/src/components/charts/chart-table.vue @@ -16,9 +16,9 @@
{{data.title}}
-
+
diff --git a/nezha-fronted/src/components/charts/line-chart-block.scss b/nezha-fronted/src/components/charts/line-chart-block.scss index a9856b490..7b94d0d10 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.scss +++ b/nezha-fronted/src/components/charts/line-chart-block.scss @@ -2,12 +2,10 @@ .clearfix:after{ display: block; content: ""; - height:0; - visibility:hidden; clear: both; } .clearfix{ - //margin-bottom: 20px; + margin-bottom: 7px; } .legend-shape{ display:inline-block; @@ -47,9 +45,15 @@ position: relative; background: #FFF; border: 1px solid #d8dce1; - padding: 20px 30px; + padding: 20px 8px; margin-bottom: 10px; padding-bottom: 3px; + .chart-title { + font-weight: bold; + font-size: 18px; + line-height: 26px; + color: #333; + } .line-area { box-sizing: border-box; background: #FFF; @@ -60,6 +64,12 @@ content: ""; clear: both; }*/ + .button-panel-height{ + height:26px; + } + .button-panel-height button{ + height:26px; + } .edit { position: absolute; right: 20px; diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index 7beac3e68..250a1f1a6 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -2,7 +2,7 @@ @import './line-chart-block.scss';