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 @@