fix:处理panel 页面报错信息

This commit is contained in:
zhangyu
2021-11-26 16:24:58 +08:00
parent 463a66847d
commit a1c9b34a8b
3 changed files with 12 additions and 12 deletions

View File

@@ -1430,7 +1430,7 @@ export default {
if (this.additionalInfo) {
this.$set(chartInfo, 'param', { endpointId: this.additionalInfo.id })
}
this.$refs['editChart' + chartInfo.id][0].getAlertList(filterType)
this.$refs['editChart' + chartInfo.id][0] && this.$refs['editChart' + chartInfo.id][0].getAlertList(filterType)
},
getAlertRuleChartData (chartInfo) {
const vm = this

View File

@@ -884,7 +884,7 @@ export default {
getChartData (chartInfo, pos, filterType) {
const chartItem = chartInfo
if (chartItem.type === 'group') {
this.$refs['editChart' + chartItem.id][0].setData(chartItem)
this.$refs['editChart' + chartItem.id][0] && this.$refs['editChart' + chartItem.id][0].setData(chartItem)
return
}
if (chartItem.type === 'assetInfo') {
@@ -1686,7 +1686,7 @@ export default {
if (this.obj) {
this.$set(chartInfo, 'param', { endpointId: this.obj.id })
}
this.$refs['editChart' + chartInfo.id][0].getAlertList(null, null, chartInfo)
this.$refs['editChart' + chartInfo.id][0] && this.$refs['editChart' + chartInfo.id][0].getAlertList(null, null, chartInfo)
},
getAlertRuleChartData (chartInfo) {
const vm = this

View File

@@ -1057,14 +1057,14 @@ export default {
const vm = this
setTimeout(function () {
const divHeight = self.$refs.legendArea ? self.$refs.legendArea.offsetHeight : 0
if (!chartInfo.height && getChart(self.chartIndex)) {
getChart(self.chartIndex).resize({ height: (250 - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) })
if (!chartInfo.height) {
getChart(self.chartIndex) && getChart(self.chartIndex).resize({ height: (250 - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) })
} else {
getChart(self.chartIndex).resize({ height: (chartInfo.height * vm.stepWidth - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) })
getChart(self.chartIndex) && getChart(self.chartIndex).resize({ height: (chartInfo.height * vm.stepWidth - divHeight - chartResizeTool.titleHeight - chartResizeTool.chartBlankHeight) })
}
if (dataArg && dataArg.length > 0) {
getChart(self.chartIndex).clear()
getChart(self.chartIndex).setOption(option)// 创建图表
getChart(self.chartIndex) && getChart(self.chartIndex).clear()
getChart(self.chartIndex) && getChart(self.chartIndex).setOption(option)// 创建图表
self.noData = false
} else {
self.noData = true
@@ -1076,8 +1076,8 @@ export default {
} else if (self.$refs.resizeBox.offsetWidth < 500) {
option.xAxis.splitNumber = 5
}
getChart(self.chartIndex).clear()
getChart(self.chartIndex).setOption(option)// 创建图表
getChart(self.chartIndex) && getChart(self.chartIndex).clear()
getChart(self.chartIndex) && getChart(self.chartIndex).setOption(option)// 创建图表
}
self.$refs['localLoading' + self.chartIndex].endLoading()
self.firstShow = true // 展示操作按键
@@ -1087,7 +1087,7 @@ export default {
getChart(this.chartIndex).on('magictypechanged', function (params) {
self.isStackArea = !self.isStackArea
if (self.isStackArea) {
getChart(self.chartIndex).setOption({
getChart(self.chartIndex) && getChart(self.chartIndex).setOption({
toolbox: {
feature: {
dataZoom: {
@@ -1160,7 +1160,7 @@ export default {
}
})
} else {
getChart(self.chartIndex).setOption({
getChart(self.chartIndex) && getChart(self.chartIndex).setOption({
toolbox: {
feature: {
dataZoom: {