NEZ-421 perf: 修复悬浮框位置;增加圆心数据;
This commit is contained in:
@@ -474,7 +474,10 @@
|
|||||||
radius: [14, 22],
|
radius: [14, 22],
|
||||||
data: [],
|
data: [],
|
||||||
label: {
|
label: {
|
||||||
show: false
|
show: true,
|
||||||
|
formatter: "",
|
||||||
|
color: "#666666",
|
||||||
|
position: "center",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -376,6 +376,15 @@
|
|||||||
width: 390px;
|
width: 390px;
|
||||||
height: 285px;
|
height: 285px;
|
||||||
}
|
}
|
||||||
|
.leaflet-pane.leaflet-my-pane {
|
||||||
|
position: absolute;
|
||||||
|
top: -150px;
|
||||||
|
left: -420px;
|
||||||
|
|
||||||
|
.leaflet-tooltip {
|
||||||
|
transform: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
.tooltip--title {
|
.tooltip--title {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="overview" style="background-color: #f9f9f9;">
|
<div class="overview" style="background-color: #f9f9f9;">
|
||||||
|
<!--自定义地图鼠标悬浮提示dom,避免被overflow:hidden裁剪-->
|
||||||
|
<div class="my-pane" :style="{'left': `${tooltip.x}px`, 'top': `${tooltip.y}px`}"></div>
|
||||||
<!--标题-->
|
<!--标题-->
|
||||||
<div class="overview-content-header">
|
<div class="overview-content-header">
|
||||||
<div class="header-title" :class="{'hide-div':!isFullScreen}">{{systemName&&systemName != 'undefined'&&systemName != null?systemName: $t('dashboard.overview.contentTitle')}}</div>
|
<div class="header-title" :class="{'hide-div':!isFullScreen}">{{systemName&&systemName != 'undefined'&&systemName != null?systemName: $t('dashboard.overview.contentTitle')}}</div>
|
||||||
@@ -115,8 +117,7 @@
|
|||||||
<div class="content-col-content">
|
<div class="content-col-content">
|
||||||
<!--<chart-box chart-type="map" :tooltip-formatter="mapTooltipFormatter" :map="map" ref="dataCenterMap" @is-loading="(isLoading)=>{this.mapLoading = isLoading}"></chart-box>-->
|
<!--<chart-box chart-type="map" :tooltip-formatter="mapTooltipFormatter" :map="map" ref="dataCenterMap" @is-loading="(isLoading)=>{this.mapLoading = isLoading}"></chart-box>-->
|
||||||
<div id="map" style="height: 100%; width: 100%"></div>
|
<div id="map" style="height: 100%; width: 100%"></div>
|
||||||
<!--自定义地图鼠标悬浮提示dom,避免被overflow:hidden裁剪-->
|
|
||||||
<div class="my-pane"></div>
|
|
||||||
<!--<div class="right-bottom-zoom">
|
<!--<div class="right-bottom-zoom">
|
||||||
<div class="zoom-option" style="border-bottom: 1px solid #c5c8cb;" @click="zoomMap(1)"><span><i class="nz-icon nz-icon-enlarge"></i></span></div>
|
<div class="zoom-option" style="border-bottom: 1px solid #c5c8cb;" @click="zoomMap(1)"><span><i class="nz-icon nz-icon-enlarge"></i></span></div>
|
||||||
<div class="zoom-option" @click="zoomMap(-1)"><span><i class="nz-icon nz-icon-narrow"></i></span></div>
|
<div class="zoom-option" @click="zoomMap(-1)"><span><i class="nz-icon nz-icon-narrow"></i></span></div>
|
||||||
@@ -268,7 +269,12 @@
|
|||||||
},
|
},
|
||||||
system_server_time:null,
|
system_server_time:null,
|
||||||
freshDateTimer:null,
|
freshDateTimer:null,
|
||||||
freshDataTimer:null
|
freshDataTimer:null,
|
||||||
|
|
||||||
|
tooltip: {
|
||||||
|
x: 0,
|
||||||
|
y: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@@ -747,12 +753,14 @@
|
|||||||
tooltipPrometheusChart = echarts.init(document.querySelector("#tooltip-chart--prometheus"));
|
tooltipPrometheusChart = echarts.init(document.querySelector("#tooltip-chart--prometheus"));
|
||||||
let endpointOption = chartConfig.getOption("tooltipPie"),
|
let endpointOption = chartConfig.getOption("tooltipPie"),
|
||||||
prometheusOption = chartConfig.getOption("tooltipPie");
|
prometheusOption = chartConfig.getOption("tooltipPie");
|
||||||
|
endpointOption.series[0].label.formatter = data.endpointTotal + "";
|
||||||
endpointOption.series[0].data = [
|
endpointOption.series[0].data = [
|
||||||
{name: this.$t("dashboard.overview.asset.pingUp"), value: data.endpointUp ? data.endpointUp : 0},
|
{name: this.$t("dashboard.overview.asset.pingUp"), value: data.endpointUp ? data.endpointUp : 0},
|
||||||
{name: this.$t("dashboard.overview.asset.pingDown"), value: data.endpointDown ? data.endpointDown : 0}
|
{name: this.$t("dashboard.overview.asset.pingDown"), value: data.endpointDown ? data.endpointDown : 0}
|
||||||
];
|
];
|
||||||
endpointOption.title.text = this.$t("project.endpoint.endpoint");
|
endpointOption.title.text = this.$t("project.endpoint.endpoint");
|
||||||
endpointOption.legend.data = [this.$t("dashboard.overview.asset.pingUp"), this.$t("dashboard.overview.asset.pingDown")];
|
endpointOption.legend.data = [this.$t("dashboard.overview.asset.pingUp"), this.$t("dashboard.overview.asset.pingDown")];
|
||||||
|
prometheusOption.series[0].label.formatter = data.promTotal + "";
|
||||||
prometheusOption.series[0].data = [
|
prometheusOption.series[0].data = [
|
||||||
{name: this.$t("dashboard.overview.asset.pingUp"), value: data.promUp ? data.promUp : 0},
|
{name: this.$t("dashboard.overview.asset.pingUp"), value: data.promUp ? data.promUp : 0},
|
||||||
{name: this.$t("dashboard.overview.asset.pingDown"), value: data.promDown ? data.promDown : 0}
|
{name: this.$t("dashboard.overview.asset.pingDown"), value: data.promDown ? data.promDown : 0}
|
||||||
@@ -788,6 +796,10 @@
|
|||||||
map.on("tooltipopen", function(param) {
|
map.on("tooltipopen", function(param) {
|
||||||
vm.initTooltipChart(param);
|
vm.initTooltipChart(param);
|
||||||
});
|
});
|
||||||
|
map.on("tooltipclose", function(param) {
|
||||||
|
tooltipEndpointChart && tooltipEndpointChart.clear();
|
||||||
|
tooltipPrometheusChart && tooltipPrometheusChart.clear();
|
||||||
|
});
|
||||||
this.map = map;
|
this.map = map;
|
||||||
|
|
||||||
L.tileLayer(
|
L.tileLayer(
|
||||||
@@ -895,6 +907,14 @@
|
|||||||
|
|
||||||
let marker=L.circleMarker([areaInfo.latitude,areaInfo.longitude], {color: hasAlert?'#DE5D3F':'#23BF9A',opacity:0.42,fillColor: hasAlert?'#DE5D3F':'#23BF9A',fillOpacity: 0.5, radius: symbolSize,className:hasAlert?'error-item':''})
|
let marker=L.circleMarker([areaInfo.latitude,areaInfo.longitude], {color: hasAlert?'#DE5D3F':'#23BF9A',opacity:0.42,fillColor: hasAlert?'#DE5D3F':'#23BF9A',fillOpacity: 0.5, radius: symbolSize,className:hasAlert?'error-item':''})
|
||||||
marker.bindTooltip(this.mapTooltipFormatter(dcStat), {sticky: false, pane: "myPane", direction: "left", data: dcStat});
|
marker.bindTooltip(this.mapTooltipFormatter(dcStat), {sticky: false, pane: "myPane", direction: "left", data: dcStat});
|
||||||
|
marker.on("mouseover", (param) => {
|
||||||
|
//console.info(param);
|
||||||
|
let pane = document.querySelector(".leaflet-pane.leaflet-my-pane");
|
||||||
|
let point = param.containerPoint;
|
||||||
|
let event = param.originalEvent;
|
||||||
|
this.tooltip.x = event.clientX+point.x-event.layerX;
|
||||||
|
this.tooltip.y = event.clientY+point.y-event.layerY;
|
||||||
|
});
|
||||||
marker.addTo(this.map);
|
marker.addTo(this.map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1453,7 +1473,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"trendSearchParam.select": function(n, o) {
|
"trendSearchParam.select": function(n, o) {
|
||||||
@@ -1472,11 +1492,11 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
//vm.map.
|
//vm.map.
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
clearInterval(this.freshDataTimer)
|
clearInterval(this.freshDataTimer);
|
||||||
clearInterval(this.freshDateTimer)
|
clearInterval(this.freshDateTimer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -1512,10 +1532,8 @@
|
|||||||
.my-pane {
|
.my-pane {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
z-index: 9999;
|
z-index: 99999;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
left: 0;
|
|
||||||
top: 9px;
|
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user