From 37e95e1518f0cb7f5f329e44beaf7b87ed256830 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 14 Sep 2021 15:36:55 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-997=20=20fix=EF=BC=9ANEZHA=20=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=20=E5=88=A0=E9=99=A4=E5=AD=90=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E6=97=B6=20=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=80=89=E9=A1=B9=E9=87=8D=E5=A4=8D=20=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=20alertMeaasge=20dc=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/alert/alertLabel.vue | 4 ++-- .../src/components/common/searchInput.vue | 3 ++- .../common/table/alert/alertMessageTable.vue | 20 ++++++++++--------- .../src/components/page/alert/nzAlertTag.vue | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index 010ba5e47..eea7655d6 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -117,7 +117,7 @@ -
+
ID
{{alertLabelData && alertLabelData.id ? alertLabelData.id : '--'}}
@@ -302,7 +302,7 @@ export default { } }) } - if (this.type === 'datacenter') { + if (this.type === 'dc') { this.$get('dc/' + this.id).then((res) => { if (res.msg === 'success') { this.loading = false diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 6fb07f882..eed9ca4e8 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -1157,6 +1157,7 @@ export default { }, // 删除要搜索的条件 close_selcet_list (ind, e) { + console.log(this.searchMsg.searchLabelList,this.searchLabelList) if (e) { this.stop_click(e) } @@ -1176,7 +1177,7 @@ export default { } } */ this.searchMsg.searchLabelList.forEach((val, key) => { - if (this.select_list[ind].id == val.id) { + if (this.select_list[ind].label == val.label) { this.searchLabelList.splice(key + 1, 0, val) this.Iskeywords(ind) } diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 18a0aade7..4dec92cd4 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -90,7 +90,7 @@ { - if (key == 'asset' || key == 'module' || key == 'project' || key == 'datacenter' || key == 'endpoint') { + if (key == 'asset' || key == 'module' || key == 'project' || key == 'dc' || key == 'endpoint') { return 'normal' } else { return 'info' @@ -269,7 +269,7 @@ export default { }) }, labelsSort (obj) { - const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user'] + const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'datacenter', 'project', 'parent_asset', 'user'] if (typeof obj === 'string') obj = JSON.parse(obj) const labels = JSON.parse(JSON.stringify(obj)) const result = [] @@ -282,7 +282,12 @@ export default { } for (const key of buildIn) { if (key in labels) { - result.push({ label: key, value: labels[key] }) + if (key === 'datacenter') { + result.push({ label: 'dc', value: labels.datacenter }) + delete labels.datacenter + } else { + result.push({ label: key, value: labels[key] }) + } delete labels[key] } } @@ -542,7 +547,7 @@ export default { case 'module': case 'endpoint': case 'project': - case 'datacenter': + case 'dc': return false default: return true } @@ -566,9 +571,6 @@ export default { if (e) { const dom = e.currentTarget const position = dom.getBoundingClientRect() - if (type === 'datacenter') { - item[type] = item.dc - } this.$set(item[type], 'position', position) } this.$set(item[type], 'loading', loading) diff --git a/nezha-fronted/src/components/page/alert/nzAlertTag.vue b/nezha-fronted/src/components/page/alert/nzAlertTag.vue index 357a7fdf9..4d33f7ac8 100644 --- a/nezha-fronted/src/components/page/alert/nzAlertTag.vue +++ b/nezha-fronted/src/components/page/alert/nzAlertTag.vue @@ -1,6 +1,6 @@