diff --git a/nezha-fronted/src/assets/css/components/common/alert/alertMessageInfo.scss b/nezha-fronted/src/assets/css/components/common/alert/alertMessageInfo.scss index 562e367fc..322838393 100644 --- a/nezha-fronted/src/assets/css/components/common/alert/alertMessageInfo.scss +++ b/nezha-fronted/src/assets/css/components/common/alert/alertMessageInfo.scss @@ -68,6 +68,9 @@ border-radius: 2px; box-sizing: border-box; padding: 0px 20px 20px 0; + .table-no-data { + height: calc(100% - 80px); + } .time-line-header{ padding: 20px; font-size: 16px; @@ -75,6 +78,26 @@ font-weight: 600; display: flex; justify-content: space-between; + .scope-icon-box { + display: flex; + flex: 1; + justify-content: right; + } + .scope-box { + cursor: pointer; + color: $--background-color-disabled; + .nz-icon { + margin-right: 5px; + color: $--background-color-disabled ; + font-weight: 400; + } + } + .scope-box.is-select{ + color: $--color-monitor; + .nz-icon { + color: $--color-monitor; + } + } #time-line-scope{ //float: right; } diff --git a/nezha-fronted/src/components/common/alert/alertMessageInfoTimeLine.vue b/nezha-fronted/src/components/common/alert/alertMessageInfoTimeLine.vue index a0b043dcd..af299a9bc 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageInfoTimeLine.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageInfoTimeLine.vue @@ -2,25 +2,11 @@
{{$t('alert.relatedAlerts')}} - - - - +
+
+ +
+
item.isSelect).map(item => item.key).join(','), id: this.infoData.id, state: '', startAt: this.timezoneToUtcTimeStr(this.time[0] * 1000, 'YYYY-MM-DD HH:mm:ss'), @@ -203,10 +197,41 @@ export default { } } }, - changeScope (value) { - console.log(value) - this.pageNo = 1 - this.getTimeLineData() + selectIcon (item) { + switch (item.key) { + case 'asset' : return 'nz-icon-overview-project' + case 'datacenter' : return 'nz-icon-Datacenter2' + case 'project' : return 'nz-icon-project' + case 'module' : return 'nz-icon-overview-module' + case 'endpoint' : return 'nz-icon-overview-endpoint' + case 'alertrule' : return 'nz-icon-Alertrule' + case 'hash' : return 'nz-icon-module5' + } + return 'nz-icon-module5' + }, + scopeChange (scope) { + if (this.scopeChangeTimer) { + clearInterval(this.scopeChangeTimer) + this.scopeChangeTimer = null + } + this.loading = true + const isSelectArr = this.scopeList.filter(item => item.isSelect) + if (isSelectArr.length === this.scopeList.length) { + this.scopeList.forEach(item => { + item.isSelect = false + }) + scope.isSelect = !scope.isSelect + } else if (isSelectArr.length === 1 && isSelectArr[0].type === scope.type) { + this.scopeList.forEach(item => { + item.isSelect = true + }) + } else { + scope.isSelect = !scope.isSelect + } + this.scopeChangeTimer = setTimeout(() => { + this.pageNo = 1 + this.getTimeLineData() + }, 100) } } }