From 0116f915b43f3fd19b2e745daa80080a5dbc8e9e Mon Sep 17 00:00:00 2001 From: zyh Date: Tue, 20 Jun 2023 11:31:39 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2887=20fix=EF=BC=9A=E4=BF=AE=E5=A4=8Dsearch?= =?UTF-8?q?=20input=20=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9C=89=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../css/components/common/searchInput.scss | 4 ++++ .../src/components/common/searchInput.vue | 17 ++++++++++------- nezha-fronted/src/components/page/tool/ping.vue | 3 +++ .../src/components/page/tool/trace.vue | 3 +++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/searchInput.scss b/nezha-fronted/src/assets/css/components/common/searchInput.scss index f8ae74d46..16dabf438 100644 --- a/nezha-fronted/src/assets/css/components/common/searchInput.scss +++ b/nezha-fronted/src/assets/css/components/common/searchInput.scss @@ -345,3 +345,7 @@ li { list-style: none; } + +.input-center-box .el-scrollbar__wrap{ + margin-right: 0 !important; +} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 68284d328..26a901903 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -419,7 +419,9 @@ export default { select_list: { // 监听下拉列表 handler (newData, oldData) { - this.$refs.searchScrollbar.update() + this.$nextTick(() => { + this.$refs.searchScrollbar.update() + }) if (newData.length == 0) { this.change_sreach_show = true this.clearSearchShow = false @@ -593,9 +595,9 @@ export default { setTimeout(function () { _this.getHeight() }) - /* this.$nextTick(() => { - this.$refs.searchScrollbar.update(); - }); */ + this.$nextTick(() => { + this.$refs.searchScrollbar.update() + }) }, // 一层下拉点击 tr_selectTypeInfo (val) { @@ -1065,6 +1067,10 @@ export default { this.input_list = true this.restructure_historyDate() + this.$nextTick(() => { + this.$refs.searchScrollbar.update() + }) + this.$emit('search', objectInfo) }, // 清空历史记录 @@ -1290,9 +1296,6 @@ export default { JSON.parse(JSON.stringify(this.searchMsg.searchLabelList)).forEach(val => { this.searchLabelList.push(val) }) - this.$nextTick(() => { - this.$refs.searchScrollbar.update() - }) this.select() }, // 修改已有参数 diff --git a/nezha-fronted/src/components/page/tool/ping.vue b/nezha-fronted/src/components/page/tool/ping.vue index 0cac8f410..83bb017ee 100644 --- a/nezha-fronted/src/components/page/tool/ping.vue +++ b/nezha-fronted/src/components/page/tool/ping.vue @@ -392,6 +392,9 @@ export default { await this.clearTask() } next() + }, + beforeDestroy () { + this.clearTask() } } diff --git a/nezha-fronted/src/components/page/tool/trace.vue b/nezha-fronted/src/components/page/tool/trace.vue index 3b91ed5aa..20b8462e1 100644 --- a/nezha-fronted/src/components/page/tool/trace.vue +++ b/nezha-fronted/src/components/page/tool/trace.vue @@ -383,6 +383,9 @@ export default { await this.clearTask() } next() + }, + beforeDestroy () { + this.clearTask() } }