diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue
index 08b47a1f3..b4d347a99 100644
--- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue
+++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue
@@ -310,15 +310,6 @@
},
/*时间条件查询--end*/
//公用操作
- jumpTo(data, id) {
- bus.$emit("menu-change", data);
- this.$router.push({
- path: "/" + data,
- query: {
- t: +new Date()
- }
- });
- },
getTableData(linkId) {
this.$get('panel', {type: this.from, link: linkId}).then(response => {
if (response.code === 200) {
@@ -397,9 +388,9 @@
} else {
_self.showTopBtn = false;
}
- if (scrollbarWrap.scrollHeight - scrollbarWrap.scrollTop - scrollbarWrap.offsetHeight < 20) {
+ /*if (scrollbarWrap.scrollHeight - scrollbarWrap.scrollTop - scrollbarWrap.offsetHeight < 20) {
_self.$refs.chartList.pageDataList(true, _self.panelId);
- }
+ }*/
}
},
focusInput:function(){
diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue
index 8cee0ea28..dd4ca3e75 100644
--- a/nezha-fronted/src/components/page/dashboard/panel.vue
+++ b/nezha-fronted/src/components/page/dashboard/panel.vue
@@ -108,87 +108,6 @@
title: this.$t('dashboard.panel.createPanelTitle')
},
tableHover: false,
- /*
- pickerOptions: {
- shortcuts: [{
- text: this.$t("dashboard.panel.recOne"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setHours(start.getHours() - 1);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.recFour"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setHours(start.getHours() - 4);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.recOneDay"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setDate(start.getDate() - 1);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.yesterday"),
- onClick(picker) {
- const start = new Date();
- const end = new Date();
- start.setDate(start.getDate() - 1);
- start.setHours(0);
- start.setMinutes(0);
- start.setSeconds(0);
- end.setDate(end.getDate() - 1);
- end.setHours(23);
- end.setMinutes(59);
- end.setSeconds(59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.recSevenDay"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setDate(start.getDate() - 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.recOneMonth"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setDate(start.getDate() - 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.curMonth"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setDate(1);
- start.setHours(0);
- start.setMinutes(0);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t("dashboard.panel.lastMonth"),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setDate(1);
- start.setMonth(start.getMonth() - 1);
- end.setDate(0);
- start.setStart();
- end.setEnd();
- picker.$emit('pick', [start, end]);
- }
- }]
- },*/
searchTime: [
new Date(bus.computeTimezone(new Date().getTime())).setHours(new Date(bus.computeTimezone(new Date().getTime())).getHours() - 1),
new Date(bus.computeTimezone(new Date().getTime()))
@@ -254,17 +173,13 @@
searchLabel: {}, //搜索参数
//---图表相关参数--start
dataList: [], // 数据列表
- //searchName: '', // 搜索名称
filter: { // 过滤条件
- //productId: 0,
panelId: 0,
start_time: '',
end_time: '',
searchName: ''
},
panelId: 0,
- //removeModal: false, // 删除弹出
- //deleteObj: {}, // 删除对象
//---图表相关参数--end
}
},
@@ -457,8 +372,6 @@
/*时间条件查询--end*/
//公用操作
jumpTo(data, id) {
- //this.$store.state.assetData.moduleData = data
- //this.$store.state.assetData.selectedData = id
bus.$emit("menu-change", data);
this.$router.push({
path: "/" + data,
diff --git a/nezha-fronted/src/tools.js b/nezha-fronted/src/tools.js
index eb6bc94cc..c6df6b087 100644
--- a/nezha-fronted/src/tools.js
+++ b/nezha-fronted/src/tools.js
@@ -380,16 +380,12 @@ export const chartResizeTool = {
},
start(vm, originalData, event) {
let data = JSON.parse(JSON.stringify(originalData)); //将初始对象复制,后续操作使用复制对象
- let shadow; //缩放时底部阴影dom
- let box; //图表内容dom
- try {
- shadow = vm.$refs.resizeShadow;
- } catch (e) {
+ let shadow = vm.$refs.resizeShadow; //缩放时底部阴影dom
+ if (!shadow) {
shadow = vm.$refs[0].resizeShadow;
}
- try {
- box = vm.$refs.resizeBox;
- } catch (e) {
+ let box = vm.$refs.resizeBox; //图表内容dom
+ if (!box) {
box = vm.$refs[0].resizeBox;
}
let chartBlankWidth = this.chartBlankWidth;
@@ -419,7 +415,6 @@ export const chartResizeTool = {
//调整resize-box的宽高
box.style.width = `${originalWidth+(mouseX-mouseOriginalX)-chartBlankWidth}px`;
box.style.height = `${originalHeight+(mouseY-mouseOriginalY)-chartBlankHeight}px`;
- //调整
//监听宽高的变化,变化量每达到step的50%时改变resize-shadow的尺寸并重绘resize-box内容
let remainderWidth = (box.offsetWidth+chartBlankWidth-shadowNewWidth)%stepWidth; //宽的余数
let remainderHeight = (box.offsetHeight+chartBlankHeight-shadowNewHeight)%stepHeight; //高的余数
@@ -429,8 +424,8 @@ export const chartResizeTool = {
//将resize-box的宽高设为resize-shadow的宽高
box.style.width = `${shadow.offsetWidth}px`;
box.style.height = `${shadow.offsetHeight}px`;
- data.height = box.offsetHeight;
- data.span = (box.offsetWidth+chartBlankWidth)/stepWidth;
+ data.height = Math.round(box.offsetHeight/stepHeight*stepHeight);
+ data.span = Math.round((box.offsetWidth+chartBlankWidth)/stepWidth);
//请求后台,保存变更
if (data.height != originalData.height || data.span != originalData.span) {
originalData.height = data.height;
@@ -443,7 +438,7 @@ export const chartResizeTool = {
document.removeEventListener("mousemove", moveListener);
document.removeEventListener("mouseup", mouseupListener);
}
- function boxStepHandler(width, height) { //宽高变化量,大于0放大小于0缩小等于0不变; return: boolean 是否重绘
+ function boxStepHandler(width, height) { //param: 宽高变化量,大于0放大,小于0缩小
let widthChange = false;
let heightChange = false;
if (width > stepWidth/2) { //放大shadow宽
@@ -456,10 +451,10 @@ export const chartResizeTool = {
if (widthChange) {
shadowNewWidth = shadow.offsetWidth;
}
- if (height > stepHeight/2) { //放大shadow宽
+ if (height > stepHeight/2) { //放大shadow高
heightChange = true;
shadow.style.height = `${shadow.offsetHeight+stepHeight}px`;
- } else if (height <= 0-(stepHeight/2)) { //缩小shadow宽
+ } else if (height <= 0-(stepHeight/2)) { //缩小shadow高
heightChange = true;
shadow.style.height = `${shadow.offsetHeight-stepHeight}px`;
}
@@ -472,7 +467,11 @@ export const chartResizeTool = {
if (box.classList.contains("resize-box-echarts")) { //echarts类型
vm.echartStore.resize({width: shadow.offsetWidth-16, height: shadow.offsetHeight-titleHeight-vm.$refs.legendArea.offsetHeight});
} else if (box.classList.contains("resize-box-table")) { //table类型
- box.querySelector(".el-table__body-wrapper")._ps_.update();
+ //刷新滚动条
+ let scrollbar = box.querySelector(".el-table__body-wrapper")._ps_;
+ if (scrollbar) {
+ scrollbar.update();
+ }
}
//chart外层宽高调整
let outerBox = document.getElementById(`chart-${data.id}`);