From eabe5ac81bcef361f82f80f91515ba40eba47c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=B2=E6=9D=BE?= Date: Fri, 17 Apr 2020 21:00:35 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20edit-endpoint=E7=9A=84asset=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=BE=93=E5=85=A5=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.edit-endpoint的asset改为输入下拉 2.尝试修复project、asset右上角错位问题 --- .../common/rightBox/editEndpointBox.vue | 67 ++++++++++++++----- .../src/components/page/alert/list.vue | 8 ++- .../src/components/page/asset/asset.vue | 1 - .../src/components/page/project/project.vue | 1 - 4 files changed, 57 insertions(+), 20 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue index 44e6d92a8..dbe8de7b2 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue @@ -37,25 +37,36 @@ -
- + + + + <!– begin--顶部按钮–>
- - + <!– end--顶部按钮–> + <!–begin--标题–>
{{subBox.title}}
- - + <!–end--标题–> + <!––>
- + <!– begin--搜索框–>
- - + <!– end--搜索框–> + <!– begin--table–>
IP
@@ -98,15 +109,14 @@
- + <!– end--table–>
-
{{endpoint.host}}
- +
{{endpoint.host}}
-->
@@ -345,9 +355,22 @@ this.selectedAsset = obj; this.endpoint.host = obj.host; this.endpoint.assetId = obj.id; - this.endpoint.asset = obj; + this.$refs.endPointForm.validate(); + }, + inputAsset(e) { + this.endpoint.assetId = ""; + let host = e.target.value; + if (host) { + for (let i = 0; i < this.assetList.length; i++) { + if (host == this.assetList[i].host) { + this.endpoint.assetId = this.assetList[i].id; + this.selectedAsset = this.assetList[i]; + this.endpoint.host = host; + break; + } + } + } }, - // 获取endpoint弹框中module下拉框数据 getModuleList(projectId) { this.$get('module', {projectId: projectId}).then(response => { @@ -416,6 +439,20 @@ this.assetSearch.label = label; this.assetSearch.dropdownShow = false; }, + /*asset搜索建议*/ + assetSuggestion(queryString, callback) { + let data = []; + if (!queryString) { + data = this.assetList; + } else { + for (let i = 0; i < this.assetList.length; i++) { + if (this.assetList[i].host.indexOf(queryString.toLowerCase()) != -1) { + data.push(this.assetList[i]); + } + } + } + callback(data); + }, }, created() { this.getProjectList(); diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue index c35ac80a7..75c59311e 100644 --- a/nezha-fronted/src/components/page/alert/list.vue +++ b/nezha-fronted/src/components/page/alert/list.vue @@ -29,9 +29,11 @@ -
- -
+ +
+ +
+