Merge branch 'dev-3.1' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.2

This commit is contained in:
zhangyu
2021-12-06 17:33:38 +08:00
20 changed files with 60 additions and 59 deletions

View File

@@ -72,7 +72,7 @@
.nz-chart-dropdown { .nz-chart-dropdown {
position: absolute; position: absolute;
top: 30px; top: 30px;
left: calc(100% - 210px); left: calc(100% - 160px);
transform-origin: center top; transform-origin: center top;
z-index: 1000; z-index: 1000;
width: 200px; width: 200px;
@@ -708,7 +708,7 @@
.chart-title-pit { .chart-title-pit {
position: absolute; position: absolute;
top: 40px; top: 40px;
min-width: 200px; min-width: 170px;
min-height: 20px; min-height: 20px;
line-height: 20px; line-height: 20px;
padding: 10px; padding: 10px;

View File

@@ -858,7 +858,8 @@ export default {
// this.showLoadingScreen = false; // this.showLoadingScreen = false;
this.$refs['localLoadingScreen' + this.chartIndex].endLoading() this.$refs['localLoadingScreen' + this.chartIndex].endLoading()
} else { } else {
this.$refs['localLoading' + this.chartIndex].endLoading() // this.showLoading = false;
this.$refs['localLoading' + this.chartIndex] && this.$refs['localLoading' + this.chartIndex].endLoading()
} }
}, },
resize (chartItem) { resize (chartItem) {

View File

@@ -223,7 +223,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) {
@@ -493,7 +493,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 {
@@ -568,16 +568,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)
}) })
@@ -616,12 +616,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)

View File

@@ -401,7 +401,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)
@@ -535,7 +535,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)

View File

@@ -192,7 +192,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 () {

View File

@@ -1848,7 +1848,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)

View File

@@ -219,7 +219,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) {
@@ -393,14 +393,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// 窗口高度
@@ -467,16 +467,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)
}) })
@@ -514,12 +514,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)

View File

@@ -315,7 +315,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) {

View File

@@ -282,7 +282,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) {

View File

@@ -200,7 +200,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 () {

View File

@@ -1025,9 +1025,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()
@@ -1239,9 +1239,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()
@@ -1304,9 +1304,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()

View File

@@ -146,7 +146,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) {

View File

@@ -340,7 +340,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
} }
@@ -352,7 +352,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
} }
@@ -363,7 +363,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
} }
@@ -375,7 +375,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
} }
@@ -446,7 +446,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
} }
@@ -562,7 +562,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
} }
@@ -1251,12 +1251,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)
@@ -1944,7 +1944,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
@@ -1991,7 +1991,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
@@ -2127,7 +2127,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
@@ -2136,7 +2136,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 } })
} }
} }
} }

View File

@@ -217,7 +217,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) {

View File

@@ -144,7 +144,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) {

View File

@@ -236,7 +236,8 @@ export default {
// 关闭 // 关闭
this.terminalSocket.onclose = () => { this.terminalSocket.onclose = () => {
// 报错sorry的还没来得及看信息就关闭 // 报错sorry的还没来得及看信息就关闭
this.term.setOption('disableStdin', true) // this.$emit("closeConsole",this.terminal.name);//
this.term && this.term.setOption('disableStdin', true)
} }
// 错误 // 错误
@@ -268,7 +269,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)

View File

@@ -1,7 +1,6 @@
import { register as registerFlow } from '@topology/flow-diagram' import { register as registerFlow } from '@topology/flow-diagram'
import { register as registerActivity } from '@topology/activity-diagram' import { register as registerActivity } from '@topology/activity-diagram'
import { register as registerSequence } from '@topology/sequence-diagram' import { register as registerSequence } from '@topology/sequence-diagram'
import { register as registerChart } from '@topology/chart-diagram'
import { Node, Rect, Point, Direction } from '@topology/core' import { Node, Rect, Point, Direction } from '@topology/core'
// import { register as registerClass } from './class-diagram/index' // import { register as registerClass } from './class-diagram/index'
export let canvas export let canvas
@@ -10,7 +9,7 @@ export function canvasRegister () {
registerFlow() registerFlow()
registerActivity() registerActivity()
registerSequence() registerSequence()
registerChart() // registerChart()
// registerClass() // registerClass()
} }

View File

@@ -89,7 +89,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) {
@@ -180,12 +180,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鼠标悬浮提示
@@ -527,7 +527,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 () {

View File

@@ -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);
@@ -1009,7 +1009,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 } })
} }
} }
}, },

View File

@@ -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 } })
} }
} }
}, },