perf: endpoint-query交互优化
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<span>
|
||||
<!-- 副列表 -->
|
||||
<div @mousedown="listResize" class="sub-list-resize" v-if="showSubList && !isFullScreen">一</div>
|
||||
<div class="sub-list sub-list-transition" v-if="showSubList">
|
||||
<div class="sub-list main-and-sub-transition" v-if="showSubList">
|
||||
<!--窗口大小控制-->
|
||||
<div class="sub-list-window-control">
|
||||
<!--退出全屏-->
|
||||
|
||||
@@ -179,6 +179,7 @@
|
||||
import chartDataFormat from "../../../charts/chartDataFormat";
|
||||
import chart from '../../../page/dashboard/overview/chart'
|
||||
var timeout;
|
||||
var internal;
|
||||
export default {
|
||||
name: "endpointQueryTab",
|
||||
components: {
|
||||
@@ -255,7 +256,6 @@
|
||||
bus.$emit("menu-change", 'panel');
|
||||
this.$store.state.showPanel.id = panel.id;
|
||||
this.$store.state.showPanel.name = panel.name;
|
||||
console.info(this.$router)
|
||||
this.$router.push({
|
||||
path: "/panel",
|
||||
query: {
|
||||
@@ -266,10 +266,10 @@
|
||||
},
|
||||
tableReload() {
|
||||
var table = this.$refs.endpointQueryTable;
|
||||
let resizeTimeout = setInterval(() => {
|
||||
internal = setInterval(() => {
|
||||
if (!window.resizing) {
|
||||
table.setHeight();
|
||||
clearInterval(resizeTimeout);
|
||||
clearInterval(internal);
|
||||
}
|
||||
}, 200);
|
||||
},
|
||||
@@ -279,6 +279,7 @@
|
||||
this.queryData = [];
|
||||
this.tableData = [];
|
||||
this.tableDataCopy = '';
|
||||
setTimeout(() => {
|
||||
this.$get("/prom/api/v1/query?query={endpoint='" + this.currentEndpoint.id + "'}&time=" + this.formatTime).then(response=>{
|
||||
this.loading = false;
|
||||
if(response.status==="success"){
|
||||
@@ -352,6 +353,7 @@
|
||||
this.$nextTick(this.$refs.endpointQueryTable.doLayout());
|
||||
}
|
||||
});
|
||||
}, 420);
|
||||
},
|
||||
clearSelectedMetrics() {
|
||||
this.$refs.endpointQueryTable.clearSelection();
|
||||
|
||||
@@ -258,6 +258,7 @@ export const bottomBoxWindow = {
|
||||
}
|
||||
},
|
||||
exitFullScreen(vm) {
|
||||
window.resizing = true;
|
||||
let contentRightDom = document.querySelector(".content-right"); //右侧内容区
|
||||
let contentRightHeight = contentRightDom.offsetHeight;//可视高度
|
||||
//主列表
|
||||
@@ -273,9 +274,11 @@ export const bottomBoxWindow = {
|
||||
if (document.querySelector(".sub-list").offsetHeight >= 100) {
|
||||
vm.subResizeShow = true;
|
||||
}
|
||||
window.resizing = false;
|
||||
}, 210);
|
||||
},
|
||||
fullScreen(vm) {
|
||||
window.resizing = true;
|
||||
let contentRightDom = document.querySelector(".content-right"); //右侧内容区
|
||||
let contentRightHeight = contentRightDom.offsetHeight;//可视高度
|
||||
vm.isFullScreen = true;
|
||||
@@ -285,6 +288,7 @@ export const bottomBoxWindow = {
|
||||
vm.mainResizeShow = false;
|
||||
//副列表
|
||||
document.querySelector(".sub-list").style.height = contentRightHeight + 'px';
|
||||
window.resizing = false;
|
||||
},
|
||||
showSubListWatch(vm, n) {
|
||||
vm.inTransform = n;
|
||||
|
||||
Reference in New Issue
Block a user