NEZ-1408 fix:处理页面报错
This commit is contained in:
@@ -863,7 +863,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resize (chartItem) {
|
resize (chartItem) {
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoad (chartItem) {
|
showLoad (chartItem) {
|
||||||
@@ -498,7 +498,7 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const vm = this
|
const vm = this
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
const divHeight = self.$refs.legendArea.offsetHeight
|
const divHeight = self.$refs.legendArea ? self.$refs.legendArea.offsetHeight : 20
|
||||||
if (!self.chartData.height) {
|
if (!self.chartData.height) {
|
||||||
getChart(self.chartIndex).resize({ height: (400 - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
|
getChart(self.chartIndex).resize({ height: (400 - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
|
||||||
} else {
|
} else {
|
||||||
@@ -573,16 +573,16 @@ export default {
|
|||||||
if (self.pieData[0]) {
|
if (self.pieData[0]) {
|
||||||
if (self.pieData[0].data.length > 0) {
|
if (self.pieData[0].data.length > 0) {
|
||||||
getChart(self.chartIndex).clear()
|
getChart(self.chartIndex).clear()
|
||||||
getChart(self.chartIndex).setOption(self.option)// 创建图表
|
getChart(self.chartIndex) && getChart(self.chartIndex).setOption(self.option)// 创建图表
|
||||||
self.noData = false
|
self.noData = false
|
||||||
} else {
|
} else {
|
||||||
self.noData = true
|
self.noData = true
|
||||||
self.option = chartConfig.getOption('noData')
|
self.option = chartConfig.getOption('noData')
|
||||||
getChart(self.chartIndex).clear()
|
getChart(self.chartIndex).clear()
|
||||||
getChart(self.chartIndex).setOption(self.option)// 创建图表
|
getChart(self.chartIndex) && getChart(self.chartIndex).setOption(self.option)// 创建图表
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.$refs['localLoading' + self.chartIndex].endLoading()
|
self.$refs['localLoading' + self.chartIndex] && self.$refs['localLoading' + self.chartIndex].endLoading()
|
||||||
self.firstShow = true // 展示操作按键
|
self.firstShow = true // 展示操作按键
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
@@ -621,12 +621,12 @@ export default {
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
self.$set(self.option.tooltip, 'formatter', self.formatterFunc)
|
self.$set(self.option.tooltip, 'formatter', self.formatterFunc)
|
||||||
if (self.pieData[0].data.length > 0) {
|
if (self.pieData[0].data.length > 0) {
|
||||||
self.echartScreen.setOption(self.option)// 显示全屏界面
|
self.echartScreen && self.echartScreen.setOption(self.option)// 显示全屏界面
|
||||||
self.noData = false
|
self.noData = false
|
||||||
} else {
|
} else {
|
||||||
self.noData = true
|
self.noData = true
|
||||||
self.option = chartConfig.getOption('noData')
|
self.option = chartConfig.getOption('noData')
|
||||||
self.echartScreen.setOption(self.option)// 显示全屏界面
|
self.echartScreen && self.echartScreen.setOption(self.option)// 显示全屏界面
|
||||||
}
|
}
|
||||||
self.echartScreen.on('finished', function () {
|
self.echartScreen.on('finished', function () {
|
||||||
const legendDiv = document.getElementById('screenLegendArea' + self.chartIndex)
|
const legendDiv = document.getElementById('screenLegendArea' + self.chartIndex)
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ export default {
|
|||||||
this.$refs['localLoading' + this.chartIndex].startLoading()
|
this.$refs['localLoading' + this.chartIndex].startLoading()
|
||||||
},
|
},
|
||||||
endLoading (area) {
|
endLoading (area) {
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
},
|
},
|
||||||
preview () {
|
preview () {
|
||||||
this.$refs.chartsPreview.show(this.data)
|
this.$refs.chartsPreview.show(this.data)
|
||||||
@@ -538,7 +538,7 @@ export default {
|
|||||||
series: series
|
series: series
|
||||||
}
|
}
|
||||||
const chart = echarts.init(document.querySelector('#littleChart'))
|
const chart = echarts.init(document.querySelector('#littleChart'))
|
||||||
chart.setOption(option)// 创建图表
|
chart && chart.setOption(option)// 创建图表
|
||||||
},
|
},
|
||||||
timeFormat (val) {
|
timeFormat (val) {
|
||||||
return this.utcTimeToTimezoneStr(val)
|
return this.utcTimeToTimezoneStr(val)
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ export default {
|
|||||||
if (area === 'screen') {
|
if (area === 'screen') {
|
||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearChart () {
|
clearChart () {
|
||||||
|
|||||||
@@ -1916,7 +1916,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.init()
|
this.init()
|
||||||
window.addEventListener('resize', () => this.resize(), false)
|
window.addEventListener('resize', this.resize, false)
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
window.removeEventListener('resize', this.resize, false)
|
window.removeEventListener('resize', this.resize, false)
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoad (chartItem) {
|
showLoad (chartItem) {
|
||||||
@@ -398,14 +398,14 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const vm = this
|
const vm = this
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
const divHeight = self.$refs.legendArea.offsetHeight
|
const divHeight = self.$refs.legendArea ? self.$refs.legendArea.offsetHeight : 20
|
||||||
if (!self.chartData.height) {
|
if (!self.chartData.height) {
|
||||||
getChart(self.chartIndex).resize({ height: (400 - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
|
getChart(self.chartIndex).resize({ height: (400 - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
|
||||||
} else {
|
} else {
|
||||||
getChart(self.chartIndex).resize({ height: (self.chartData.height * vm.stepWidth - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
|
getChart(self.chartIndex).resize({ height: (self.chartData.height * vm.stepWidth - divHeight - self.$chartResizeTool.titleHeight - self.$chartResizeTool.chartBlankHeight) })
|
||||||
}
|
}
|
||||||
self.$set(self.option.tooltip, 'formatter', self.formatterFunc)
|
self.option.tooltip && self.$set(self.option.tooltip, 'formatter', self.formatterFunc)
|
||||||
self.$set(self.option.tooltip, 'position', function (point, params, dom, rect, size) {
|
self.option.tooltip && self.$set(self.option.tooltip, 'position', function (point, params, dom, rect, size) {
|
||||||
dom.style.transform = 'translateZ(0)'
|
dom.style.transform = 'translateZ(0)'
|
||||||
const windowWidth = window.innerWidth// 窗口宽度
|
const windowWidth = window.innerWidth// 窗口宽度
|
||||||
const windowHeight = window.innerHeight// 窗口高度
|
const windowHeight = window.innerHeight// 窗口高度
|
||||||
@@ -472,16 +472,16 @@ export default {
|
|||||||
})
|
})
|
||||||
if (self.pieData[0].data.length > 0) {
|
if (self.pieData[0].data.length > 0) {
|
||||||
getChart(self.chartIndex).clear()
|
getChart(self.chartIndex).clear()
|
||||||
getChart(self.chartIndex).setOption(self.option)// 创建图表
|
getChart(self.chartIndex) && getChart(self.chartIndex).setOption(self.option)// 创建图表
|
||||||
self.noData = false
|
self.noData = false
|
||||||
} else {
|
} else {
|
||||||
self.noData = true
|
self.noData = true
|
||||||
self.option = chartConfig.getOption('noData')
|
self.option = chartConfig.getOption('noData')
|
||||||
getChart(self.chartIndex).clear()
|
getChart(self.chartIndex).clear()
|
||||||
getChart(self.chartIndex).setOption(self.option)// 创建图表
|
getChart(self.chartIndex) && getChart(self.chartIndex).setOption(self.option)// 创建图表
|
||||||
}
|
}
|
||||||
|
|
||||||
self.$refs['localLoading' + self.chartIndex].endLoading()
|
self.$refs['localLoading' + self.chartIndex] && self.$refs['localLoading' + self.chartIndex].endLoading()
|
||||||
self.firstShow = true // 展示操作按键
|
self.firstShow = true // 展示操作按键
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
@@ -519,12 +519,12 @@ export default {
|
|||||||
self.echartScreen.resize({ height: (sumHeight - divHeight - 58) })// 图表的高度
|
self.echartScreen.resize({ height: (sumHeight - divHeight - 58) })// 图表的高度
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (self.pieData[0].data.length > 0) {
|
if (self.pieData[0].data.length > 0) {
|
||||||
self.echartScreen.setOption(self.option)// 显示全屏界面
|
self.echartScreen && self.echartScreen.setOption(self.option)// 显示全屏界面
|
||||||
self.noData = false
|
self.noData = false
|
||||||
} else {
|
} else {
|
||||||
self.noData = true
|
self.noData = true
|
||||||
self.option = chartConfig.getOption('noData')
|
self.option = chartConfig.getOption('noData')
|
||||||
self.echartScreen.setOption(self.option)// 显示全屏界面
|
self.echartScreen && self.echartScreen.setOption(self.option)// 显示全屏界面
|
||||||
}
|
}
|
||||||
self.echartScreen.on('finished', function () {
|
self.echartScreen.on('finished', function () {
|
||||||
const legendDiv = document.getElementById('screenLegendArea' + self.chartIndex)
|
const legendDiv = document.getElementById('screenLegendArea' + self.chartIndex)
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoad (chartItem) {
|
showLoad (chartItem) {
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ export default {
|
|||||||
if (area === 'screen') {
|
if (area === 'screen') {
|
||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resize (chartItem) {
|
resize (chartItem) {
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export default {
|
|||||||
if (area === 'screen') {
|
if (area === 'screen') {
|
||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearChart () {
|
clearChart () {
|
||||||
|
|||||||
@@ -1081,9 +1081,9 @@ export default {
|
|||||||
this.echartModalStore.resize()
|
this.echartModalStore.resize()
|
||||||
this.echartModalStore.clear()
|
this.echartModalStore.clear()
|
||||||
if (dataArg.length < 1) {
|
if (dataArg.length < 1) {
|
||||||
this.echartModalStore.setOption(chartConfig.getOption('noData'))
|
this.echartModalStore && this.echartModalStore.setOption(chartConfig.getOption('noData'))
|
||||||
} else {
|
} else {
|
||||||
this.echartModalStore.setOption(option)// 创建图表
|
this.echartModalStore && this.echartModalStore.setOption(option)// 创建图表
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs.loadingPreview.endLoading()
|
this.$refs.loadingPreview.endLoading()
|
||||||
@@ -1295,9 +1295,9 @@ export default {
|
|||||||
this.echartModalStore.resize()
|
this.echartModalStore.resize()
|
||||||
this.echartModalStore.clear()
|
this.echartModalStore.clear()
|
||||||
if (dataArg[0].data.length < 1) {
|
if (dataArg[0].data.length < 1) {
|
||||||
this.echartModalStore.setOption(chartConfig.getOption('noData'))
|
this.echartModalStore && this.echartModalStore.setOption(chartConfig.getOption('noData'))
|
||||||
} else {
|
} else {
|
||||||
this.echartModalStore.setOption(option)// 创建图表
|
this.echartModalStore && this.echartModalStore.setOption(option)// 创建图表
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs.loadingPreview.endLoading()
|
this.$refs.loadingPreview.endLoading()
|
||||||
@@ -1360,9 +1360,9 @@ export default {
|
|||||||
this.echartModalStore.resize()
|
this.echartModalStore.resize()
|
||||||
this.echartModalStore.clear()
|
this.echartModalStore.clear()
|
||||||
if (dataArg[0].data.length < 1) {
|
if (dataArg[0].data.length < 1) {
|
||||||
this.echartModalStore.setOption(chartConfig.getOption('noData'))
|
this.echartModalStore && this.echartModalStore.setOption(chartConfig.getOption('noData'))
|
||||||
} else {
|
} else {
|
||||||
this.echartModalStore.setOption(option)// 创建图表
|
this.echartModalStore && this.echartModalStore.setOption(option)// 创建图表
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs.loadingPreview.endLoading()
|
this.$refs.loadingPreview.endLoading()
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoad (chartItem) {
|
showLoad (chartItem) {
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ export default {
|
|||||||
this.caretShow = true
|
this.caretShow = true
|
||||||
if (getChart(this.chartIndex)) {
|
if (getChart(this.chartIndex)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getChart(this.chartIndex).setOption({
|
getChart(this.chartIndex) && getChart(this.chartIndex).setOption({
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: true
|
show: true
|
||||||
}
|
}
|
||||||
@@ -357,7 +357,7 @@ export default {
|
|||||||
this.caretShow = false
|
this.caretShow = false
|
||||||
if (getChart(this.chartIndex)) {
|
if (getChart(this.chartIndex)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getChart(this.chartIndex).setOption({
|
getChart(this.chartIndex) && getChart(this.chartIndex).setOption({
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ export default {
|
|||||||
mouseEnterFullChart () {
|
mouseEnterFullChart () {
|
||||||
if (this.echartModalStore) {
|
if (this.echartModalStore) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.echartModalStore.setOption({
|
this.echartModalStore && this.echartModalStore.setOption({
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: true
|
show: true
|
||||||
}
|
}
|
||||||
@@ -380,7 +380,7 @@ export default {
|
|||||||
if (this.echartModalStore) {
|
if (this.echartModalStore) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.echartModalStore) {
|
if (this.echartModalStore) {
|
||||||
this.echartModalStore.setOption({
|
this.echartModalStore && this.echartModalStore.setOption({
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
@@ -451,7 +451,7 @@ export default {
|
|||||||
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
||||||
delete option.yAxis.maxInterval
|
delete option.yAxis.maxInterval
|
||||||
}
|
}
|
||||||
getChart(this.chartIndex).setOption({
|
getChart(this.chartIndex) && getChart(this.chartIndex).setOption({
|
||||||
yAxis: {
|
yAxis: {
|
||||||
...option.yAxis
|
...option.yAxis
|
||||||
}
|
}
|
||||||
@@ -567,7 +567,7 @@ export default {
|
|||||||
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
||||||
delete option.yAxis.maxInterval
|
delete option.yAxis.maxInterval
|
||||||
}
|
}
|
||||||
echart.setOption({
|
echart && echart.setOption({
|
||||||
yAxis: {
|
yAxis: {
|
||||||
...option.yAxis
|
...option.yAxis
|
||||||
}
|
}
|
||||||
@@ -1259,12 +1259,12 @@ export default {
|
|||||||
}
|
}
|
||||||
option.series = self.seriesItemArrScreen
|
option.series = self.seriesItemArrScreen
|
||||||
if (dataArg && dataArg.length > 0) {
|
if (dataArg && dataArg.length > 0) {
|
||||||
self.echartModalStore.setOption(option)// 显示全屏界面
|
self.echartModalStore && self.echartModalStore.setOption(option)// 显示全屏界面
|
||||||
self.noData = false
|
self.noData = false
|
||||||
} else {
|
} else {
|
||||||
self.noData = true
|
self.noData = true
|
||||||
option = chartConfig.getOptionNoData('noData')
|
option = chartConfig.getOptionNoData('noData')
|
||||||
self.echartModalStore.setOption(option)// 显示全屏界面
|
self.echartModalStore && self.echartModalStore.setOption(option)// 显示全屏界面
|
||||||
}
|
}
|
||||||
self.echartModalStore.on('finished', function () {
|
self.echartModalStore.on('finished', function () {
|
||||||
const legendDiv = document.getElementById('screenLegendArea' + self.chartIndex)
|
const legendDiv = document.getElementById('screenLegendArea' + self.chartIndex)
|
||||||
@@ -1952,7 +1952,7 @@ export default {
|
|||||||
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
||||||
delete option.yAxis.maxInterval
|
delete option.yAxis.maxInterval
|
||||||
}
|
}
|
||||||
getChart(this.chartIndex).setOption({
|
getChart(this.chartIndex) && getChart(this.chartIndex).setOption({
|
||||||
series: this.seriesItem,
|
series: this.seriesItem,
|
||||||
yAxis: {
|
yAxis: {
|
||||||
...option.yAxis
|
...option.yAxis
|
||||||
@@ -1999,7 +1999,7 @@ export default {
|
|||||||
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
if (unit.type == 'Time' || option.yAxis.maxInterval === 1) {
|
||||||
delete option.yAxis.maxInterval
|
delete option.yAxis.maxInterval
|
||||||
}
|
}
|
||||||
this.echartModalStore.setOption({
|
this.echartModalStore && this.echartModalStore.setOption({
|
||||||
series: this.seriesItemScreen,
|
series: this.seriesItemScreen,
|
||||||
yAxis: {
|
yAxis: {
|
||||||
...option.yAxis
|
...option.yAxis
|
||||||
@@ -2135,7 +2135,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
minInterval = 20 * 60 * 1000
|
minInterval = 20 * 60 * 1000
|
||||||
}
|
}
|
||||||
getChart(this.chartIndex).setOption({ xAxis: { minInterval: minInterval } })
|
getChart(this.chartIndex) && getChart(this.chartIndex).setOption({ xAxis: { minInterval: minInterval } })
|
||||||
} else {
|
} else {
|
||||||
if (this.$refs.resizeBox.offsetWidth < 200) {
|
if (this.$refs.resizeBox.offsetWidth < 200) {
|
||||||
splitNumber = 1
|
splitNumber = 1
|
||||||
@@ -2144,7 +2144,7 @@ export default {
|
|||||||
} else if (this.$refs.resizeBox.offsetWidth < 500) {
|
} else if (this.$refs.resizeBox.offsetWidth < 500) {
|
||||||
splitNumber = 5
|
splitNumber = 5
|
||||||
}
|
}
|
||||||
getChart(this.chartIndex).setOption({ xAxis: { splitNumber: splitNumber } })
|
getChart(this.chartIndex) && getChart(this.chartIndex).setOption({ xAxis: { splitNumber: splitNumber } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoad (chartItem) {
|
showLoad (chartItem) {
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export default {
|
|||||||
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
|
||||||
} else {
|
} else {
|
||||||
// this.showLoading = false;
|
// this.showLoading = false;
|
||||||
this.$refs['localLoading' + this.chartIndex].endLoading()
|
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoad (chartItem) {
|
showLoad (chartItem) {
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ export default {
|
|||||||
this.terminalSocket.onclose = () => {
|
this.terminalSocket.onclose = () => {
|
||||||
// 报错sorry的,还没来得及看信息就关闭
|
// 报错sorry的,还没来得及看信息就关闭
|
||||||
// this.$emit("closeConsole",this.terminal.name);//
|
// this.$emit("closeConsole",this.terminal.name);//
|
||||||
this.term.setOption('disableStdin', true)
|
this.term && this.term.setOption('disableStdin', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 错误
|
// 错误
|
||||||
@@ -319,7 +319,7 @@ export default {
|
|||||||
this.conFinish = false
|
this.conFinish = false
|
||||||
},
|
},
|
||||||
setFontSize (fontSize) {
|
setFontSize (fontSize) {
|
||||||
this.term.setOption('fontSize', fontSize)
|
this.term && this.term.setOption('fontSize', fontSize)
|
||||||
const consoleBox = document.getElementById('ternimalContainer' + this.idIndex)
|
const consoleBox = document.getElementById('ternimalContainer' + this.idIndex)
|
||||||
const width = document.body.clientWidth// 可视宽度
|
const width = document.body.clientWidth// 可视宽度
|
||||||
let height = parseInt(consoleBox.style.height)
|
let height = parseInt(consoleBox.style.height)
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
return this.chart.getOption()
|
return this.chart.getOption()
|
||||||
},
|
},
|
||||||
setOption: function (option) {
|
setOption: function (option) {
|
||||||
this.chart.setOption(option)
|
this.chart && this.chart.setOption(option)
|
||||||
},
|
},
|
||||||
setSeries: function (series, legend, legendData) {
|
setSeries: function (series, legend, legendData) {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
@@ -181,12 +181,12 @@ export default {
|
|||||||
if (this.option.series instanceof Array) {
|
if (this.option.series instanceof Array) {
|
||||||
this.option.series = this.option.series.filter((item, index) => index < this.dataSize)
|
this.option.series = this.option.series.filter((item, index) => index < this.dataSize)
|
||||||
}
|
}
|
||||||
this.chart.setOption(this.option)
|
this.chart && this.chart.setOption(this.option)
|
||||||
} else {
|
} else {
|
||||||
this.noData = true
|
this.noData = true
|
||||||
const option = chartConfig.getOption('noData')
|
const option = chartConfig.getOption('noData')
|
||||||
this.chart.clear()
|
this.chart.clear()
|
||||||
this.chart.setOption(option)
|
this.chart && this.chart.setOption(option)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 坐标轴label鼠标悬浮提示
|
// 坐标轴label鼠标悬浮提示
|
||||||
@@ -543,7 +543,7 @@ export default {
|
|||||||
const option = {
|
const option = {
|
||||||
series: this.optionSeriesAll
|
series: this.optionSeriesAll
|
||||||
}
|
}
|
||||||
this.chart.setOption(option)
|
this.chart && this.chart.setOption(option)
|
||||||
this.chart.resize()
|
this.chart.resize()
|
||||||
},
|
},
|
||||||
chartInit () {
|
chartInit () {
|
||||||
|
|||||||
@@ -654,8 +654,8 @@ export default {
|
|||||||
]
|
]
|
||||||
prometheusOption.title.text = vm.$t('config.agent.agent.agent')
|
prometheusOption.title.text = vm.$t('config.agent.agent.agent')
|
||||||
prometheusOption.legend.data = [vm.$t('config.agent.up'), vm.$t('config.agent.down')]
|
prometheusOption.legend.data = [vm.$t('config.agent.up'), vm.$t('config.agent.down')]
|
||||||
tooltipEndpointChart.setOption(endpointOption, true)
|
tooltipEndpointChart && tooltipEndpointChart.setOption(endpointOption, true)
|
||||||
tooltipPrometheusChart.setOption(prometheusOption, true)
|
tooltipPrometheusChart && tooltipPrometheusChart.setOption(prometheusOption, true)
|
||||||
}, 100)
|
}, 100)
|
||||||
/* setTimeout(function() {
|
/* setTimeout(function() {
|
||||||
tooltipEndpointChart.setOption(endpointOption);
|
tooltipEndpointChart.setOption(endpointOption);
|
||||||
@@ -1168,7 +1168,7 @@ export default {
|
|||||||
const limit = geo[0].scaleLimit
|
const limit = geo[0].scaleLimit
|
||||||
const value = zoom + val
|
const value = zoom + val
|
||||||
if (value <= limit.max && value >= limit.min) {
|
if (value <= limit.max && value >= limit.min) {
|
||||||
this.$refs.dataCenterMap.setOption({ geo: { zoom: value } })
|
this.$refs.dataCenterMap && this.$refs.dataCenterMap.setOption({ geo: { zoom: value } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1424,7 +1424,7 @@ export default {
|
|||||||
const limit = geo[0].scaleLimit
|
const limit = geo[0].scaleLimit
|
||||||
const value = zoom + val
|
const value = zoom + val
|
||||||
if (value <= limit.max && value >= limit.min) {
|
if (value <= limit.max && value >= limit.min) {
|
||||||
this.$refs.dataCenterMap.setOption({ geo: { zoom: value } })
|
this.$refs.dataCenterMap && this.$refs.dataCenterMap.setOption({ geo: { zoom: value } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user