From 8cefe32dac30f42746fb3213f08806d561148d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=B2=E6=9D=BE?= <523037378@qq.com> Date: Sun, 1 Mar 2020 17:59:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=BB=9F?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/addEndpointBox.vue | 19 ++++++++++++------- .../src/components/page/asset/asset.vue | 1 + .../components/page/dashboard/chartBox.vue | 10 ++++++---- .../src/components/page/project/project.vue | 2 +- nezha-fronted/src/main.js | 5 +++-- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index 4ce404603..1ad8cac86 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -60,13 +60,15 @@
-
-
-
{{item.host}}
- -
{{item.sn}}
-
-
+ +
+
+
{{item.host}}
+ +
{{item.sn}}
+
+
+
@@ -96,6 +98,7 @@ :data="endpointList" ref="endpointTable" style="width: 100%;border-radius: 4px;" + v-scrollBar:el-table height="calc(100% - 36px)" :row-class-name="setRowIndex" empty-text=" "> @@ -393,6 +396,7 @@ break; } } + this.$refs.assetScrollbar.update(); }, /*获取project列表*/ @@ -483,6 +487,7 @@ this.endpointTouch = true; this.endpointForm.projectId = this.currentProject.id; this.endpointForm.moduleId = this.currentModuleCopy.id; + this.$refs.assetScrollbar.update(); }, //将param转为json字符串格式 diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 5fccffb80..66ba498fc 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -53,6 +53,7 @@ height="calc(100% - 160px)" style="width: 100%;" :data="tableData" + v-scrollBar:el-table border tooltip-effect="light" > diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index bfc76a747..a695d7834 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -368,10 +368,12 @@ /*关闭弹框*/ esc() { - this.rightBox.show = false; - //this.editParamBox.show = false; - this.$refs.chartForm.resetFields();//清空表单 - this.chart.id='';//不清除,再次打开创建图表,会显示删除按钮 + if (this.rightBox.show) { + this.rightBox.show = false; + //this.editParamBox.show = false; + this.$refs.chartForm.resetFields();//清空表单 + this.chart.id='';//不清除,再次打开创建图表,会显示删除按钮 + } }, /*metric部分相关方法--begin*/ diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue index 9609b9262..1b0f15d87 100644 --- a/nezha-fronted/src/components/page/project/project.vue +++ b/nezha-fronted/src/components/page/project/project.vue @@ -167,7 +167,7 @@ -
+
diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index fae77e270..aecd213db 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -80,6 +80,7 @@ const el_scrollBar = el => { }; Vue.directive("scrollBar", { inserted(el, binding, vnode) { + console.info(1) const { arg } = binding; if (arg === "el-table") { el = el.querySelector(".el-table__body-wrapper"); @@ -95,8 +96,6 @@ Vue.directive("scrollBar", { el.classList.add("ps") ); }); - } else if (arg === 'metric-set') { - } const rules = ["fixed", "absolute", "relative"]; if (!rules.includes(window.getComputedStyle(el, null).position)) { @@ -110,9 +109,11 @@ Vue.directive("scrollBar", { el_scrollBar(el); }, componentUpdated(el, binding, vnode, oldVnode) { + console.info(2) const { arg } = binding; if (arg === "el-table") { el = el.querySelector(".el-table__body-wrapper"); + el.classList.add("ps"); !el && console.warn("未发现className为el-table__body-wrapper的dom"); } try {