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';